1 | module.exports =
|
2 | (function(modules) {
|
3 |
|
4 | var installedModules = {};
|
5 |
|
6 |
|
7 | function __webpack_require__(moduleId) {
|
8 |
|
9 |
|
10 | if(installedModules[moduleId]) {
|
11 | return installedModules[moduleId].exports;
|
12 | }
|
13 |
|
14 | var module = installedModules[moduleId] = {
|
15 | i: moduleId,
|
16 | l: false,
|
17 | exports: {}
|
18 | };
|
19 |
|
20 |
|
21 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
22 |
|
23 |
|
24 | module.l = true;
|
25 |
|
26 |
|
27 | return module.exports;
|
28 | }
|
29 |
|
30 |
|
31 |
|
32 | __webpack_require__.m = modules;
|
33 |
|
34 |
|
35 | __webpack_require__.c = installedModules;
|
36 |
|
37 |
|
38 | __webpack_require__.d = function(exports, name, getter) {
|
39 | if(!__webpack_require__.o(exports, name)) {
|
40 | Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
41 | }
|
42 | };
|
43 |
|
44 |
|
45 | __webpack_require__.r = function(exports) {
|
46 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
47 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
48 | }
|
49 | Object.defineProperty(exports, '__esModule', { value: true });
|
50 | };
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 | __webpack_require__.t = function(value, mode) {
|
58 | if(mode & 1) value = __webpack_require__(value);
|
59 | if(mode & 8) return value;
|
60 | if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
61 | var ns = Object.create(null);
|
62 | __webpack_require__.r(ns);
|
63 | Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
64 | if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
65 | return ns;
|
66 | };
|
67 |
|
68 |
|
69 | __webpack_require__.n = function(module) {
|
70 | var getter = module && module.__esModule ?
|
71 | function getDefault() { return module['default']; } :
|
72 | function getModuleExports() { return module; };
|
73 | __webpack_require__.d(getter, 'a', getter);
|
74 | return getter;
|
75 | };
|
76 |
|
77 |
|
78 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
79 |
|
80 |
|
81 | __webpack_require__.p = "";
|
82 |
|
83 |
|
84 |
|
85 | return __webpack_require__(__webpack_require__.s = 0);
|
86 | })
|
87 |
|
88 | ([
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 | (function(module, exports, __webpack_require__) {
|
95 |
|
96 | module.exports = __webpack_require__( 1);
|
97 |
|
98 |
|
99 | }),
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 | (function(module, exports, __webpack_require__) {
|
106 |
|
107 |
|
108 |
|
109 |
|
110 | (module.exports = __webpack_require__( 2))
|
111 | .includeInNamespace(__webpack_require__( 5))
|
112 | .addModules({
|
113 | ConfigRegistry: __webpack_require__( 10),
|
114 | Configurable: __webpack_require__( 13),
|
115 | Configuration: __webpack_require__( 6),
|
116 | Lib: __webpack_require__( 12),
|
117 | Main: __webpack_require__( 11)
|
118 | });
|
119 |
|
120 | }),
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 | (function(module, exports, __webpack_require__) {
|
127 |
|
128 |
|
129 |
|
130 |
|
131 | module.exports = __webpack_require__( 3).addNamespace(
|
132 | 'Art.Config',
|
133 | (class Config extends Neptune.PackageNamespace {})
|
134 | ._configureNamespace(__webpack_require__( 4))
|
135 | );
|
136 |
|
137 |
|
138 | }),
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 | (function(module, exports) {
|
145 |
|
146 | module.exports = require('neptune-namespaces' );
|
147 |
|
148 | }),
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 | (function(module) {
|
155 |
|
156 | module.exports = JSON.parse("{\"author\":\"Shane Brinkman-Davis Delamore, Imikimi LLC\",\"bugs\":\"https:/github.com/art-suite/art-suite-foundations2/issues\",\"dependencies\":{\"art-build-configurator\":\"*\",\"art-events\":\"*\"},\"description\":\"A powerful yet simple tool for configuring all your libraries consistently.\",\"devDependencies\":{\"art-testbench\":\"*\",\"case-sensitive-paths-webpack-plugin\":\"^2.2.0\",\"chai\":\"^4.2.0\",\"coffee-loader\":\"^0.7.3\",\"css-loader\":\"^3.0.0\",\"json-loader\":\"^0.5.7\",\"mocha\":\"^7.0.0\",\"mock-fs\":\"^4.10.0\",\"script-loader\":\"^0.7.2\",\"style-loader\":\"^1.0.0\",\"webpack\":\"^4.39.1\",\"webpack-cli\":\"*\",\"webpack-dev-server\":\"^3.7.2\",\"webpack-merge\":\"^4.2.1\",\"webpack-node-externals\":\"^1.7.2\",\"webpack-stylish\":\"^0.1.8\"},\"homepage\":\"https://github.com/art-suite/art-suite-foundations2\",\"license\":\"ISC\",\"name\":\"art-config\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/art-suite/art-suite-foundations2.git\"},\"scripts\":{\"build\":\"webpack --progress\",\"start\":\"webpack-dev-server --hot --inline --progress --env.devServer\",\"test\":\"nn -s;mocha -u tdd\",\"testInBrowser\":\"webpack-dev-server --progress --env.devServer\"},\"version\":\"1.13.0\"}");
|
157 |
|
158 | }),
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 | (function(module, exports, __webpack_require__) {
|
165 |
|
166 | var defaultArtConfigName;
|
167 |
|
168 | module.exports = [
|
169 | {
|
170 | Config: __webpack_require__( 6),
|
171 | config: {
|
172 | yesArtConfig: true
|
173 | },
|
174 | configName: defaultArtConfigName = "Development",
|
175 | defaultArtConfigName: defaultArtConfigName
|
176 | }, __webpack_require__( 11)
|
177 | ];
|
178 |
|
179 |
|
180 | }),
|
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 | (function(module, exports, __webpack_require__) {
|
187 |
|
188 | (function(module) {var BaseObject, ConfigRegistry, Configuration, deepMerge, defineModule, log, merge, mergeInto, ref,
|
189 | extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
190 | hasProp = {}.hasOwnProperty;
|
191 |
|
192 | ref = __webpack_require__( 8), defineModule = ref.defineModule, log = ref.log, merge = ref.merge, mergeInto = ref.mergeInto, deepMerge = ref.deepMerge;
|
193 |
|
194 | BaseObject = __webpack_require__( 9).BaseObject;
|
195 |
|
196 | ConfigRegistry = __webpack_require__( 10);
|
197 |
|
198 | defineModule(module, Configuration = (function(superClass) {
|
199 | extend(Configuration, superClass);
|
200 |
|
201 | function Configuration() {
|
202 | return Configuration.__super__.constructor.apply(this, arguments);
|
203 | }
|
204 |
|
205 | Configuration.abstractClass();
|
206 |
|
207 | Configuration.register = function() {
|
208 | return ConfigRegistry.registerConfig(this.getName(), this.getProps());
|
209 | };
|
210 |
|
211 | Configuration.postCreateConcreteClass = function(arg) {
|
212 | var hotReloaded, superclass;
|
213 | hotReloaded = arg.hotReloaded;
|
214 | if (superclass = this.getSuperclass()) {
|
215 | this.deepMergeInDefaults(superclass.getConcretePrototypeProperties());
|
216 | }
|
217 | this.register();
|
218 | if (hotReloaded) {
|
219 | ConfigRegistry.reload();
|
220 | }
|
221 | return Configuration.__super__.constructor.postCreateConcreteClass.apply(this, arguments);
|
222 | };
|
223 |
|
224 | Configuration.getProps = function() {
|
225 | return this.getConcretePrototypeProperties();
|
226 | };
|
227 |
|
228 | Configuration.deepMergeInDefaults = function(defaults) {
|
229 | return mergeInto(this.prototype, deepMerge(defaults, this.getProps()));
|
230 | };
|
231 |
|
232 | Configuration.deepMergeInConfig = function(config) {
|
233 | return mergeInto(this.prototype, deepMerge(this.getProps(), config));
|
234 | };
|
235 |
|
236 | return Configuration;
|
237 |
|
238 | })(BaseObject));
|
239 |
|
240 | }.call(this, __webpack_require__( 7)(module)))
|
241 |
|
242 | }),
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 | (function(module, exports) {
|
249 |
|
250 | module.exports = function(module) {
|
251 | if (!module.webpackPolyfill) {
|
252 | module.deprecate = function() {};
|
253 | module.paths = [];
|
254 |
|
255 | if (!module.children) module.children = [];
|
256 | Object.defineProperty(module, "loaded", {
|
257 | enumerable: true,
|
258 | get: function() {
|
259 | return module.l;
|
260 | }
|
261 | });
|
262 | Object.defineProperty(module, "id", {
|
263 | enumerable: true,
|
264 | get: function() {
|
265 | return module.i;
|
266 | }
|
267 | });
|
268 | module.webpackPolyfill = 1;
|
269 | }
|
270 | return module;
|
271 | };
|
272 |
|
273 |
|
274 | }),
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 | (function(module, exports) {
|
281 |
|
282 | module.exports = require('art-standard-lib' );
|
283 |
|
284 | }),
|
285 |
|
286 |
|
287 |
|
288 |
|
289 |
|
290 | (function(module, exports) {
|
291 |
|
292 | module.exports = require('art-class-system' );
|
293 |
|
294 | }),
|
295 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 | (function(module, exports, __webpack_require__) {
|
301 |
|
302 | (function(module) {var BaseObject, ConfigRegistry, Promise, clone, compactFlatten, deepMerge, defineModule, expandPathedProperties, formattedInspect, inspect, isPlainObject, isString, log, merge, mergeInto, parseQuery, pushIfNotPresent, ref, upperCamelCase,
|
303 | extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
304 | hasProp = {}.hasOwnProperty,
|
305 | slice = [].slice;
|
306 |
|
307 | ref = __webpack_require__( 8), defineModule = ref.defineModule, log = ref.log, Promise = ref.Promise, inspect = ref.inspect, formattedInspect = ref.formattedInspect, merge = ref.merge, deepMerge = ref.deepMerge, mergeInto = ref.mergeInto, parseQuery = ref.parseQuery, pushIfNotPresent = ref.pushIfNotPresent, isPlainObject = ref.isPlainObject, isString = ref.isString, upperCamelCase = ref.upperCamelCase, expandPathedProperties = ref.expandPathedProperties, clone = ref.clone, compactFlatten = ref.compactFlatten;
|
308 |
|
309 | BaseObject = __webpack_require__( 9).BaseObject;
|
310 |
|
311 | defineModule(module, ConfigRegistry = (function(superClass) {
|
312 | extend(ConfigRegistry, superClass);
|
313 |
|
314 | function ConfigRegistry() {
|
315 | return ConfigRegistry.__super__.constructor.apply(this, arguments);
|
316 | }
|
317 |
|
318 | ConfigRegistry.configurables = [];
|
319 |
|
320 | ConfigRegistry.configs = {};
|
321 |
|
322 | ConfigRegistry.registerConfig = function(name, config) {
|
323 | if (!isPlainObject(config)) {
|
324 | throw new Error("config must be a plain object");
|
325 | }
|
326 | return ConfigRegistry.configs[name] = config;
|
327 | };
|
328 |
|
329 | ConfigRegistry.registerConfigurable = function(configurable) {
|
330 | return pushIfNotPresent(ConfigRegistry.configurables, configurable);
|
331 | };
|
332 |
|
333 | ConfigRegistry.configure = function() {
|
334 | var args, ref1;
|
335 | args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
336 | console.error("DEPRICATED: use Art.Config.configure");
|
337 | return (ref1 = Neptune.Art.Config).configure.apply(ref1, args);
|
338 | };
|
339 |
|
340 | return ConfigRegistry;
|
341 |
|
342 | })(BaseObject));
|
343 |
|
344 | }.call(this, __webpack_require__( 7)(module)))
|
345 |
|
346 | }),
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 | (function(module, exports, __webpack_require__) {
|
353 |
|
354 | (function(module) {var ConfigRegistry, Main, Promise, clone, compactFlatten, deepMerge, defineModule, expandPathedProperties, formattedInspect, getExternalEnvironment, inspect, isPlainObject, isString, log, merge, mergeInto, normalizeArtConfigName, parseQuery, pushIfNotPresent, ref, ref1, upperCamelCase,
|
355 | slice = [].slice;
|
356 |
|
357 | ref = __webpack_require__( 8), defineModule = ref.defineModule, log = ref.log, Promise = ref.Promise, inspect = ref.inspect, formattedInspect = ref.formattedInspect, merge = ref.merge, deepMerge = ref.deepMerge, mergeInto = ref.mergeInto, parseQuery = ref.parseQuery, pushIfNotPresent = ref.pushIfNotPresent, isPlainObject = ref.isPlainObject, isString = ref.isString, upperCamelCase = ref.upperCamelCase, expandPathedProperties = ref.expandPathedProperties, clone = ref.clone, compactFlatten = ref.compactFlatten;
|
358 |
|
359 | ConfigRegistry = __webpack_require__( 10);
|
360 |
|
361 | ref1 = __webpack_require__( 12), normalizeArtConfigName = ref1.normalizeArtConfigName, getExternalEnvironment = ref1.getExternalEnvironment;
|
362 |
|
363 | defineModule(module, Main = (function() {
|
364 | var getArtConfig, getArtConfigName, getDefaultArtConfigName, setArtConfigName;
|
365 |
|
366 | function Main() {}
|
367 |
|
368 | Main.getArtConfigName = getArtConfigName = function() {
|
369 | return Neptune.Art.Config.configName;
|
370 | };
|
371 |
|
372 | Main.getArtConfig = getArtConfig = function() {
|
373 | return Neptune.Art.Config.config;
|
374 | };
|
375 |
|
376 | Main.getDefaultArtConfigName = getDefaultArtConfigName = function() {
|
377 | return Neptune.Art.Config.defaultArtConfigName;
|
378 | };
|
379 |
|
380 |
|
381 | |
382 |
|
383 |
|
384 |
|
385 | Main.getArtConfigSave = function() {
|
386 | var configurable, i, len, out, ref2, saveConfig;
|
387 | out = {};
|
388 | ref2 = ConfigRegistry.configurables;
|
389 | for (i = 0, len = ref2.length; i < len; i++) {
|
390 | configurable = ref2[i];
|
391 | if (saveConfig = configurable.getConfigSave()) {
|
392 | mergeInto(out, saveConfig);
|
393 | }
|
394 | }
|
395 | return out;
|
396 | };
|
397 |
|
398 | setArtConfigName = function(name) {
|
399 | return Neptune.Art.Config.configName = name;
|
400 | };
|
401 |
|
402 |
|
403 | |
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 |
|
453 |
|
454 |
|
455 |
|
456 |
|
457 |
|
458 |
|
459 |
|
460 |
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 | Main.configure = function() {
|
468 | var __testEnv, artConfigArgument, artConfigNameArgument, c, conf, config, configName, configurable, configureOptions, defaultArtConfigName, externalEnvironment, i, len, obj, onConfig, ref2, ref3, ref4, verbose;
|
469 | configureOptions = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
470 | ref2 = Main.configureOptions = deepMerge.apply(null, configureOptions), artConfigNameArgument = ref2.artConfigName, artConfigArgument = ref2.artConfig, __testEnv = ref2.__testEnv, onConfig = ref2.onConfig;
|
471 | externalEnvironment = getExternalEnvironment(__testEnv);
|
472 | config = getArtConfig();
|
473 | defaultArtConfigName = getDefaultArtConfigName();
|
474 | configName = normalizeArtConfigName(externalEnvironment.artConfigName || artConfigNameArgument || global.artConfigName) ? (configName = normalizeArtConfigName(externalEnvironment.artConfigName || artConfigNameArgument || global.artConfigName), configName && !ConfigRegistry.configs[configName] ? log.warn("ArtConfig.configure: no config registered with name: '" + configName + "'") : void 0, configName) : defaultArtConfigName;
|
475 | setArtConfigName(configName);
|
476 | Main.resetCurrentConfig();
|
477 | ref3 = compactFlatten([
|
478 | (function() {
|
479 | var j, len, ref3, results;
|
480 | ref3 = ConfigRegistry.configurables;
|
481 | results = [];
|
482 | for (j = 0, len = ref3.length; j < len; j++) {
|
483 | configurable = ref3[j];
|
484 | results.push(configurable.getPathedDefaultConfig());
|
485 | }
|
486 | return results;
|
487 | })(), ConfigRegistry.configs[configName], global.artConfig, artConfigArgument, externalEnvironment.artConfig
|
488 | ]);
|
489 | for (i = 0, len = ref3.length; i < len; i++) {
|
490 | conf = ref3[i];
|
491 | expandPathedProperties(conf, config);
|
492 | }
|
493 | verbose = config.verbose;
|
494 | verbose || (verbose = (ref4 = Main.configureOptions) != null ? ref4.verbose : void 0);
|
495 | if (verbose) {
|
496 | log("------------- ConfigRegistry: inputs");
|
497 | log({
|
498 | ConfigRegistry: {
|
499 | configNames: Object.keys(ConfigRegistry.configs),
|
500 | configurables: (function() {
|
501 | var j, len1, ref5, results;
|
502 | ref5 = ConfigRegistry.configurables;
|
503 | results = [];
|
504 | for (j = 0, len1 = ref5.length; j < len1; j++) {
|
505 | c = ref5[j];
|
506 | results.push(c.namespacePath);
|
507 | }
|
508 | return results;
|
509 | })(),
|
510 | setConfigName: {
|
511 | algorithm: "select LAST non-null",
|
512 | inputs: {
|
513 | defaultArtConfigName: defaultArtConfigName,
|
514 | "global.artConfigName": global.artConfigName,
|
515 | "arguments.artConfigName": artConfigNameArgument,
|
516 | "environment.artConfigName": externalEnvironment.artConfigName
|
517 | }
|
518 | },
|
519 | setConfig: {
|
520 | algorithm: "deep, pathed merge-all, LAST has priority",
|
521 | inputs: (
|
522 | obj = {
|
523 | defaultConfigs: (function() {
|
524 | var j, len1, ref5, results;
|
525 | ref5 = ConfigRegistry.configurables;
|
526 | results = [];
|
527 | for (j = 0, len1 = ref5.length; j < len1; j++) {
|
528 | configurable = ref5[j];
|
529 | results.push(configurable.getPathedDefaultConfig());
|
530 | }
|
531 | return results;
|
532 | })()
|
533 | },
|
534 | obj["configs." + configName] = ConfigRegistry.configs[configName],
|
535 | obj["global.artConfig"] = global.artConfig,
|
536 | obj["arguments.artConfig"] = artConfigArgument,
|
537 | obj["environment.artConfig"] = externalEnvironment.artConfig,
|
538 | obj
|
539 | )
|
540 | }
|
541 | }
|
542 | });
|
543 | log("------------- ConfigRegistry: configuring Configurables...");
|
544 | }
|
545 | Main._configureAllConfigurables();
|
546 | if (verbose) {
|
547 | log("------------- ConfigRegistry: configured");
|
548 | log({
|
549 | Art: {
|
550 | configName: configName,
|
551 | config: config
|
552 | }
|
553 | });
|
554 | log("------------- ConfigRegistry: done");
|
555 | }
|
556 | if (typeof onConfig === "function") {
|
557 | onConfig(config);
|
558 | }
|
559 | global.artConfig = config;
|
560 | global.artConfigName = configName;
|
561 | return config;
|
562 | };
|
563 |
|
564 | Main.resetCurrentConfig = function() {
|
565 | var config, k, results, v;
|
566 | config = getArtConfig();
|
567 | results = [];
|
568 | for (k in config) {
|
569 | v = config[k];
|
570 | results.push(delete config[k]);
|
571 | }
|
572 | return results;
|
573 | };
|
574 |
|
575 | Main.reload = function() {
|
576 | return Main.configure(Main.configureOptions);
|
577 | };
|
578 |
|
579 | Main._configureAllConfigurables = function() {
|
580 | var configurable, i, len, ref2;
|
581 | ref2 = ConfigRegistry.configurables;
|
582 | for (i = 0, len = ref2.length; i < len; i++) {
|
583 | configurable = ref2[i];
|
584 | configurable.configure(getArtConfig());
|
585 | }
|
586 | return this._notifyConfigurablesConfigured();
|
587 | };
|
588 |
|
589 | Main._notifyConfigurablesConfigured = function() {
|
590 | var configurable, i, len, ref2, results;
|
591 | ref2 = ConfigRegistry.configurables;
|
592 | results = [];
|
593 | for (i = 0, len = ref2.length; i < len; i++) {
|
594 | configurable = ref2[i];
|
595 | results.push(configurable.configured());
|
596 | }
|
597 | return results;
|
598 | };
|
599 |
|
600 | return Main;
|
601 |
|
602 | })());
|
603 |
|
604 | }.call(this, __webpack_require__( 7)(module)))
|
605 |
|
606 | }),
|
607 |
|
608 |
|
609 |
|
610 |
|
611 |
|
612 | (function(module, exports, __webpack_require__) {
|
613 |
|
614 | (function(module) {var Lib, Promise, clone, compactFlatten, deepMerge, defineModule, expandPathedProperties, formattedInspect, getEnv, inspect, isPlainObject, isString, jsonParsableRegexp, log, merge, mergeInto, parseQuery, pushIfNotPresent, ref, upperCamelCase;
|
615 |
|
616 | ref = __webpack_require__( 8), defineModule = ref.defineModule, log = ref.log, Promise = ref.Promise, inspect = ref.inspect, formattedInspect = ref.formattedInspect, merge = ref.merge, deepMerge = ref.deepMerge, mergeInto = ref.mergeInto, parseQuery = ref.parseQuery, pushIfNotPresent = ref.pushIfNotPresent, isPlainObject = ref.isPlainObject, isString = ref.isString, upperCamelCase = ref.upperCamelCase, expandPathedProperties = ref.expandPathedProperties, clone = ref.clone, compactFlatten = ref.compactFlatten, getEnv = ref.getEnv;
|
617 |
|
618 | jsonParsableRegexp = /^(\[.*\]|\{.*\}|\".*\"|((-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|true|false|null))$/;
|
619 |
|
620 | defineModule(module, Lib = (function() {
|
621 | var smartJsonDecode;
|
622 |
|
623 | function Lib() {}
|
624 |
|
625 | Lib.smartJsonDecode = smartJsonDecode = function(value) {
|
626 | if (isString(value) && jsonParsableRegexp.test(value)) {
|
627 | return JSON.parse(value);
|
628 | } else {
|
629 | return value != null ? value : null;
|
630 | }
|
631 | };
|
632 |
|
633 | Lib.getExternalEnvironment = function(externalEnvironment) {
|
634 | var artConfig, artConfigName, e, k, m, v;
|
635 | if (externalEnvironment == null) {
|
636 | externalEnvironment = getEnv();
|
637 | }
|
638 | artConfig = externalEnvironment.artConfig, artConfigName = externalEnvironment.artConfigName;
|
639 | artConfig = (function() {
|
640 | if (isPlainObject(artConfig)) {
|
641 | return artConfig;
|
642 | } else if (isString(artConfig)) {
|
643 | try {
|
644 | return JSON.parse(artConfig);
|
645 | } catch (error) {
|
646 | e = error;
|
647 | log.error("\nInvalid 'artConfig' from externalEnvironment. Must be valid JSON.\n\n" + (formattedInspect({
|
648 | externalEnvironment: externalEnvironment
|
649 | })) + "\n\nartConfig: " + (formattedInspect(artConfig)) + "\n\nerror: " + e + "\n");
|
650 | return null;
|
651 | }
|
652 | } else {
|
653 | return {};
|
654 | }
|
655 | })();
|
656 | for (k in externalEnvironment) {
|
657 | v = externalEnvironment[k];
|
658 | if (m = k.match(/^artConfig([\._])(.+)$/)) {
|
659 | if (m[1] === "_") {
|
660 | artConfig[m[2].replace(/_/g, '.')] = smartJsonDecode(v);
|
661 | } else {
|
662 | artConfig[m[2]] = smartJsonDecode(v);
|
663 | }
|
664 | }
|
665 | }
|
666 | return {
|
667 | artConfig: artConfig,
|
668 | artConfigName: artConfigName
|
669 | };
|
670 | };
|
671 |
|
672 |
|
673 | |
674 |
|
675 |
|
676 |
|
677 |
|
678 |
|
679 | Lib.normalizeArtConfigName = function(artConfigName) {
|
680 | switch (artConfigName) {
|
681 | case "dev":
|
682 | return "Development";
|
683 | case "prod":
|
684 | return "Production";
|
685 | default:
|
686 | return artConfigName && upperCamelCase(artConfigName);
|
687 | }
|
688 | };
|
689 |
|
690 | return Lib;
|
691 |
|
692 | })());
|
693 |
|
694 | }.call(this, __webpack_require__( 7)(module)))
|
695 |
|
696 | }),
|
697 |
|
698 |
|
699 |
|
700 |
|
701 |
|
702 | (function(module, exports, __webpack_require__) {
|
703 |
|
704 | (function(module) {var BaseClass, ConfigRegistry, Configurable, ErrorWithInfo, EventedMixin, deepMerge, defineModule, isPlainObject, log, merge, mergeInto, namespace, neq, ref,
|
705 | extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
706 | hasProp = {}.hasOwnProperty,
|
707 | slice = [].slice;
|
708 |
|
709 | ref = __webpack_require__( 8), defineModule = ref.defineModule, log = ref.log, merge = ref.merge, isPlainObject = ref.isPlainObject, mergeInto = ref.mergeInto, deepMerge = ref.deepMerge, isPlainObject = ref.isPlainObject, ErrorWithInfo = ref.ErrorWithInfo, neq = ref.neq;
|
710 |
|
711 | BaseClass = __webpack_require__( 9).BaseClass;
|
712 |
|
713 | namespace = __webpack_require__( 2);
|
714 |
|
715 | ConfigRegistry = __webpack_require__( 10);
|
716 |
|
717 | EventedMixin = __webpack_require__( 14).EventedMixin;
|
718 |
|
719 |
|
720 |
|
721 |
|
722 |
|
723 |
|
724 |
|
725 |
|
726 |
|
727 |
|
728 |
|
729 |
|
730 |
|
731 | defineModule(module, Configurable = (function(superClass) {
|
732 | extend(Configurable, superClass);
|
733 |
|
734 | function Configurable() {
|
735 | return Configurable.__super__.constructor.apply(this, arguments);
|
736 | }
|
737 |
|
738 | Configurable.abstractClass();
|
739 |
|
740 | Configurable.declarable({
|
741 | defaults: {}
|
742 | });
|
743 |
|
744 | Configurable.getDefaultConfig = function() {
|
745 | return this.getDefaults();
|
746 | };
|
747 |
|
748 | Configurable.extendConfig = function() {
|
749 | if (this.hasOwnProperty("config")) {
|
750 | return this.config;
|
751 | } else {
|
752 | return this.config = {};
|
753 | }
|
754 | };
|
755 |
|
756 | Configurable.reset = function() {
|
757 | var config, defaults, k, ref1, v;
|
758 | defaults = this.getDefaults();
|
759 | config = this.extendConfig();
|
760 | for (k in config) {
|
761 | v = config[k];
|
762 | if (defaults[k] == null) {
|
763 | delete config[k];
|
764 | }
|
765 | }
|
766 | mergeInto(config, defaults);
|
767 | if (this.namespace !== namespace) {
|
768 | if ((ref1 = this.namespace) != null) {
|
769 | ref1.config || (ref1.config = config);
|
770 | }
|
771 | }
|
772 | return config;
|
773 | };
|
774 |
|
775 | Configurable.getInspectedObjects = function() {
|
776 | var obj;
|
777 | return (
|
778 | obj = {},
|
779 | obj["" + (this.getConfigurationPathString())] = this.config,
|
780 | obj
|
781 | );
|
782 | };
|
783 |
|
784 | Configurable.getPathedDefaultConfig = function() {
|
785 | var obj;
|
786 | return (
|
787 | obj = {},
|
788 | obj["" + (this.getConfigurationPathString())] = this.getDefaults(),
|
789 | obj
|
790 | );
|
791 | };
|
792 |
|
793 | Configurable.configure = function(globalConfig) {
|
794 | var obj;
|
795 | globalConfig.verbose && log({
|
796 | Configurable: (
|
797 | obj = {},
|
798 | obj["" + (this.getConfigurationPathString())] = this.getConfigurationFromPath(globalConfig),
|
799 | obj
|
800 | )
|
801 | });
|
802 | return mergeInto(this.reset(), this.getConfigurationFromPath(globalConfig));
|
803 | };
|
804 |
|
805 | Configurable.getConfigSave = function() {
|
806 | var count, defaults, k, obj, out, ref1, ref2, v;
|
807 | out = {};
|
808 | defaults = this.getDefaults();
|
809 | count = 0;
|
810 | ref2 = (ref1 = this.config) != null ? ref1 : {};
|
811 | for (k in ref2) {
|
812 | v = ref2[k];
|
813 | if (!(neq(v, defaults[k]))) {
|
814 | continue;
|
815 | }
|
816 | count++;
|
817 | out[k] = v;
|
818 | }
|
819 | if (count > 0) {
|
820 | return (
|
821 | obj = {},
|
822 | obj["" + (this.getConfigurationPathString())] = out,
|
823 | obj
|
824 | );
|
825 | }
|
826 | };
|
827 |
|
828 | Configurable.on = function() {
|
829 | var a, ref1;
|
830 | a = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
831 | return (ref1 = this.getSingleton()).on.apply(ref1, a);
|
832 | };
|
833 |
|
834 | Configurable.configured = function() {
|
835 | return this.getSingleton().handleEvent("configured", {
|
836 | config: this.config
|
837 | });
|
838 | };
|
839 |
|
840 | Configurable.getConfigurationPath = function() {
|
841 | var _Configurable, _Neptune, i, path, ref1;
|
842 | ref1 = this.getNamespacePath().split('.'), _Neptune = ref1[0], path = 3 <= ref1.length ? slice.call(ref1, 1, i = ref1.length - 1) : (i = 1, []), _Configurable = ref1[i++];
|
843 | return path;
|
844 | };
|
845 |
|
846 | Configurable.getConfigurationPathString = function() {
|
847 | return this.getConfigurationPath().join('.');
|
848 | };
|
849 |
|
850 | Configurable.getConfigurationFromPath = function(config, path) {
|
851 | var el, i, len;
|
852 | if (path == null) {
|
853 | path = this.getConfigurationPath();
|
854 | }
|
855 | for (i = 0, len = path.length; i < len; i++) {
|
856 | el = path[i];
|
857 | config = config != null ? config[el] : void 0;
|
858 | }
|
859 | return config;
|
860 | };
|
861 |
|
862 | Configurable._register = function() {
|
863 | this.reset();
|
864 | return ConfigRegistry.registerConfigurable(this);
|
865 | };
|
866 |
|
867 | Configurable.postCreateConcreteClass = function(arg) {
|
868 | var hotReloaded;
|
869 | hotReloaded = arg.hotReloaded;
|
870 | if (hotReloaded) {
|
871 | ConfigRegistry.reload();
|
872 | } else {
|
873 | this._register();
|
874 | }
|
875 | return Configurable.__super__.constructor.postCreateConcreteClass.apply(this, arguments);
|
876 | };
|
877 |
|
878 | return Configurable;
|
879 |
|
880 | })(EventedMixin(BaseClass)));
|
881 |
|
882 | }.call(this, __webpack_require__( 7)(module)))
|
883 |
|
884 | }),
|
885 |
|
886 |
|
887 |
|
888 |
|
889 |
|
890 | (function(module, exports) {
|
891 |
|
892 | module.exports = require('art-events' );
|
893 |
|
894 | })
|
895 | ]); |
\ | No newline at end of file |