@codeleap/cli 3.16.2 → 3.17.0

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 (65) hide show
  1. package/dist/commands/codepushBootstrap.d.ts +0 -0
  2. package/dist/commands/codepushBootstrap.js +0 -0
  3. package/dist/commands/codepushDeploy.d.ts +0 -0
  4. package/dist/commands/codepushDeploy.js +0 -0
  5. package/dist/commands/configure.d.ts +0 -0
  6. package/dist/commands/configure.js +0 -0
  7. package/dist/commands/convertorWebp.d.ts +0 -0
  8. package/dist/commands/convertorWebp.js +2 -10
  9. package/dist/commands/createApp.d.ts +0 -0
  10. package/dist/commands/createApp.js +0 -0
  11. package/dist/commands/createStyleSheets.d.ts +0 -0
  12. package/dist/commands/createStyleSheets.js +0 -0
  13. package/dist/commands/downloadKeystores.d.ts +0 -0
  14. package/dist/commands/downloadKeystores.js +0 -0
  15. package/dist/commands/keystoresAndroid.d.ts +0 -0
  16. package/dist/commands/keystoresAndroid.js +0 -0
  17. package/dist/commands/rename.d.ts +0 -0
  18. package/dist/commands/rename.js +0 -0
  19. package/dist/commands/syncIcons.d.ts +0 -0
  20. package/dist/commands/syncIcons.js +0 -0
  21. package/dist/constants.d.ts +0 -0
  22. package/dist/constants.js +0 -0
  23. package/dist/index.d.ts +0 -0
  24. package/dist/index.js +5 -1
  25. package/dist/lib/Command.d.ts +0 -0
  26. package/dist/lib/Command.js +0 -0
  27. package/dist/lib/alterCliSettings.d.ts +0 -0
  28. package/dist/lib/alterCliSettings.js +0 -0
  29. package/dist/lib/android/index.d.ts +0 -0
  30. package/dist/lib/android/index.js +0 -0
  31. package/dist/lib/android/keystore.d.ts +0 -0
  32. package/dist/lib/android/keystore.js +0 -0
  33. package/dist/lib/android/rename.d.ts +0 -0
  34. package/dist/lib/android/rename.js +0 -0
  35. package/dist/lib/android/utils.d.ts +0 -0
  36. package/dist/lib/android/utils.js +0 -0
  37. package/dist/lib/appcenter.d.ts +0 -0
  38. package/dist/lib/appcenter.js +0 -0
  39. package/dist/lib/createApp/common.d.ts +0 -0
  40. package/dist/lib/createApp/common.js +0 -0
  41. package/dist/lib/createApp/mobile.d.ts +0 -0
  42. package/dist/lib/createApp/mobile.js +0 -0
  43. package/dist/lib/firebase.d.ts +0 -0
  44. package/dist/lib/firebase.js +0 -0
  45. package/dist/lib/getCliSettings.d.ts +0 -0
  46. package/dist/lib/getCliSettings.js +0 -0
  47. package/dist/lib/git.d.ts +0 -0
  48. package/dist/lib/git.js +0 -0
  49. package/dist/lib/index.d.ts +0 -0
  50. package/dist/lib/index.js +4 -0
  51. package/dist/lib/ios/index.d.ts +0 -0
  52. package/dist/lib/ios/index.js +0 -0
  53. package/dist/lib/ios/rename.d.ts +0 -0
  54. package/dist/lib/ios/rename.js +0 -0
  55. package/dist/lib/ios/utils.d.ts +0 -0
  56. package/dist/lib/ios/utils.js +0 -0
  57. package/dist/lib/spinner.d.ts +0 -0
  58. package/dist/lib/spinner.js +0 -0
  59. package/dist/lib/utils.d.ts +0 -0
  60. package/dist/lib/utils.js +78 -3
  61. package/dist/lib/walk.d.ts +0 -0
  62. package/dist/lib/walk.js +0 -0
  63. package/dist/types.d.ts +0 -0
  64. package/dist/types.js +0 -0
  65. package/package.json +1 -1
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -57,7 +57,6 @@ var path_1 = __importDefault(require("path"));
57
57
  var sharp_1 = __importDefault(require("sharp"));
58
58
  var lib_1 = require("../lib");
59
59
  require("../lib/firebase");
60
- var constants_1 = require("../constants");
61
60
  var commandName = 'convertor-webp';
