alchemymvc 1.1.9 → 1.2.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/lib/app/conduit/socket_conduit.js +620 -620
- package/lib/app/datasource/mongo_datasource.js +75 -10
- package/lib/app/helper/backed_map.js +257 -0
- package/lib/app/helper/enum_values.js +125 -0
- package/lib/app/helper/router_helper.js +7 -1
- package/lib/app/helper/socket_helper.js +613 -613
- package/lib/app/helper_datasource/00-nosql_datasource.js +73 -19
- package/lib/app/helper_field/enum_field.js +9 -36
- package/lib/app/helper_field/schema_field.js +11 -21
- package/lib/app/helper_model/criteria.js +73 -18
- package/lib/app/helper_model/field_config.js +24 -5
- package/lib/app/helper_model/model.js +45 -7
- package/lib/app/model/alchemy_migration_model.js +33 -0
- package/lib/bootstrap.js +9 -0
- package/lib/class/datasource.js +2 -2
- package/lib/class/element.js +6 -1
- package/lib/class/field.js +7 -1
- package/lib/class/migration.js +138 -0
- package/lib/class/model.js +11 -19
- package/lib/class/schema.js +14 -12
- package/lib/core/client_alchemy.js +14 -0
- package/lib/core/socket.js +159 -159
- package/lib/init/alchemy.js +1793 -1779
- package/lib/init/functions.js +4 -1
- package/lib/init/load_functions.js +8 -2
- package/lib/init/requirements.js +101 -96
- package/package.json +13 -13
- package/CHANGELOG.md +0 -458
package/lib/init/functions.js
CHANGED
|
@@ -1325,7 +1325,7 @@ Alchemy.setMethod(function exposeStatic(name, value) {
|
|
|
1325
1325
|
*
|
|
1326
1326
|
* @author Jelle De Loecker <jelle@develry.be>
|
|
1327
1327
|
* @since 1.1.0
|
|
1328
|
-
* @version 1.1
|
|
1328
|
+
* @version 1.2.1
|
|
1329
1329
|
*/
|
|
1330
1330
|
Alchemy.setMethod(function exposeDefaultStaticVariables() {
|
|
1331
1331
|
|
|
@@ -1372,6 +1372,9 @@ Alchemy.setMethod(function exposeDefaultStaticVariables() {
|
|
|
1372
1372
|
|
|
1373
1373
|
hawkejs.exposeStatic('app_version', app_version);
|
|
1374
1374
|
hawkejs.app_version = app_version;
|
|
1375
|
+
|
|
1376
|
+
// Emit as a global event so plugins can also expose their data
|
|
1377
|
+
this.emit('generate_static_variables', hawkejs);
|
|
1375
1378
|
});
|
|
1376
1379
|
|
|
1377
1380
|
/**
|
|
@@ -166,7 +166,7 @@ Alchemy.setProperty('default_use_path_options', {
|
|
|
166
166
|
*
|
|
167
167
|
* @author Jelle De Loecker <jelle@develry.be>
|
|
168
168
|
* @since 0.0.1
|
|
169
|
-
* @version 1.0
|
|
169
|
+
* @version 1.2.0
|
|
170
170
|
*
|
|
171
171
|
* @param {String} dir_path
|
|
172
172
|
* @param {Object} options
|
|
@@ -255,7 +255,8 @@ Alchemy.setMethod(function _usePath(dir_path, options) {
|
|
|
255
255
|
parent_path : dir_path,
|
|
256
256
|
name : file_name,
|
|
257
257
|
path : file_path,
|
|
258
|
-
stat : file_stat
|
|
258
|
+
stat : file_stat,
|
|
259
|
+
local_path : file_path.slice(PATH_APP.length),
|
|
259
260
|
});
|
|
260
261
|
|
|
261
262
|
continue;
|
|
@@ -273,6 +274,11 @@ Alchemy.setMethod(function _usePath(dir_path, options) {
|
|
|
273
274
|
for (i = 0; i < directories.length; i++) {
|
|
274
275
|
entry = directories[i];
|
|
275
276
|
|
|
277
|
+
// Don't load migrations
|
|
278
|
+
if (entry.local_path == '/migrations') {
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
|
|
276
282
|
// Do not include subfolders of the "config" directory
|
|
277
283
|
// if it's a modular load
|
|
278
284
|
if (options.modularParent && /\/config$/.exec(entry.parent_path)) {
|
package/lib/init/requirements.js
CHANGED
|
@@ -1,97 +1,102 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The basic http module, used to create the server.
|
|
5
|
-
*
|
|
6
|
-
* @link http://nodejs.org/api/http.html
|
|
7
|
-
*/
|
|
8
|
-
alchemy.use('http', 'http');
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* This module contains utilities for handling and transforming file paths.
|
|
12
|
-
* Almost all these methods perform only string transformations.
|
|
13
|
-
* The file system is not consulted to check whether paths are valid.
|
|
14
|
-
*
|
|
15
|
-
* @link http://nodejs.org/api/path.html
|
|
16
|
-
*/
|
|
17
|
-
alchemy.use('path', 'path');
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* File I/O is provided by simple wrappers around standard POSIX functions.
|
|
21
|
-
*
|
|
22
|
-
* @link http://nodejs.org/api/fs.html
|
|
23
|
-
*/
|
|
24
|
-
alchemy.use('graceful-fs', 'fs');
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Usefull utilities.
|
|
28
|
-
*
|
|
29
|
-
* @link http://nodejs.org/api/util.html
|
|
30
|
-
*/
|
|
31
|
-
alchemy.use('util', 'util');
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* The native mongodb library
|
|
35
|
-
*
|
|
36
|
-
* @link https://npmjs.org/package/mongodb
|
|
37
|
-
*/
|
|
38
|
-
alchemy.use('mongodb', 'mongodb');
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* The LESS interpreter.
|
|
42
|
-
*
|
|
43
|
-
* @link https://npmjs.org/package/less
|
|
44
|
-
*/
|
|
45
|
-
alchemy.use('less', 'less');
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Hawkejs view engine
|
|
49
|
-
*
|
|
50
|
-
* @link https://npmjs.org/package/hawkejs
|
|
51
|
-
*/
|
|
52
|
-
alchemy.use('hawkejs', 'hawkejs');
|
|
53
|
-
alchemy.hawkejs = new Classes.Hawkejs.Hawkejs;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* The function to detect when everything is too busy
|
|
57
|
-
*/
|
|
58
|
-
alchemy.toobusy = alchemy.use('toobusy-js', 'toobusy');
|
|
59
|
-
|
|
60
|
-
// If the config is a number, use that as the lag threshold
|
|
61
|
-
if (typeof alchemy.settings.toobusy === 'number') {
|
|
62
|
-
alchemy.toobusy.maxLag(alchemy.settings.toobusy);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Load Sputnik, the stage-based launcher
|
|
67
|
-
*/
|
|
68
|
-
alchemy.sputnik = new (alchemy.use('sputnik', 'sputnik'))();
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Real-time apps made cross-browser & easy with a WebSocket-like API.
|
|
72
|
-
*
|
|
73
|
-
* @link https://npmjs.org/package/socket.io
|
|
74
|
-
*/
|
|
75
|
-
alchemy.use('socket.io', 'io');
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
*
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
*
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
*
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The basic http module, used to create the server.
|
|
5
|
+
*
|
|
6
|
+
* @link http://nodejs.org/api/http.html
|
|
7
|
+
*/
|
|
8
|
+
alchemy.use('http', 'http');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* This module contains utilities for handling and transforming file paths.
|
|
12
|
+
* Almost all these methods perform only string transformations.
|
|
13
|
+
* The file system is not consulted to check whether paths are valid.
|
|
14
|
+
*
|
|
15
|
+
* @link http://nodejs.org/api/path.html
|
|
16
|
+
*/
|
|
17
|
+
alchemy.use('path', 'path');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* File I/O is provided by simple wrappers around standard POSIX functions.
|
|
21
|
+
*
|
|
22
|
+
* @link http://nodejs.org/api/fs.html
|
|
23
|
+
*/
|
|
24
|
+
alchemy.use('graceful-fs', 'fs');
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Usefull utilities.
|
|
28
|
+
*
|
|
29
|
+
* @link http://nodejs.org/api/util.html
|
|
30
|
+
*/
|
|
31
|
+
alchemy.use('util', 'util');
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The native mongodb library
|
|
35
|
+
*
|
|
36
|
+
* @link https://npmjs.org/package/mongodb
|
|
37
|
+
*/
|
|
38
|
+
alchemy.use('mongodb', 'mongodb');
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The LESS interpreter.
|
|
42
|
+
*
|
|
43
|
+
* @link https://npmjs.org/package/less
|
|
44
|
+
*/
|
|
45
|
+
alchemy.use('less', 'less');
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Hawkejs view engine
|
|
49
|
+
*
|
|
50
|
+
* @link https://npmjs.org/package/hawkejs
|
|
51
|
+
*/
|
|
52
|
+
alchemy.use('hawkejs', 'hawkejs');
|
|
53
|
+
alchemy.hawkejs = new Classes.Hawkejs.Hawkejs;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The function to detect when everything is too busy
|
|
57
|
+
*/
|
|
58
|
+
alchemy.toobusy = alchemy.use('toobusy-js', 'toobusy');
|
|
59
|
+
|
|
60
|
+
// If the config is a number, use that as the lag threshold
|
|
61
|
+
if (typeof alchemy.settings.toobusy === 'number') {
|
|
62
|
+
alchemy.toobusy.maxLag(alchemy.settings.toobusy);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Load Sputnik, the stage-based launcher
|
|
67
|
+
*/
|
|
68
|
+
alchemy.sputnik = new (alchemy.use('sputnik', 'sputnik'))();
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Real-time apps made cross-browser & easy with a WebSocket-like API.
|
|
72
|
+
*
|
|
73
|
+
* @link https://npmjs.org/package/socket.io
|
|
74
|
+
*/
|
|
75
|
+
alchemy.use('socket.io', 'io');
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Allow streams over a socket.io connection
|
|
79
|
+
*/
|
|
80
|
+
alchemy.use('@11ways/socket.io-stream', 'socket.io-stream');
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Recursively mkdir, like `mkdir -p`.
|
|
84
|
+
* This is a requirement fetched from express
|
|
85
|
+
*
|
|
86
|
+
* @link https://npmjs.org/package/mkdirp
|
|
87
|
+
*/
|
|
88
|
+
alchemy.use('mkdirp', 'mkdirp');
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Base useragent library
|
|
92
|
+
*
|
|
93
|
+
* @link https://npmjs.org/package/useragent
|
|
94
|
+
*/
|
|
95
|
+
alchemy.use('useragent');
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Enable the `satisfies` method in the `useragent` library
|
|
99
|
+
*
|
|
100
|
+
* @link https://www.npmjs.com/package/useragent#adding-more-features-to-the-useragent
|
|
101
|
+
*/
|
|
97
102
|
require('useragent/features');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alchemymvc",
|
|
3
3
|
"description": "MVC framework for Node.js",
|
|
4
|
-
"version": "1.1
|
|
4
|
+
"version": "1.2.1",
|
|
5
5
|
"author": "Jelle De Loecker <jelle@elevenways.be>",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"alchemy",
|
|
@@ -14,29 +14,29 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"ansi-256-colors" : "~1.1.0",
|
|
17
|
-
"autoprefixer" : "~10.2
|
|
17
|
+
"autoprefixer" : "~10.4.2",
|
|
18
18
|
"bcrypt" : "~5.0.1",
|
|
19
19
|
"body" : "~5.1.0",
|
|
20
|
-
"body-parser" : "~1.19.
|
|
21
|
-
"bson" : "~4.
|
|
22
|
-
"chokidar" : "~3.5.
|
|
20
|
+
"body-parser" : "~1.19.2",
|
|
21
|
+
"bson" : "~4.6.1",
|
|
22
|
+
"chokidar" : "~3.5.3",
|
|
23
23
|
"formidable" : "~1.2.2",
|
|
24
|
-
"graceful-fs" : "~4.2.
|
|
25
|
-
"hawkejs" : "~2.
|
|
24
|
+
"graceful-fs" : "~4.2.9",
|
|
25
|
+
"hawkejs" : "~2.2.3",
|
|
26
26
|
"jsondiffpatch" : "~0.4.1",
|
|
27
|
-
"mime" : "~
|
|
27
|
+
"mime" : "~3.0.0",
|
|
28
28
|
"minimist" : "~1.2.5",
|
|
29
29
|
"mkdirp" : "~1.0.4",
|
|
30
30
|
"mmmagic" : "~0.5.3",
|
|
31
31
|
"mongodb" : "~3.6.6",
|
|
32
32
|
"ncp" : "~2.0.0",
|
|
33
|
-
"postcss" : "~8.
|
|
34
|
-
"protoblast" : "~0.7.
|
|
33
|
+
"postcss" : "~8.4.6",
|
|
34
|
+
"protoblast" : "~0.7.16",
|
|
35
35
|
"semver" : "~7.3.5",
|
|
36
|
-
"socket.io" : "~
|
|
36
|
+
"socket.io" : "~2.4.0",
|
|
37
37
|
"@11ways/socket.io-stream" : "~0.9.2",
|
|
38
38
|
"sputnik" : "~0.1.0",
|
|
39
|
-
"terser" : "~5.
|
|
39
|
+
"terser" : "~5.10.0",
|
|
40
40
|
"toobusy-js" : "~0.5.1",
|
|
41
41
|
"useragent" : "~2.3.0"
|
|
42
42
|
},
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"optionalDependencies": {
|
|
48
48
|
"janeway" : "~0.3.5",
|
|
49
49
|
"less" : "~4.1.1",
|
|
50
|
-
"sass" : "~1.
|
|
50
|
+
"sass" : "~1.49.8",
|
|
51
51
|
"nodent-compiler" : "~3.2.13",
|
|
52
52
|
"socket.io-client" : "~2.4.0"
|
|
53
53
|
},
|