alchemymvc 1.3.21 → 1.4.0-alpha.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/LICENSE +1 -1
- package/README.md +3 -3
- package/lib/app/behaviour/publishable_behaviour.js +5 -5
- package/lib/app/behaviour/revision_behaviour.js +10 -10
- package/lib/app/behaviour/sluggable_behaviour.js +14 -14
- package/lib/app/conduit/electron_conduit.js +9 -9
- package/lib/app/conduit/http_conduit.js +13 -13
- package/lib/app/conduit/loopback_conduit.js +15 -15
- package/lib/app/conduit/socket_conduit.js +43 -43
- package/lib/app/config/routes.js +26 -0
- package/lib/app/controller/00-default_app_controller.js +21 -0
- package/lib/app/controller/alchemy_info_controller.js +12 -12
- package/lib/app/datasource/mongo_datasource.js +16 -16
- package/lib/app/element/00-default_app_element.js +19 -0
- package/lib/app/element/time_ago.js +5 -5
- package/lib/app/helper/00-default_app_helper.js +11 -0
- package/lib/app/helper/alchemy_helper.js +22 -22
- package/lib/app/helper/backed_map.js +1 -1
- package/lib/app/helper/breadcrumb.js +10 -10
- package/lib/app/helper/client_collection.js +3 -3
- package/lib/app/helper/cron.js +29 -29
- package/lib/app/helper/enum_values.js +6 -6
- package/lib/app/helper/pagination_helper.js +36 -36
- package/lib/app/helper/router_helper.js +35 -35
- package/lib/app/helper/socket_helper.js +57 -57
- package/lib/app/helper/syncable.js +84 -59
- package/lib/app/helper_component/paginate_component.js +9 -9
- package/lib/app/helper_controller/component.js +1 -1
- package/lib/app/helper_controller/conduit.js +31 -31
- package/lib/app/helper_controller/controller.js +54 -39
- package/lib/app/helper_datasource/00-nosql_datasource.js +624 -70
- package/lib/app/helper_datasource/05-fallback_datasource.js +10 -10
- package/lib/app/helper_datasource/idb_datasource.js +6 -6
- package/lib/app/helper_datasource/indexed_db.js +22 -22
- package/lib/app/helper_datasource/remote_datasource.js +5 -5
- package/lib/app/helper_error/http_error.js +4 -4
- package/lib/app/helper_error/model_error.js +2 -2
- package/lib/app/helper_error/validation_error.js +12 -12
- package/lib/app/helper_field/00-objectid_field.js +7 -7
- package/lib/app/helper_field/05-string_field.js +16 -12
- package/lib/app/helper_field/06-text_field.js +2 -4
- package/lib/app/helper_field/10-number_field.js +9 -12
- package/lib/app/helper_field/11-date_field.js +15 -15
- package/lib/app/helper_field/15-local_temporal_field.js +10 -10
- package/lib/app/helper_field/20-decimal_field.js +8 -9
- package/lib/app/helper_field/belongsto_field.js +1 -1
- package/lib/app/helper_field/big_int_field.js +8 -8
- package/lib/app/helper_field/boolean_field.js +9 -11
- package/lib/app/helper_field/datetime_field.js +3 -3
- package/lib/app/helper_field/enum_field.js +13 -8
- package/lib/app/helper_field/fixed_decimal_field.js +6 -7
- package/lib/app/helper_field/geopoint_field.js +9 -10
- package/lib/app/helper_field/habtm_field.js +3 -3
- package/lib/app/helper_field/hasoneparent_field.js +1 -1
- package/lib/app/helper_field/html_field.js +2 -4
- package/lib/app/helper_field/integer_field.js +8 -11
- package/lib/app/helper_field/local_date_field.js +5 -5
- package/lib/app/helper_field/local_date_time_field.js +5 -5
- package/lib/app/helper_field/local_time_field.js +5 -5
- package/lib/app/helper_field/mixed_field.js +5 -5
- package/lib/app/helper_field/object_field.js +8 -8
- package/lib/app/helper_field/password_field.js +3 -3
- package/lib/app/helper_field/regexp_field.js +7 -9
- package/lib/app/helper_field/schema_field.js +91 -88
- package/lib/app/helper_field/settings_field.js +92 -0
- package/lib/app/helper_field/time_field.js +6 -6
- package/lib/app/helper_field/url_field.js +2 -4
- package/lib/app/helper_model/00-base_criteria.js +662 -0
- package/lib/app/helper_model/05-criteria_expressions.js +605 -0
- package/lib/app/helper_model/10-model_criteria.js +1182 -0
- package/lib/app/helper_model/data_provider.js +2 -2
- package/lib/app/helper_model/document.js +103 -92
- package/lib/app/helper_model/document_list.js +14 -14
- package/lib/app/helper_model/field_config.js +11 -11
- package/lib/app/helper_model/field_set.js +17 -17
- package/lib/app/helper_model/model.js +203 -124
- package/lib/app/helper_model/remote_data_provider.js +2 -2
- package/lib/app/helper_validator/00_validator.js +16 -16
- package/lib/app/helper_validator/not_empty_validator.js +9 -9
- package/lib/app/model/00-default_app_model.js +18 -0
- package/lib/app/model/05-system_model.js +27 -0
- package/lib/app/model/{alchemy_migration_model.js → system_migration_model.js} +4 -4
- package/lib/app/model/system_setting_model.js +154 -0
- package/lib/app/model/{alchemy_task_history_model.js → system_task_history_model.js} +7 -7
- package/lib/app/model/{alchemy_task_model.js → system_task_model.js} +11 -11
- package/lib/bootstrap.js +22 -312
- package/lib/class/accumulator.js +5 -5
- package/lib/class/behaviour.js +5 -5
- package/lib/class/component.js +3 -3
- package/lib/class/conduit.js +203 -163
- package/lib/class/controller.js +42 -42
- package/lib/class/datasource.js +74 -79
- package/lib/class/document.js +74 -95
- package/lib/class/document_list.js +5 -5
- package/lib/class/element.js +17 -17
- package/lib/class/error.js +3 -3
- package/lib/class/field.js +169 -91
- package/lib/class/field_value.js +6 -6
- package/lib/class/helper.js +3 -3
- package/lib/class/inode.js +17 -17
- package/lib/class/inode_dir.js +12 -12
- package/lib/class/inode_file.js +50 -25
- package/lib/class/inode_list.js +4 -4
- package/lib/class/migration.js +4 -4
- package/lib/class/model.js +182 -168
- package/lib/class/path_definition.js +22 -22
- package/lib/class/path_evaluator.js +5 -5
- package/lib/class/path_param_definition.js +7 -7
- package/lib/class/plugin.js +312 -0
- package/lib/class/postponement.js +29 -29
- package/lib/class/reciprocal.js +8 -8
- package/lib/class/route.js +33 -33
- package/lib/class/router.js +73 -73
- package/lib/class/schema.js +21 -21
- package/lib/class/schema_client.js +73 -67
- package/lib/class/session.js +63 -29
- package/lib/class/session_scene.js +4 -4
- package/lib/class/sitemap.js +16 -16
- package/lib/class/task.js +39 -39
- package/lib/class/task_service.js +43 -47
- package/lib/{init → core}/alchemy.js +413 -374
- package/lib/{init/functions.js → core/alchemy_functions.js} +171 -108
- package/lib/core/alchemy_load_functions.js +715 -0
- package/lib/core/base.js +50 -62
- package/lib/core/client_alchemy.js +144 -152
- package/lib/core/client_base.js +39 -52
- package/lib/core/discovery.js +16 -18
- package/lib/core/middleware.js +54 -43
- package/lib/core/{routing.js → prefix.js} +14 -16
- package/lib/core/setting.js +1684 -0
- package/lib/core/stage.js +758 -0
- package/lib/scripts/create_constants.js +119 -0
- package/lib/{init/languages.js → scripts/create_languages.js} +5 -5
- package/lib/scripts/create_settings.js +449 -0
- package/lib/scripts/create_shared_constants.js +95 -0
- package/lib/scripts/create_stages.js +55 -0
- package/lib/scripts/init_alchemy.js +51 -0
- package/lib/{init/requirements.js → scripts/preload_modules.js} +15 -2
- package/lib/scripts/setup_devwatch.js +238 -0
- package/lib/stages/00-load_core.js +342 -0
- package/lib/stages/05-load_app.js +57 -0
- package/lib/stages/10-datasource.js +61 -0
- package/lib/stages/15-tasks.js +27 -0
- package/lib/stages/20-settings.js +68 -0
- package/lib/stages/50-routes.js +218 -0
- package/lib/stages/90-server.js +347 -0
- package/package.json +5 -7
- package/lib/app/helper_model/criteria.js +0 -2294
- package/lib/app/helper_model/db_query.js +0 -1488
- package/lib/app/routes.js +0 -11
- package/lib/core/socket.js +0 -171
- package/lib/init/constants.js +0 -158
- package/lib/init/devwatch.js +0 -238
- package/lib/init/load_functions.js +0 -973
- package/lib/stages.js +0 -513
package/lib/bootstrap.js
CHANGED
|
@@ -1,341 +1,51 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
|
-
var libpath = require('path'),
|
|
4
|
-
starting;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Calling dynamic `import()` from certain places in the codebase actually
|
|
8
|
-
* causes segfaults. This is a workaround for that.
|
|
9
|
-
*
|
|
10
|
-
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
11
|
-
* @since 1.2.2
|
|
12
|
-
* @version 1.2.2
|
|
13
|
-
*
|
|
14
|
-
* @param {String} path
|
|
15
|
-
*
|
|
16
|
-
* @return {Promise}
|
|
17
|
-
*/
|
|
18
|
-
global.doImport = function doImport(path) {
|
|
19
|
-
return import(path);
|
|
20
|
-
};
|
|
2
|
+
const libpath = require('path');
|
|
21
3
|
|
|
22
4
|
/**
|
|
23
|
-
*
|
|
5
|
+
* Load Protoblast in the prototype-modifying mode.
|
|
6
|
+
* This is the backbone of Alchemy.
|
|
24
7
|
*/
|
|
25
|
-
require('protoblast')();
|
|
8
|
+
const Protoblast = require('protoblast')(true);
|
|
26
9
|
|
|
27
10
|
/**
|
|
28
|
-
* Define
|
|
11
|
+
* Define shared global constants and require methods
|
|
29
12
|
*/
|
|
30
|
-
require('
|
|
13
|
+
Protoblast.require(libpath.resolve(__dirname, 'scripts', 'create_shared_constants'));
|
|
31
14
|
|
|
32
15
|
/**
|
|
33
|
-
* Define
|
|
16
|
+
* Define global constants and require methods
|
|
34
17
|
*/
|
|
35
|
-
require('
|
|
18
|
+
Protoblast.require(libpath.resolve(__dirname, 'scripts', 'create_constants'), {client: false});
|
|
36
19
|
|
|
37
20
|
/**
|
|
38
|
-
*
|
|
21
|
+
* Alchemy's Base class (from which all other classes inherit)
|
|
39
22
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Require basic functions
|
|
44
|
-
*/
|
|
45
|
-
require('./init/functions');
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Require load functions
|
|
49
|
-
*/
|
|
50
|
-
require('./init/load_functions');
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Pre-load basic requirements
|
|
54
|
-
*/
|
|
55
|
-
require('./init/requirements');
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Set up file change watchers for development
|
|
59
|
-
*/
|
|
60
|
-
require('./init/devwatch');
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Alchemy's Base class
|
|
64
|
-
*
|
|
65
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
66
|
-
* @since 0.3.0
|
|
67
|
-
* @version 0.3.0
|
|
68
|
-
*/
|
|
69
|
-
require('./core/base');
|
|
23
|
+
requireCorePath('core', 'base');
|
|
70
24
|
|
|
71
25
|
/**
|
|
72
26
|
* Alchemy's Client Base class
|
|
73
|
-
*
|
|
74
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
75
|
-
* @since 1.0.0
|
|
76
|
-
* @version 1.0.0
|
|
77
|
-
*/
|
|
78
|
-
require('./core/client_base');
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* The migration class
|
|
82
|
-
*
|
|
83
|
-
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
84
|
-
* @since 1.2.0
|
|
85
|
-
* @version 1.2.0
|
|
86
|
-
*/
|
|
87
|
-
require('./class/migration');
|
|
88
|
-
|
|
89
|
-
var hawkejs_options = {
|
|
90
|
-
server : false,
|
|
91
|
-
make_commonjs: true,
|
|
92
|
-
|
|
93
|
-
// The arguments to add to the wrapper function
|
|
94
|
-
arguments : 'hawkejs'
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Require the base class on the client side too
|
|
99
|
-
*
|
|
100
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
101
|
-
* @since 0.3.0
|
|
102
|
-
* @version 1.1.0
|
|
103
27
|
*/
|
|
104
|
-
|
|
28
|
+
requireCorePath('core', 'client_base');
|
|
105
29
|
|
|
106
30
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
110
|
-
* @since 1.0.0
|
|
111
|
-
* @version 1.1.0
|
|
31
|
+
* Load the stages classes
|
|
112
32
|
*/
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
hawkejs_options.server = true;
|
|
33
|
+
requireCorePath('core', 'stage.js');
|
|
116
34
|
|
|
117
35
|
/**
|
|
118
|
-
*
|
|
36
|
+
* Define the Stages instance
|
|
119
37
|
*
|
|
120
|
-
* @author Jelle De Loecker
|
|
121
|
-
* @since 1.
|
|
122
|
-
* @version 1.
|
|
123
|
-
*/
|
|
124
|
-
alchemy.hawkejs.load(libpath.resolve(PATH_CORE, 'class', 'error.js'), hawkejs_options);
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Require the client_alchemy class on the client side
|
|
38
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
39
|
+
* @since 1.4.0
|
|
40
|
+
* @version 1.4.0
|
|
128
41
|
*
|
|
129
|
-
* @
|
|
130
|
-
* @since 1.0.5
|
|
131
|
-
* @version 1.1.0
|
|
42
|
+
* @type {Alchemy.Stages.Stage}
|
|
132
43
|
*/
|
|
133
|
-
|
|
44
|
+
DEFINE('STAGES', new Classes.Alchemy.Stages.Stage('root'));
|
|
134
45
|
|
|
135
46
|
/**
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
139
|
-
* @since 1.1.0
|
|
140
|
-
* @version 1.1.0
|
|
141
|
-
*/
|
|
142
|
-
alchemy.hawkejs.load(libpath.resolve(PATH_CORE, 'class', 'path_evaluator.js'), hawkejs_options);
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Require the field_value class
|
|
146
|
-
*
|
|
147
|
-
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
148
|
-
* @since 1.1.0
|
|
149
|
-
* @version 1.1.0
|
|
47
|
+
* Start the stages script
|
|
150
48
|
*/
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
hawkejs_options.server = false;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Require the path_definition class on the client side too
|
|
157
|
-
*
|
|
158
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
159
|
-
* @since 1.0.0
|
|
160
|
-
* @version 1.1.0
|
|
161
|
-
*/
|
|
162
|
-
alchemy.hawkejs.load(libpath.resolve(PATH_CORE, 'class', 'path_definition.js'), hawkejs_options);
|
|
163
|
-
alchemy.hawkejs.load(libpath.resolve(PATH_CORE, 'class', 'path_param_definition.js'), hawkejs_options);
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Require the element class on the client side too
|
|
167
|
-
*
|
|
168
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
169
|
-
* @since 1.0.0
|
|
170
|
-
* @version 1.1.0
|
|
171
|
-
*/
|
|
172
|
-
alchemy.hawkejs.load(libpath.resolve(PATH_CORE, 'class', 'element.js'), hawkejs_options);
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Require the helper class on the client side too
|
|
176
|
-
*
|
|
177
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
178
|
-
* @since 1.0.0
|
|
179
|
-
* @version 1.1.0
|
|
180
|
-
*/
|
|
181
|
-
alchemy.hawkejs.load(libpath.resolve(PATH_CORE, 'class', 'helper.js'), hawkejs_options);
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Require the datasource class on the client side too
|
|
185
|
-
*
|
|
186
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
187
|
-
* @since 1.1.0
|
|
188
|
-
* @version 1.1.0
|
|
189
|
-
*/
|
|
190
|
-
alchemy.hawkejs.load(libpath.resolve(PATH_CORE, 'class', 'datasource.js'), hawkejs_options);
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Require the field class on the client side too
|
|
194
|
-
*
|
|
195
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
196
|
-
* @since 1.1.0
|
|
197
|
-
* @version 1.1.0
|
|
198
|
-
*/
|
|
199
|
-
alchemy.hawkejs.load(libpath.resolve(PATH_CORE, 'class', 'field.js'), hawkejs_options);
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Require the schema_client class on the client side too
|
|
203
|
-
*
|
|
204
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
205
|
-
* @since 1.1.0
|
|
206
|
-
* @version 1.1.0
|
|
207
|
-
*/
|
|
208
|
-
alchemy.hawkejs.load(libpath.resolve(PATH_CORE, 'class', 'schema_client.js'), hawkejs_options);
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Set up routing functions
|
|
212
|
-
*/
|
|
213
|
-
alchemy.useOnce(libpath.resolve(PATH_CORE, 'core', 'routing.js'));
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Set up middleware functions
|
|
217
|
-
*/
|
|
218
|
-
alchemy.useOnce(libpath.resolve(PATH_CORE, 'core', 'middleware.js'));
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Load socket.io code
|
|
222
|
-
*/
|
|
223
|
-
alchemy.useOnce(libpath.resolve(PATH_CORE, 'core', 'socket.js'));
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Load discovery code
|
|
227
|
-
*/
|
|
228
|
-
alchemy.useOnce(libpath.resolve(PATH_CORE, 'core', 'discovery.js'));
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Load inode classes
|
|
232
|
-
*/
|
|
233
|
-
alchemy.useOnce(libpath.resolve(PATH_CORE, 'class', 'inode.js'));
|
|
234
|
-
alchemy.useOnce(libpath.resolve(PATH_CORE, 'class', 'inode_file.js'));
|
|
235
|
-
alchemy.useOnce(libpath.resolve(PATH_CORE, 'class', 'inode_dir.js'));
|
|
236
|
-
alchemy.useOnce(libpath.resolve(PATH_CORE, 'class', 'inode_list.js'));
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Load in all classes
|
|
240
|
-
*/
|
|
241
|
-
alchemy.usePath(libpath.resolve(__dirname, 'class'), {modular: false});
|
|
242
|
-
|
|
243
|
-
// Load the base bootstrap file
|
|
244
|
-
try {
|
|
245
|
-
alchemy.useOnce(libpath.resolve(PATH_ROOT, 'app', 'config', 'bootstrap.js'));
|
|
246
|
-
} catch (err) {
|
|
247
|
-
if (err.message.indexOf('Cannot find') === -1) {
|
|
248
|
-
alchemy.printLog(alchemy.WARNING, 'Could not load app bootstrap file');
|
|
249
|
-
throw err;
|
|
250
|
-
} else {
|
|
251
|
-
alchemy.printLog(alchemy.SEVERE, 'Could not load config bootstrap file', {err: err});
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Only start the server after this function has been called
|
|
257
|
-
*
|
|
258
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
259
|
-
* @since 0.0.1
|
|
260
|
-
* @version 1.1.5
|
|
261
|
-
*
|
|
262
|
-
* @param {Function} callback The optional callback after alchemy is ready
|
|
263
|
-
*
|
|
264
|
-
* @return {Pledge}
|
|
265
|
-
*/
|
|
266
|
-
Alchemy.setMethod(function start(options, callback) {
|
|
267
|
-
|
|
268
|
-
if (typeof options == 'function') {
|
|
269
|
-
callback = options;
|
|
270
|
-
options = {};
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
if (!options) {
|
|
274
|
-
options = {};
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
// If silent is true, don't output anything
|
|
278
|
-
if (options.silent == true) {
|
|
279
|
-
this.settings.silent = true;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
if (starting) {
|
|
283
|
-
return this.ready(callback);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
if (Object.size(Blast.loaded_versions) > 1) {
|
|
287
|
-
log.warn(Object.size(Blast.loaded_versions), 'versions of Protoblast have been loaded, this can cause problems!');
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
if (options.client_mode) {
|
|
291
|
-
this.settings.client_mode = true;
|
|
292
|
-
} else {
|
|
293
|
-
if (this.settings.no_default_file) {
|
|
294
|
-
log.warn('Could not find default settings file at "' + this.settings.no_default_file + '.js"');
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
if (this.settings.no_local_file) {
|
|
298
|
-
log.warn('Could not find local settings file');
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
if (this.settings.no_env_file) {
|
|
302
|
-
log.warn('Could not find environment settings file at "' + this.settings.no_env_file + '.js"');
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
// Indicate the server is starting
|
|
307
|
-
starting = true;
|
|
308
|
-
|
|
309
|
-
// Start the stages
|
|
310
|
-
alchemy.useOnce(libpath.resolve(PATH_CORE, 'stages.js'));
|
|
311
|
-
|
|
312
|
-
// Make sure Blast has executed everything that's still waiting
|
|
313
|
-
Blast.doLoaded();
|
|
314
|
-
|
|
315
|
-
// Call the `afterStart` method
|
|
316
|
-
this.ready(() => this.afterStart());
|
|
317
|
-
|
|
318
|
-
// Schedule the callback
|
|
319
|
-
return this.ready(callback);
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Stop the server
|
|
324
|
-
*
|
|
325
|
-
* @author Jelle De Loecker <jelle@develry.be>
|
|
326
|
-
* @since 1.0.3
|
|
327
|
-
* @version 1.0.3
|
|
328
|
-
*
|
|
329
|
-
* @param {Function} callback The optional callback after alchemy has stopped
|
|
330
|
-
*/
|
|
331
|
-
Alchemy.setMethod(function stop(callback) {
|
|
332
|
-
|
|
333
|
-
this.server.close(function closed() {
|
|
334
|
-
|
|
335
|
-
if (callback) {
|
|
336
|
-
callback();
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
});
|
|
49
|
+
requireCorePath('scripts', 'create_stages.js');
|
|
340
50
|
|
|
341
|
-
|
|
51
|
+
module.exports = STAGES;
|
package/lib/class/accumulator.js
CHANGED
|
@@ -6,7 +6,7 @@ var path = alchemy.use('path'),
|
|
|
6
6
|
* when you expect data to come in, but you don't know how many,
|
|
7
7
|
* this class will accumulate it and fire the callback after a timeout.
|
|
8
8
|
*
|
|
9
|
-
* @author Jelle De Loecker
|
|
9
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
10
10
|
* @since 0.1.0
|
|
11
11
|
* @version 0.2.0
|
|
12
12
|
*/
|
|
@@ -28,11 +28,11 @@ var Accumulator = Function.inherits('Alchemy.Base', function Accumulator(callbac
|
|
|
28
28
|
/**
|
|
29
29
|
* Fire the callback after these given amount of seconds
|
|
30
30
|
*
|
|
31
|
-
* @author Jelle De Loecker
|
|
31
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
32
32
|
* @since 0.1.0
|
|
33
33
|
* @version 0.1.0
|
|
34
34
|
*
|
|
35
|
-
* @param {
|
|
35
|
+
* @param {number} seconds
|
|
36
36
|
*/
|
|
37
37
|
Accumulator.setMethod(function setTimeout(seconds) {
|
|
38
38
|
|
|
@@ -50,7 +50,7 @@ Accumulator.setMethod(function setTimeout(seconds) {
|
|
|
50
50
|
/**
|
|
51
51
|
* Fire the callback now
|
|
52
52
|
*
|
|
53
|
-
* @author Jelle De Loecker
|
|
53
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
54
54
|
* @since 0.1.0
|
|
55
55
|
* @version 0.2.0
|
|
56
56
|
*/
|
|
@@ -78,7 +78,7 @@ Accumulator.setMethod(function finish() {
|
|
|
78
78
|
/**
|
|
79
79
|
* Add data
|
|
80
80
|
*
|
|
81
|
-
* @author Jelle De Loecker
|
|
81
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
82
82
|
* @since 0.1.0
|
|
83
83
|
* @version 0.1.0
|
|
84
84
|
*/
|
package/lib/class/behaviour.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @constructor
|
|
5
5
|
*
|
|
6
|
-
* @author Jelle De Loecker
|
|
6
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
7
7
|
* @since 0.0.1
|
|
8
8
|
* @version 1.0.3
|
|
9
9
|
*
|
|
@@ -46,11 +46,11 @@ global.Behaviour = Function.inherits('Alchemy.Base', function Behaviour(model, o
|
|
|
46
46
|
/**
|
|
47
47
|
* Return a behaviour class
|
|
48
48
|
*
|
|
49
|
-
* @author Jelle De Loecker
|
|
49
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
50
50
|
* @since 0.2.0
|
|
51
51
|
* @version 0.2.0
|
|
52
52
|
*
|
|
53
|
-
* @param {
|
|
53
|
+
* @param {string} behaviour_name The singular name of the behaviour
|
|
54
54
|
*
|
|
55
55
|
* @return {Function}
|
|
56
56
|
*/
|
|
@@ -66,11 +66,11 @@ Behaviour.getClass = function getClass(behaviour_name, model, options) {
|
|
|
66
66
|
/**
|
|
67
67
|
* Return a behaviour instance
|
|
68
68
|
*
|
|
69
|
-
* @author Jelle De Loecker
|
|
69
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
70
70
|
* @since 0.0.1
|
|
71
71
|
* @version 0.2.0
|
|
72
72
|
*
|
|
73
|
-
* @param {
|
|
73
|
+
* @param {string} behaviour_name The singular name of the behaviour
|
|
74
74
|
* @param {Model} model Model instance
|
|
75
75
|
* @param {Object} options Behaviour options
|
|
76
76
|
*
|
package/lib/class/component.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @constructor
|
|
5
5
|
*
|
|
6
|
-
* @author Jelle De Loecker
|
|
6
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
7
7
|
* @since 0.0.1
|
|
8
8
|
* @version 1.0.0
|
|
9
9
|
*
|
|
@@ -42,11 +42,11 @@ global.Component = Function.inherits('Alchemy.Base', 'Alchemy.Component', functi
|
|
|
42
42
|
/**
|
|
43
43
|
* Return a component instance
|
|
44
44
|
*
|
|
45
|
-
* @author Jelle De Loecker
|
|
45
|
+
* @author Jelle De Loecker <jelle@elevenways.be>
|
|
46
46
|
* @since 0.0.1
|
|
47
47
|
* @version 1.0.0
|
|
48
48
|
*
|
|
49
|
-
* @param {
|
|
49
|
+
* @param {string} name The name of the component
|
|
50
50
|
* @param {Controller} controller Controller instance
|
|
51
51
|
* @param {Object} options Component options
|
|
52
52
|
*
|