app-bundler 0.0.97 → 0.1.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/index.js CHANGED
@@ -5,7 +5,9 @@ if (args) {
5
5
  runNewNode(args);
6
6
  } else {
7
7
  let run = require('./lib/cli');
8
- run();
8
+ run().catch(error => {
9
+ console.error('AppBundler Failed', error);
10
+ });
9
11
  }
10
12
 
11
13
 
@@ -52,7 +54,7 @@ function resolveNativeNodeArgumentsIfAny () {
52
54
  case '--debug-brk':
53
55
  case '--inspect':
54
56
  case '--inspect-brk':
55
- args.unshift(arg);
57
+ args.unshift(arg);
56
58
  break;
57
59
  case '-gc':
58
60
  case '--expose-gc':
package/lib/bundler.js CHANGED
@@ -530,8 +530,12 @@ function path_isRelative(path) {
530
530
  exports.path_isRelative = path_isRelative;
531
531
  ;
532
532
  function path_toRelative(path, anchor, base) {
533
- var path_ = path_resolveUrl(path_normalize(path), base), absolute_ = path_resolveUrl(path_normalize(anchor), base);
534
- if (path_getExtension(absolute_) !== '') {
533
+ var pathNormalized = path_normalize(path);
534
+ var anchorNormalized = path_normalize(anchor);
535
+ var path_ = path_resolveUrl(pathNormalized, base);
536
+ var absolute_ = path_resolveUrl(anchorNormalized, base);
537
+ if (pathNormalized.includes(anchorNormalized) === false && path_getExtension(absolute_) !== '') {
538
+ // in-case anchor is a File
535
539
  absolute_ = path_getDir(absolute_);
536
540
  }
537
541
  absolute_ = path_combine(absolute_, '/');
@@ -4392,7 +4396,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4392
4396
  var global_1 = _src_global;
4393
4397
  exports.Templates = {
4394
4398
  Module: "\n// source ./Module.js\n__register(\"%MODULE_PATH%\", function(require, module, exports, __filename, __dirname){\n\t%MODULE%\n\n\t%FOOTER%\n});\n\n// end:source ./Module.js\n",
4395
- ModuleSimplified: "\n// source ./ModuleSimplified.js\nvar ___VAR_ID___;\n(function () {\n // ensure AMD is not active for the model, so that any UMD exports as commonjs\n var define = null;\n var exports = ___VAR_ID___ != null ? ___VAR_ID___ : {};\n var module = { exports: exports };\n\n ___MODULE___;\n\n function __isObj(x) {\n return x != null && typeof x === 'object' && x.constructor === Object;\n }\n if (__isObj(___VAR_ID___) && __isObj(module.exports)) {\n Object.assign(___VAR_ID___, module.exports);\n } else {\n ___VAR_ID___ = module.exports;\n }\n\n ___FOOTER___;\n}());\n\n// end:source ./ModuleSimplified.js\n",
4399
+ ModuleSimplified: "\n// source ./ModuleSimplified.js\nvar ___VAR_ID___;\n(function () {\n // ensure AMD is not active for the model, so that any UMD exports as commonjs\n var define = null;\n var exports = ___VAR_ID___ != null ? ___VAR_ID___ : {};\n var module = { exports: exports };\n\n ___MODULE___;\n\n function __isObj(x) {\n return x != null && typeof x === 'object' && x.constructor === Object;\n }\n if (___VAR_ID___ === module.exports) {\n // do nothing if\n } else if (__isObj(___VAR_ID___) && __isObj(module.exports)) {\n Object.assign(___VAR_ID___, module.exports);\n } else {\n ___VAR_ID___ = module.exports;\n }\n\n ___FOOTER___;\n}());\n\n// end:source ./ModuleSimplified.js\n",
4396
4400
  Header: "\n// source ./Header.js\nvar __register, __require, require;\n\n(function(){\n\n\t// source ./path.js\n\tvar path_getDir,\n\t\tpath_resolveCurrent,\n\t\tpath_normalize,\n\t\tpath_resolveUrl,\n\t\tpath_combine\t\n\t\t;\n\t(function(){\n\t\tvar isNodeJS = typeof process !== 'undefined' \n\t\t\t&& typeof window === 'undefined' \n\t\t\t&& typeof navigator === 'undefined';\n\t\n\t\tpath_getDir = function(path) {\n\t\t\treturn path.substring(0, path.lastIndexOf('/') + 1);\n\t\t};\n\t\n\t\t(function(){\n\t\t\tvar current_;\t\t\n\t\t\tif (isNodeJS === false) {\n\t\t\t\tpath_resolveCurrent = function(){\n\t\t\t\t\tif (current_ != null) return current_;\n\t\n\t\t\t\t\tvar fn = 'baseURI' in window.document\n\t\t\t\t\t\t\t? fromBase\n\t\t\t\t\t\t\t: fromLocation;\n\t\t\t\t\treturn (current_ = path_sliceFilename(fn()));\n\t\t\t\t};\n\t\t\t\tfunction fromBase() {\n\t\t\t\t\tvar path = window.document.baseURI;\n\t\t\t\t\tvar i = path.indexOf('?');\n\t\t\t\t\treturn i === -1 ? path : path.substring(0, i);\n\t\t\t\t}\n\t\t\t\tfunction fromLocation() {\n\t\t\t\t\treturn window.location.origin + window.location.pathname;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\n\t\t\t\tpath_resolveCurrent = function(){\n\t\t\t\t\tif (current_ != null) return current_;\n\t\t\t\t\treturn (current_ = path_win32Normalize(__dirname));\n\t\t\t\t};\n\t\t\t}\n\t\t}());\n\t\n\t\n\t\tpath_normalize = function(path) {\n\t\t\tvar path_ = path\n\t\t\t\t.replace(new RegExp(\"\\\\\\\\\", \"g\"), '/')\n\t\t\t\t// remove double slashes, but not near protocol\n\t\t\t\t.replace(new RegExp(\"([^:\\\\/])\\\\/{2,}\", \"g\"), '$1/')\n\t\t\t\t// './xx' to relative string\n\t\t\t\t.replace(new RegExp(\"^\\\\.\\\\/\"), '')\n\t\t\t\t// join 'xx/./xx'\n\t\t\t\t.replace(new RegExp(\"\\\\/\\\\.\\\\//\", \"g\"), '/')\n\t\t\t\t;\n\t\t\tpath_ = path_collapse(path_);\t\t\n\t\t\treturn path_;\n\t\t};\n\t\tpath_resolveUrl = function(path, location) {\n\t\t\tif (/\\.\\w+$/.test(path) === false) {\n\t\t\t\tpath += '.js';\n\t\t\t}\n\t\t\tvar url = path_normalize(path);\n\t\t\tif (url[0] === '/') {\n\t\t\t\turl = path_combine(path_resolveCurrent(), url);\n\t\t\t} else if (rgx_PROTOCOL.test(url) === false) {\n\t\t\t\turl = path_normalize(path_combine(location || path_resolveCurrent(), url));\n\t\t\t}\n\t\t\tif (rgx_PROTOCOL.test(url) === false) {\n\t\t\t\turl = 'file://' + url;\n\t\t\t}\n\t\t\treturn url;\n\t\t};\n\t\t\n\t\tpath_combine = function() {\n\t\t\tvar out = '',\n\t\t\t\timax = arguments.length,\n\t\t\t\ti = -1, x;\n\t\t\twhile ( ++i < imax ){\n\t\t\t\tx = arguments[i];\n\t\t\t\tif (!x) continue;\n\t\n\t\t\t\tx = path_normalize(x);\n\t\t\t\tif (out === '') {\n\t\t\t\t\tout = x;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (out[out.length - 1] !== '/') {\n\t\t\t\t\tout += '/'\n\t\t\t\t}\n\t\t\t\tif (x[0] === '/') {\n\t\t\t\t\tx = x.substring(1);\n\t\t\t\t}\n\t\t\t\tout += x;\n\t\t\t}\n\t\t\treturn path_collapse(out);\n\t\t};\n\t\n\t\tvar rgx_PROTOCOL = /^(file|https?):/i,\n\t\t\trgx_SUB_DIR = new RegExp(\"[^\\\\/\\\\.]+/\\\\.\\\\.\\\\/\"),\n\t\t\trgx_FILENAME = new RegExp(\"\\\\/[^\\\\/]+\\\\.\\\\w+(\\\\?.*)?(#.*)?$\"),\n\t\t\trgx_EXT = new RegExp(\"\\\\.(\\\\w+)$\"),\n\t\t\trgx_win32Drive = new RegExp(\"(^\\\\/?\\\\w{1}:)(\\\\/|$)\")\n\t\t\t;\n\t\n\t\tfunction path_win32Normalize (path){\n\t\t\tpath = path_normalize(path);\n\t\t\tif (path.substring(0, 5) === 'file:')\n\t\t\t\treturn path;\n\t\n\t\t\treturn 'file://' + path;\n\t\t}\n\t\n\t\tfunction path_collapse(url_) {\n\t\t\tvar url = url_;\n\t\t\twhile (rgx_SUB_DIR.test(url)) {\n\t\t\t\turl = url.replace(rgx_SUB_DIR, '');\n\t\t\t}\n\t\t\treturn url;\n\t\t}\n\t\tfunction path_ensureTrailingSlash(path) {\n\t\t\tif (path.charCodeAt(path.length - 1) === 47 /* / */)\n\t\t\t\treturn path;\n\t\n\t\t\treturn path + '/';\n\t\t}\n\t\tfunction path_sliceFilename(path) {\n\t\t\treturn path_ensureTrailingSlash(path.replace(rgx_FILENAME, ''));\n\t\t}\n\t\n\t}());\n\t\n\t// end:source ./path.js\n\n\tvar __global = typeof global !== 'undefined' && global ? global : window;\n\tvar __nativeRequire = __global.require;\n\tvar __originalRequire = function (path_) {\n\t\tvar location = this.location;\n\t\tvar path = path_resolveUrl(path_, location);\n\n\t\tif (modules[path]) {\n\t\t\treturn modules[path].runOnce();\n\t\t}\n\n\t\treturn __nativeRequire(path_);\n\t};\n\n\t__register = function (path, factory) {\n\t\tvar filename = path_resolveUrl(path);\t\n\t\tmodules[filename] = new Module(filename, factory);\t\t\t\n\t};\n\n\t__require =__originalRequire.bind({ location: path_getDir(path_resolveUrl('%ROOT_DIR%')) });\n\n\tvar modules = {};\n\tvar Module = function(filename, factory){\t\n\t\tthis.filename = filename;\n\t\tthis.dirname = path_getDir(filename);\n\t\tthis.factory = factory;\n\t\tthis.exports = null;\n\t};\n\tModule.prototype.runOnce = function(){\n\t\tif (this.exports != null) {\n\t\t\treturn this.exports;\n\t\t}\n\t\tvar require = __originalRequire.bind({ \n\t\t\tlocation: this.dirname \n\t\t});\n\t\tthis.exports = {};\n\t\tthis.factory(\n\t\t\trequire, \n\t\t\tthis, \n\t\t\tthis.exports, \n\t\t\tthis.filename, \n\t\t\tthis.dirname\n\t\t);\n\t\treturn this.exports;\n\t};\n\t\n\trequire = __require;\n\n\tif (__nativeRequire == null) {\n\t\t__global.require = __require;\n\t}\n}());\n// end:source ./Header.js\n",
4397
4401
  RootModule: "\n// source ./RootModule.js\n(function(){\n\t\n\t%BUNDLE%\n\n}());\n// end:source ./RootModule.js\n",
4398
4402
  UMD: "\n// source ./UMD.js\n(function (factory) {\n\n var _name = '%NAME%',\n _global = typeof window === 'undefined' ? global : window,\n _module = {\n exports: {}\n };\n\n factory(_module, _module.exports, _global);\n\n if (typeof module === 'object' && module.exports) {\n module.exports = _module.exports;\n }\n\n if (typeof define === 'function' && define.amd) {\n define([], function () {\n return _module.exports;\n });\n return;\n }\n \n if (_name) {\n _global[_name] = _module.exports;\n }\n\n}(function (module, exports, global) {\n\n %MODULE%\n\n}));\n\n// end:source ./UMD.js\n",
package/lib/cli.js CHANGED
@@ -532,8 +532,12 @@ function path_isRelative(path) {
532
532
  exports.path_isRelative = path_isRelative;
533
533
  ;
534
534
  function path_toRelative(path, anchor, base) {
535
- var path_ = path_resolveUrl(path_normalize(path), base), absolute_ = path_resolveUrl(path_normalize(anchor), base);
536
- if (path_getExtension(absolute_) !== '') {
535
+ var pathNormalized = path_normalize(path);
536
+ var anchorNormalized = path_normalize(anchor);
537
+ var path_ = path_resolveUrl(pathNormalized, base);
538
+ var absolute_ = path_resolveUrl(anchorNormalized, base);
539
+ if (pathNormalized.includes(anchorNormalized) === false && path_getExtension(absolute_) !== '') {
540
+ // in-case anchor is a File
537
541
  absolute_ = path_getDir(absolute_);
538
542
  }
539
543
  absolute_ = path_combine(absolute_, '/');
@@ -4394,7 +4398,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4394
4398
  var global_1 = _src_global;
4395
4399
  exports.Templates = {
4396
4400
  Module: "\n// source ./Module.js\n__register(\"%MODULE_PATH%\", function(require, module, exports, __filename, __dirname){\n\t%MODULE%\n\n\t%FOOTER%\n});\n\n// end:source ./Module.js\n",
4397
- ModuleSimplified: "\n// source ./ModuleSimplified.js\nvar ___VAR_ID___;\n(function () {\n // ensure AMD is not active for the model, so that any UMD exports as commonjs\n var define = null;\n var exports = ___VAR_ID___ != null ? ___VAR_ID___ : {};\n var module = { exports: exports };\n\n ___MODULE___;\n\n function __isObj(x) {\n return x != null && typeof x === 'object' && x.constructor === Object;\n }\n if (__isObj(___VAR_ID___) && __isObj(module.exports)) {\n Object.assign(___VAR_ID___, module.exports);\n } else {\n ___VAR_ID___ = module.exports;\n }\n\n ___FOOTER___;\n}());\n\n// end:source ./ModuleSimplified.js\n",
4401
+ ModuleSimplified: "\n// source ./ModuleSimplified.js\nvar ___VAR_ID___;\n(function () {\n // ensure AMD is not active for the model, so that any UMD exports as commonjs\n var define = null;\n var exports = ___VAR_ID___ != null ? ___VAR_ID___ : {};\n var module = { exports: exports };\n\n ___MODULE___;\n\n function __isObj(x) {\n return x != null && typeof x === 'object' && x.constructor === Object;\n }\n if (___VAR_ID___ === module.exports) {\n // do nothing if\n } else if (__isObj(___VAR_ID___) && __isObj(module.exports)) {\n Object.assign(___VAR_ID___, module.exports);\n } else {\n ___VAR_ID___ = module.exports;\n }\n\n ___FOOTER___;\n}());\n\n// end:source ./ModuleSimplified.js\n",
4398
4402
  Header: "\n// source ./Header.js\nvar __register, __require, require;\n\n(function(){\n\n\t// source ./path.js\n\tvar path_getDir,\n\t\tpath_resolveCurrent,\n\t\tpath_normalize,\n\t\tpath_resolveUrl,\n\t\tpath_combine\t\n\t\t;\n\t(function(){\n\t\tvar isNodeJS = typeof process !== 'undefined' \n\t\t\t&& typeof window === 'undefined' \n\t\t\t&& typeof navigator === 'undefined';\n\t\n\t\tpath_getDir = function(path) {\n\t\t\treturn path.substring(0, path.lastIndexOf('/') + 1);\n\t\t};\n\t\n\t\t(function(){\n\t\t\tvar current_;\t\t\n\t\t\tif (isNodeJS === false) {\n\t\t\t\tpath_resolveCurrent = function(){\n\t\t\t\t\tif (current_ != null) return current_;\n\t\n\t\t\t\t\tvar fn = 'baseURI' in window.document\n\t\t\t\t\t\t\t? fromBase\n\t\t\t\t\t\t\t: fromLocation;\n\t\t\t\t\treturn (current_ = path_sliceFilename(fn()));\n\t\t\t\t};\n\t\t\t\tfunction fromBase() {\n\t\t\t\t\tvar path = window.document.baseURI;\n\t\t\t\t\tvar i = path.indexOf('?');\n\t\t\t\t\treturn i === -1 ? path : path.substring(0, i);\n\t\t\t\t}\n\t\t\t\tfunction fromLocation() {\n\t\t\t\t\treturn window.location.origin + window.location.pathname;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\n\t\t\t\tpath_resolveCurrent = function(){\n\t\t\t\t\tif (current_ != null) return current_;\n\t\t\t\t\treturn (current_ = path_win32Normalize(__dirname));\n\t\t\t\t};\n\t\t\t}\n\t\t}());\n\t\n\t\n\t\tpath_normalize = function(path) {\n\t\t\tvar path_ = path\n\t\t\t\t.replace(new RegExp(\"\\\\\\\\\", \"g\"), '/')\n\t\t\t\t// remove double slashes, but not near protocol\n\t\t\t\t.replace(new RegExp(\"([^:\\\\/])\\\\/{2,}\", \"g\"), '$1/')\n\t\t\t\t// './xx' to relative string\n\t\t\t\t.replace(new RegExp(\"^\\\\.\\\\/\"), '')\n\t\t\t\t// join 'xx/./xx'\n\t\t\t\t.replace(new RegExp(\"\\\\/\\\\.\\\\//\", \"g\"), '/')\n\t\t\t\t;\n\t\t\tpath_ = path_collapse(path_);\t\t\n\t\t\treturn path_;\n\t\t};\n\t\tpath_resolveUrl = function(path, location) {\n\t\t\tif (/\\.\\w+$/.test(path) === false) {\n\t\t\t\tpath += '.js';\n\t\t\t}\n\t\t\tvar url = path_normalize(path);\n\t\t\tif (url[0] === '/') {\n\t\t\t\turl = path_combine(path_resolveCurrent(), url);\n\t\t\t} else if (rgx_PROTOCOL.test(url) === false) {\n\t\t\t\turl = path_normalize(path_combine(location || path_resolveCurrent(), url));\n\t\t\t}\n\t\t\tif (rgx_PROTOCOL.test(url) === false) {\n\t\t\t\turl = 'file://' + url;\n\t\t\t}\n\t\t\treturn url;\n\t\t};\n\t\t\n\t\tpath_combine = function() {\n\t\t\tvar out = '',\n\t\t\t\timax = arguments.length,\n\t\t\t\ti = -1, x;\n\t\t\twhile ( ++i < imax ){\n\t\t\t\tx = arguments[i];\n\t\t\t\tif (!x) continue;\n\t\n\t\t\t\tx = path_normalize(x);\n\t\t\t\tif (out === '') {\n\t\t\t\t\tout = x;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (out[out.length - 1] !== '/') {\n\t\t\t\t\tout += '/'\n\t\t\t\t}\n\t\t\t\tif (x[0] === '/') {\n\t\t\t\t\tx = x.substring(1);\n\t\t\t\t}\n\t\t\t\tout += x;\n\t\t\t}\n\t\t\treturn path_collapse(out);\n\t\t};\n\t\n\t\tvar rgx_PROTOCOL = /^(file|https?):/i,\n\t\t\trgx_SUB_DIR = new RegExp(\"[^\\\\/\\\\.]+/\\\\.\\\\.\\\\/\"),\n\t\t\trgx_FILENAME = new RegExp(\"\\\\/[^\\\\/]+\\\\.\\\\w+(\\\\?.*)?(#.*)?$\"),\n\t\t\trgx_EXT = new RegExp(\"\\\\.(\\\\w+)$\"),\n\t\t\trgx_win32Drive = new RegExp(\"(^\\\\/?\\\\w{1}:)(\\\\/|$)\")\n\t\t\t;\n\t\n\t\tfunction path_win32Normalize (path){\n\t\t\tpath = path_normalize(path);\n\t\t\tif (path.substring(0, 5) === 'file:')\n\t\t\t\treturn path;\n\t\n\t\t\treturn 'file://' + path;\n\t\t}\n\t\n\t\tfunction path_collapse(url_) {\n\t\t\tvar url = url_;\n\t\t\twhile (rgx_SUB_DIR.test(url)) {\n\t\t\t\turl = url.replace(rgx_SUB_DIR, '');\n\t\t\t}\n\t\t\treturn url;\n\t\t}\n\t\tfunction path_ensureTrailingSlash(path) {\n\t\t\tif (path.charCodeAt(path.length - 1) === 47 /* / */)\n\t\t\t\treturn path;\n\t\n\t\t\treturn path + '/';\n\t\t}\n\t\tfunction path_sliceFilename(path) {\n\t\t\treturn path_ensureTrailingSlash(path.replace(rgx_FILENAME, ''));\n\t\t}\n\t\n\t}());\n\t\n\t// end:source ./path.js\n\n\tvar __global = typeof global !== 'undefined' && global ? global : window;\n\tvar __nativeRequire = __global.require;\n\tvar __originalRequire = function (path_) {\n\t\tvar location = this.location;\n\t\tvar path = path_resolveUrl(path_, location);\n\n\t\tif (modules[path]) {\n\t\t\treturn modules[path].runOnce();\n\t\t}\n\n\t\treturn __nativeRequire(path_);\n\t};\n\n\t__register = function (path, factory) {\n\t\tvar filename = path_resolveUrl(path);\t\n\t\tmodules[filename] = new Module(filename, factory);\t\t\t\n\t};\n\n\t__require =__originalRequire.bind({ location: path_getDir(path_resolveUrl('%ROOT_DIR%')) });\n\n\tvar modules = {};\n\tvar Module = function(filename, factory){\t\n\t\tthis.filename = filename;\n\t\tthis.dirname = path_getDir(filename);\n\t\tthis.factory = factory;\n\t\tthis.exports = null;\n\t};\n\tModule.prototype.runOnce = function(){\n\t\tif (this.exports != null) {\n\t\t\treturn this.exports;\n\t\t}\n\t\tvar require = __originalRequire.bind({ \n\t\t\tlocation: this.dirname \n\t\t});\n\t\tthis.exports = {};\n\t\tthis.factory(\n\t\t\trequire, \n\t\t\tthis, \n\t\t\tthis.exports, \n\t\t\tthis.filename, \n\t\t\tthis.dirname\n\t\t);\n\t\treturn this.exports;\n\t};\n\t\n\trequire = __require;\n\n\tif (__nativeRequire == null) {\n\t\t__global.require = __require;\n\t}\n}());\n// end:source ./Header.js\n",
4399
4403
  RootModule: "\n// source ./RootModule.js\n(function(){\n\t\n\t%BUNDLE%\n\n}());\n// end:source ./RootModule.js\n",
4400
4404
  UMD: "\n// source ./UMD.js\n(function (factory) {\n\n var _name = '%NAME%',\n _global = typeof window === 'undefined' ? global : window,\n _module = {\n exports: {}\n };\n\n factory(_module, _module.exports, _global);\n\n if (typeof module === 'object' && module.exports) {\n module.exports = _module.exports;\n }\n\n if (typeof define === 'function' && define.amd) {\n define([], function () {\n return _module.exports;\n });\n return;\n }\n \n if (_name) {\n _global[_name] = _module.exports;\n }\n\n}(function (module, exports, global) {\n\n %MODULE%\n\n}));\n\n// end:source ./UMD.js\n",
@@ -9879,38 +9883,66 @@ var Runner;
9879
9883
  // end:source ./templates/ModuleSimplified.js
9880
9884
 
9881
9885
  "use strict";
9882
- var config = require("appcfg");
9886
+ var tslib_1 = _node_modules_tslib_tslib;
9887
+ var appcfg_1 = require("appcfg");
9883
9888
  var Runner_1 = _src_Runner;
9884
9889
  var Config;
9885
9890
  (function (Config) {
9886
9891
  function doLoad(sources) {
9887
- return config
9888
- .fetch(sources)
9889
- .fail(function (error) {
9890
- console.error('Configuration error', error.message);
9891
- process.exit(1);
9892
- })
9893
- .then(function (x) { return x.toJSON(); });
9892
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
9893
+ var config, error_1;
9894
+ return tslib_1.__generator(this, function (_a) {
9895
+ switch (_a.label) {
9896
+ case 0:
9897
+ _a.trys.push([0, 2, , 3]);
9898
+ return [4 /*yield*/, appcfg_1.default.fetch(sources)];
9899
+ case 1:
9900
+ config = _a.sent();
9901
+ return [2 /*return*/, config.toJSON()];
9902
+ case 2:
9903
+ error_1 = _a.sent();
9904
+ console.error('Configuration error', error_1.message);
9905
+ process.exit(1);
9906
+ return [3 /*break*/, 3];
9907
+ case 3: return [2 /*return*/];
9908
+ }
9909
+ });
9910
+ });
9894
9911
  }
9895
9912
  function load() {
9896
- return doLoad([{
9897
- path: 'package.json',
9898
- getterProperty: 'app-bundler',
9899
- optional: true
9900
- }])
9901
- .then(function (json) {
9902
- if (json.config) {
9903
- return doLoad([{ path: json.config }]);
9904
- }
9905
- return json;
9913
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
9914
+ var json;
9915
+ return tslib_1.__generator(this, function (_a) {
9916
+ switch (_a.label) {
9917
+ case 0: return [4 /*yield*/, doLoad([{
9918
+ path: 'package.json',
9919
+ getterProperty: 'app-bundler',
9920
+ optional: true
9921
+ }])];
9922
+ case 1:
9923
+ json = _a.sent();
9924
+ if (!json.config) return [3 /*break*/, 3];
9925
+ return [4 /*yield*/, doLoad([{ path: json.config }])];
9926
+ case 2: return [2 /*return*/, _a.sent()];
9927
+ case 3: return [2 /*return*/, json];
9928
+ }
9929
+ });
9906
9930
  });
9907
9931
  }
9908
9932
  Config.load = load;
9909
9933
  })(Config || (Config = {}));
9910
9934
  module.exports = function run() {
9911
- Config
9912
- .load()
9913
- .then(function (config) { return Runner_1.Runner.run(config); });
9935
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
9936
+ var config;
9937
+ return tslib_1.__generator(this, function (_a) {
9938
+ switch (_a.label) {
9939
+ case 0: return [4 /*yield*/, Config.load()];
9940
+ case 1:
9941
+ config = _a.sent();
9942
+ return [2 /*return*/, Runner_1.Runner.run(config)];
9943
+ }
9944
+ });
9945
+ });
9914
9946
  };
9915
9947
  //# sourceMappingURL=cli.js.map
9916
9948
  //# sourceMappingURL=cli.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "app-bundler",
3
- "version": "0.0.97",
3
+ "version": "0.1.1",
4
4
  "description": "",
5
5
  "main": "lib/bundler.js",
6
6
  "bin": {
@@ -34,7 +34,7 @@
34
34
  "homepage": "https://github.com/atmajs/app-bundler",
35
35
  "dependencies": {
36
36
  "alot": "^0.2.81",
37
- "appcfg": "^0.2.42",
37
+ "appcfg": "^0.4.54",
38
38
  "atma-class": "^1.1.83",
39
39
  "atma-io": "^1.2.16",
40
40
  "atma-loader-ts": "^1.1.12",