app-bundler 0.1.0 → 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.
Files changed (3) hide show
  1. package/index.js +4 -2
  2. package/lib/cli.js +49 -21
  3. package/package.json +1 -1
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/cli.js CHANGED
@@ -9883,38 +9883,66 @@ var Runner;
9883
9883
  // end:source ./templates/ModuleSimplified.js
9884
9884
 
9885
9885
  "use strict";
9886
- var config = require("appcfg");
9886
+ var tslib_1 = _node_modules_tslib_tslib;
9887
+ var appcfg_1 = require("appcfg");
9887
9888
  var Runner_1 = _src_Runner;
9888
9889
  var Config;
9889
9890
  (function (Config) {
9890
9891
  function doLoad(sources) {
9891
- return config
9892
- .fetch(sources)
9893
- .fail(function (error) {
9894
- console.error('Configuration error', error.message);
9895
- process.exit(1);
9896
- })
9897
- .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
+ });
9898
9911
  }
9899
9912
  function load() {
9900
- return doLoad([{
9901
- path: 'package.json',
9902
- getterProperty: 'app-bundler',
9903
- optional: true
9904
- }])
9905
- .then(function (json) {
9906
- if (json.config) {
9907
- return doLoad([{ path: json.config }]);
9908
- }
9909
- 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
+ });
9910
9930
  });
9911
9931
  }
9912
9932
  Config.load = load;
9913
9933
  })(Config || (Config = {}));
9914
9934
  module.exports = function run() {
9915
- Config
9916
- .load()
9917
- .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
+ });
9918
9946
  };
9919
9947
  //# sourceMappingURL=cli.js.map
9920
9948
  //# sourceMappingURL=cli.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "app-bundler",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "",
5
5
  "main": "lib/bundler.js",
6
6
  "bin": {