62
61
  exports.convertorWebpCommand = (0, Command_1.codeleapCommand)({
63
62
  name: commandName,
@@ -69,21 +68,14 @@ exports.convertorWebpCommand = (0, Command_1.codeleapCommand)({
69
68
  ],
70
69
  },
71
70
  }, function (argv) { return __awaiter(void 0, void 0, void 0, function () {
72
- var flags, _, settingsPath, settingsJSON, settings, isMultipleConversion, isSingleConversion, filename, answers, files, inputFiles, _loop_1, inputFiles_1, inputFiles_1_1, inputFile, _loop_2, files_1, files_1_1, file, e_1_1;
71
+ var flags, _, settings, isMultipleConversion, isSingleConversion, filename, answers, files, inputFiles, _loop_1, inputFiles_1, inputFiles_1_1, inputFile, _loop_2, files_1, files_1_1, file, e_1_1;
73
72
  var e_2, _a, e_1, _b;
74
73
  var _c, _d, _e, _f, _g;
75
74
  return __generator(this, function (_h) {
76
75
  switch (_h.label) {
77
76
  case 0:
78
77
  flags = argv.flags, _ = argv._;
79
- settingsPath = constants_1.CODELEAP_CLI_SETTINGS_PATH;
80
- if (!fs_1.default.existsSync(settingsPath)) {
81
- console.error('Settings not found, check path:', settingsPath);
82
- process.exit(1);
83
- return [2 /*return*/];
84
- }
85
- settingsJSON = fs_1.default.readFileSync(settingsPath).toString();
86
- settings = JSON.parse(settingsJSON)['convertor-webp'];
78
+ settings = (0, lib_1.getCliSettings)()['convertor-webp'];
87
79
  isMultipleConversion = settings.mode === 'multi';
88
80
  isSingleConversion = settings.mode === 'single';
89
81
  filename = null;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/constants.js CHANGED
File without changes
package/dist/index.d.ts CHANGED
File without changes
package/dist/index.js CHANGED
@@ -9,6 +9,8 @@ var keystoresAndroid_1 = require("./commands/keystoresAndroid");
9
9
  var rename_1 = require("./commands/rename");
10
10
  var syncIcons_1 = require("./commands/syncIcons");
11
11
  var convertorWebp_1 = require("./commands/convertorWebp");
12
+ var codepushBootstrap_1 = require("./commands/codepushBootstrap");
13
+ var codepushDeploy_1 = require("./commands/codepushDeploy");
12
14
  // eslint-disable-next-line @typescript-eslint/no-var-requires
13
15
  var packageJson = require('../package.json');
14
16
  (0, cleye_1.cli)({
@@ -20,7 +22,9 @@ var packageJson = require('../package.json');
20
22
  configure_1.configureCommand,
21
23
  downloadKeystores_1.downloadKeystores,
22
24
  syncIcons_1.syncIconsCommand,
23
- convertorWebp_1.convertorWebpCommand
25
+ convertorWebp_1.convertorWebpCommand,
26
+ codepushDeploy_1.codepushDeploy,
27
+ codepushBootstrap_1.codepushBootstrap,
24
28
  ],
25
29
  version: packageJson.version,
26
30
  });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/lib/git.d.ts CHANGED
File without changes
package/dist/lib/git.js CHANGED
File without changes
File without changes
package/dist/lib/index.js CHANGED
@@ -36,6 +36,10 @@ exports.octokit = new octokit_1.Octokit({
36
36
  __exportStar(require("./utils"), exports);
37
37
  __exportStar(require("./walk"), exports);
38
38
  __exportStar(require("./android"), exports);
39
+ __exportStar(require("./getCliSettings"), exports);
40
+ __exportStar(require("./git"), exports);
41
+ __exportStar(require("./alterCliSettings"), exports);
42
+ __exportStar(require("./appcenter"), exports);
39
43
  __exportStar(require("./ios"), exports);
40
44
  var mobile_1 = require("./createApp/mobile");
41
45
  Object.defineProperty(exports, "createMobileApp", { enumerable: true, get: function () { return mobile_1.createMobileApp; } });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/lib/utils.js CHANGED
@@ -1,10 +1,47 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
2
38
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
40
  };
5
41
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.parseFilePathData = exports.findExecutable = exports.path = exports.fs = exports.listPrompt = exports.subprocess = exports.getNewBundleName = void 0;
42
+ exports.waitFor = exports.formatError = exports.parseFilePathData = exports.findExecutable = exports.path = exports.fs = exports.listPrompt = exports.subprocess = exports.getNewBundleName = void 0;
7
43
  var child_process_1 = __importDefault(require("child_process"));
44
+ var axios_1 = require("axios");
8
45
  var getNewBundleName = function (newName) { return "uk.co.codeleap.".concat(newName.trim()); };
9
46
  exports.getNewBundleName = getNewBundleName;
10
47
  function subprocess(name) {
@@ -14,8 +51,14 @@ function subprocess(name) {
14
51
  }
15
52
  return new Promise(function (resolve, reject) {
16
53
  var _a, _b, _c, _d;
54
+ var stdout = [];
55
+ var stderr = [];
17
56
  console.log("Running ".concat(params[0], " ").concat(params[1].join(' ')));
18
- var child = child_process_1.default.spawn(params[0], params[1].map(function (x) { return JSON.stringify(x); }), params[2]);
57
+ var child = child_process_1.default.spawn(params[0], params[1].map(function (x) {
58
+ if (typeof x === 'string')
59
+ return x;
60
+ return JSON.stringify(x);
61
+ }), params[2]);
19
62
  child.on('error', function (err) {
20
63
  console.log("".concat(name, " finished with error: "), err.toString());
21
64
  reject(err);
@@ -26,14 +69,19 @@ function subprocess(name) {
26
69
  reject("".concat(name, " finieshed with non zero exit code"));
27
70
  }
28
71
  else {
29
- resolve(code);
72
+ resolve({
73
+ stdout: stdout,
74
+ stderr: stderr,
75
+ });
30
76
  }
31
77
  });
32
78
  (_b = (_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on) === null || _b === void 0 ? void 0 : _b.call(_a, 'data', function (outdata) {
33
79
  console.log(outdata.toString());
80
+ stdout.push(outdata.toString());
34
81
  });
35
82
  (_d = (_c = child.stderr) === null || _c === void 0 ? void 0 : _c.on) === null || _d === void 0 ? void 0 : _d.call(_c, 'data', function (errdata) {
36
83
  console.error(errdata.toString());
84
+ stderr.push(errdata.toString());
37
85
  });
38
86
  });
39
87
  }
@@ -76,3 +124,30 @@ function parseFilePathData(path) {
76
124
  };
77
125
  }
78
126
  exports.parseFilePathData = parseFilePathData;
127
+ function formatError(err) {
128
+ var _a, _b, _c, _d, _e;
129
+ var content = [];
130
+ if ((0, axios_1.isAxiosError)(err)) {
131
+ var fullUrl = (_b = (_a = err.request) === null || _a === void 0 ? void 0 : _a.res) === null || _b === void 0 ? void 0 : _b.responseUrl;
132
+ var message = "Request to ".concat(fullUrl, " failed with status ").concat((_c = err.response) === null || _c === void 0 ? void 0 : _c.status);
133
+ if (!!((_d = err === null || err === void 0 ? void 0 : err.response) === null || _d === void 0 ? void 0 : _d.data)) {
134
+ content = [message, (_e = err.response) === null || _e === void 0 ? void 0 : _e.data];
135
+ }
136
+ }
137
+ else {
138
+ content = [err];
139
+ }
140
+ return content;
141
+ }
142
+ exports.formatError = formatError;
143
+ function waitFor(ms) {
144
+ if (ms === void 0) { ms = 1000; }
145
+ return __awaiter(this, void 0, void 0, function () {
146
+ return __generator(this, function (_a) {
147
+ return [2 /*return*/, new Promise(function (resolve) {
148
+ setTimeout(resolve, ms);
149
+ })];
150
+ });
151
+ });
152
+ }
153
+ exports.waitFor = waitFor;
File without changes
package/dist/lib/walk.js CHANGED
File without changes
package/dist/types.d.ts CHANGED
File without changes
package/dist/types.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeleap/cli",
3
- "version": "3.16.2",
3
+ "version": "3.17.0",
4
4
  "main": "./dist/index.js",
5
5
  "repository": "git@github.com:codeleap-uk/codeleap-lib.git",
6
6
  "author": "Paulo Henrique De Souza <paulosouza300272@gmail.com>",