@24i/smartapps-bigscreen-rnv-build-engine 0.0.2-alpha.1328 → 0.0.2-alpha.1332

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 (98) hide show
  1. package/dist/src/constants/buildSchemes.js +3 -3
  2. package/dist/src/constants/index.js +5 -10
  3. package/dist/src/constants/platforms.js +11 -0
  4. package/dist/src/index.js +29 -31
  5. package/dist/src/resolvers/index.js +19 -12
  6. package/dist/src/resolvers/resolveBaseUrl.js +15 -16
  7. package/dist/src/resolvers/resolveBuildVersion.js +17 -19
  8. package/dist/src/resolvers/resolveBuildVersionOffset.js +35 -0
  9. package/dist/src/resolvers/resolveDeployLocations.js +70 -0
  10. package/dist/src/{utils/getBaseConfig.js → resolvers/resolveGenericRnvConfig.js} +18 -30
  11. package/dist/src/resolvers/resolveHbbtvDeployConfig.js +13 -0
  12. package/dist/src/resolvers/resolveHbbtvDeployUrl.js +11 -0
  13. package/dist/src/resolvers/resolveHbbtvRemoteBuildDirRelativePath.js +27 -0
  14. package/dist/src/resolvers/resolveZippedPlatformBuildsRelativeFilePath.js +15 -0
  15. package/dist/src/scripts/buildAllWithScheme.js +14 -14
  16. package/dist/src/scripts/gitReleaser/afterVersionBump.js +10 -10
  17. package/dist/src/scripts/gitReleaser/beforeVersionBump.js +7 -7
  18. package/dist/src/scripts/gitReleaser/checkReleaseNotes.js +9 -9
  19. package/dist/src/scripts/gitReleaser/pushRelease.js +17 -17
  20. package/dist/src/scripts/gitReleaser/pushReleaseCandidate.js +4 -4
  21. package/dist/src/scripts/gitReleaser/pushReleaseNotes.js +16 -16
  22. package/dist/src/scripts/release/deleteSourceMaps.js +6 -6
  23. package/dist/src/scripts/release/deployToAppCenter.js +37 -38
  24. package/dist/src/scripts/release/githubRelease.js +60 -64
  25. package/dist/src/scripts/release/notifySlack/makePayload.js +44 -48
  26. package/dist/src/scripts/release/notifySlack/notifySlack.js +10 -10
  27. package/dist/src/scripts/release/notifySlack/slackBlockKitBuilder.js +25 -28
  28. package/dist/src/scripts/release/sentryRelease.js +34 -33
  29. package/dist/src/scripts/release/urlsMarkdown.js +29 -30
  30. package/dist/src/scripts/releaseAllWithScheme.js +27 -28
  31. package/dist/src/scripts/utils/cmdUtils.js +9 -9
  32. package/dist/src/scripts/utils/fsUtils.js +7 -7
  33. package/dist/src/scripts/utils/gitUtils.js +50 -50
  34. package/dist/src/scripts/utils/index.js +8 -8
  35. package/dist/src/scripts/utils/stringUtils.js +2 -5
  36. package/dist/src/sdks/index.js +15 -54
  37. package/dist/src/sdks/sdk-tizen/index.js +154 -254
  38. package/dist/src/sdks/sdk-webos/index.js +136 -231
  39. package/dist/src/sdks/sdk-webpack/index.js +20 -69
  40. package/dist/src/sdks/sdkUtils.js +14 -59
  41. package/dist/src/tasks/deploy/aswS3/aws.js +9 -9
  42. package/dist/src/tasks/deploy/aswS3/deployS3.js +44 -82
  43. package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +70 -174
  44. package/dist/src/tasks/engineTasks.js +10 -10
  45. package/dist/src/tasks/task.rnv.build.js +77 -134
  46. package/dist/src/tasks/task.rnv.configure.js +39 -88
  47. package/dist/src/tasks/task.rnv.configureSoft.js +22 -75
  48. package/dist/src/tasks/task.rnv.deploy.js +28 -78
  49. package/dist/src/tasks/task.rnv.hooks.run.js +42 -92
  50. package/dist/src/tasks/task.rnv.package.js +18 -61
  51. package/dist/src/tasks/task.rnv.project.configure.js +80 -183
  52. package/dist/src/tasks/task.rnv.start.js +42 -87
  53. package/dist/src/types/c.js +1 -1
  54. package/dist/src/types/index.js +1 -1
  55. package/dist/src/utils/forEachSupportedPlatformFlavour.js +12 -12
  56. package/dist/src/utils/replaceRelevantStringsInConfig/index.js +2 -9
  57. package/dist/src/utils/replaceRelevantStringsInConfig/replaceRelevantStringsInConfig.js +10 -11
  58. package/dist/src/utils/replaceRelevantStringsInConfig/replaceTemplateString.js +24 -30
  59. package/dist/src/utils/zipBuildsByPlatforms.js +28 -39
  60. package/dist/templates/platforms/_shared/template.js +58 -42
  61. package/dist/templates/platforms/_shared/webpack.base.js +119 -139
  62. package/dist/templates/platforms/entone/webpack.config.dev.js +27 -22
  63. package/dist/templates/platforms/entone/webpack.config.prod.js +21 -20
  64. package/dist/templates/platforms/hbbtv/webpack.config.dev.js +42 -24
  65. package/dist/templates/platforms/hbbtv/webpack.config.prod.js +36 -22
  66. package/dist/templates/platforms/tizen/webpack.config.dev.js +28 -22
  67. package/dist/templates/platforms/tizen/webpack.config.prod.js +21 -20
  68. package/dist/templates/platforms/webos/webpack.config.dev.js +31 -24
  69. package/dist/templates/platforms/webos/webpack.config.prod.js +23 -22
  70. package/dist/templates/platforms/webtv/webpack.config.dev.js +27 -22
  71. package/dist/templates/platforms/webtv/webpack.config.prod.js +21 -20
  72. package/dist/types/src/constants/index.d.ts +1 -0
  73. package/dist/types/src/constants/platforms.d.ts +8 -0
  74. package/dist/types/src/resolvers/index.d.ts +8 -1
  75. package/dist/types/src/resolvers/resolveBuildVersionOffset.d.ts +3 -0
  76. package/dist/types/src/resolvers/resolveDeployLocations.d.ts +9 -0
  77. package/dist/types/src/resolvers/resolveGenericRnvConfig.d.ts +4 -0
  78. package/dist/types/src/resolvers/resolveHbbtvDeployConfig.d.ts +10 -0
  79. package/dist/types/src/resolvers/resolveHbbtvDeployUrl.d.ts +3 -0
  80. package/dist/types/src/resolvers/resolveHbbtvRemoteBuildDirRelativePath.d.ts +3 -0
  81. package/dist/types/src/resolvers/resolveZippedPlatformBuildsRelativeFilePath.d.ts +3 -0
  82. package/dist/types/src/scripts/release/notifySlack/makePayload.d.ts +9 -3
  83. package/dist/types/src/tasks/deploy/hbbtv/deployHbbtv.d.ts +0 -1
  84. package/dist/types/src/tasks/task.rnv.build.d.ts +1 -2
  85. package/dist/types/src/tasks/task.rnv.configure.d.ts +1 -2
  86. package/dist/types/src/tasks/task.rnv.deploy.d.ts +1 -2
  87. package/dist/types/src/tasks/task.rnv.package.d.ts +1 -2
  88. package/dist/types/src/tasks/task.rnv.start.d.ts +1 -2
  89. package/dist/types/src/types/c.d.ts +278 -8
  90. package/dist/types/src/utils/zipBuildsByPlatforms.d.ts +0 -1
  91. package/package.json +3 -3
  92. package/dist/src/enginePlatforms.js +0 -15
  93. package/dist/src/utils/getDeployLocations.js +0 -80
  94. package/dist/src/utils/getVersionOffset.js +0 -35
  95. package/dist/types/src/enginePlatforms.d.ts +0 -8
  96. package/dist/types/src/utils/getBaseConfig.d.ts +0 -2
  97. package/dist/types/src/utils/getDeployLocations.d.ts +0 -7
  98. package/dist/types/src/utils/getVersionOffset.d.ts +0 -1
@@ -18,12 +18,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
18
18
  __setModuleDefault(result, mod);
19
19
  return result;
20
20
  };
21
- exports.__esModule = true;
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.notifySlack = void 0;
23
- var child_process_1 = require("child_process");
24
- var payload = __importStar(require("./makePayload"));
25
- var getPayload = function (c) {
26
- var releaseType = c.runtime.scheme;
23
+ const child_process_1 = require("child_process");
24
+ const payload = __importStar(require("./makePayload"));
25
+ const getPayload = (c) => {
26
+ const releaseType = c.runtime.scheme;
27
27
  switch (releaseType) {
28
28
  case 'dev:latest': return payload.makeDevelopmentPayload(c);
29
29
  case 'rc:latest': return payload.makeReleaseCandidatePayload(c);
@@ -31,12 +31,12 @@ var getPayload = function (c) {
31
31
  default: throw new Error('Notify Slack: unsupported or undefined release type! Did you pass it as an argument?');
32
32
  }
33
33
  };
34
- var notifySlack = function (c) {
34
+ const notifySlack = (c) => {
35
35
  var _a, _b, _c, _d;
36
- var contentType = '"Content-type: application/json"';
37
- var data = "--data '" + JSON.stringify(getPayload(c)) + "'";
38
- var webHookUrl = ((_d = (_c = (_b = (_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.deploy) === null || _c === void 0 ? void 0 : _c.slack) === null || _d === void 0 ? void 0 : _d.webhookUrl) || '';
39
- var cmd = "curl -X POST -H " + contentType + " " + data + " " + webHookUrl;
36
+ const contentType = '"Content-type: application/json"';
37
+ const data = `--data '${JSON.stringify(getPayload(c))}'`;
38
+ const webHookUrl = ((_d = (_c = (_b = (_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.deploy) === null || _c === void 0 ? void 0 : _c.slack) === null || _d === void 0 ? void 0 : _d.webhookUrl) || '';
39
+ const cmd = `curl -X POST -H ${contentType} ${data} ${webHookUrl}`;
40
40
  child_process_1.execSync(cmd, { stdio: 'inherit' });
41
41
  };
42
42
  exports.notifySlack = notifySlack;
@@ -1,42 +1,39 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Context = exports.Divider = exports.Actions = exports.Section = void 0;
4
- var mrkdwn = function (text) { return ({ type: 'mrkdwn', text: text }); };
5
- var plainText = function (text) { return ({
4
+ const mrkdwn = (text) => ({ type: 'mrkdwn', text });
5
+ const plainText = (text) => ({
6
6
  type: 'plain_text',
7
- text: text,
8
- emoji: true
9
- }); };
10
- var buttonWithUrl = function (_a) {
11
- var text = _a.text, url = _a.url;
12
- return ({
13
- type: 'button',
14
- text: plainText(text),
15
- url: url
16
- });
17
- };
18
- var Section = {
19
- mrkdwn: function (text) { return ({
7
+ text,
8
+ emoji: true,
9
+ });
10
+ const buttonWithUrl = ({ text, url }) => ({
11
+ type: 'button',
12
+ text: plainText(text),
13
+ url,
14
+ });
15
+ const Section = {
16
+ mrkdwn: (text) => ({
20
17
  type: 'section',
21
- text: mrkdwn(text)
22
- }); }
18
+ text: mrkdwn(text),
19
+ }),
23
20
  };
24
21
  exports.Section = Section;
25
- var Actions = {
26
- buttons: function (btnsData) { return ({
22
+ const Actions = {
23
+ buttons: (btnsData) => ({
27
24
  type: 'actions',
28
- elements: btnsData.map(buttonWithUrl)
29
- }); }
25
+ elements: btnsData.map(buttonWithUrl),
26
+ }),
30
27
  };
31
28
  exports.Actions = Actions;
32
- var Divider = {
33
- plain: function () { return ({ type: 'divider' }); }
29
+ const Divider = {
30
+ plain: () => ({ type: 'divider' }),
34
31
  };
35
32
  exports.Divider = Divider;
36
- var Context = {
37
- mrkdwns: function (texts) { return ({
33
+ const Context = {
34
+ mrkdwns: (texts) => ({
38
35
  type: 'context',
39
- elements: texts.map(mrkdwn)
40
- }); }
36
+ elements: texts.map(mrkdwn),
37
+ }),
41
38
  };
42
39
  exports.Context = Context;
@@ -2,67 +2,68 @@
2
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
- exports.__esModule = true;
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.sentryRelease = void 0;
7
- var child_process_1 = require("child_process");
8
- var fs_1 = __importDefault(require("fs"));
9
- var UNSUPPORTED_PLATFORMS = ['webtv'];
10
- var executeSync = function (cmd) { return child_process_1.execSync(cmd, { stdio: 'inherit' }); };
11
- var createNewRelease = function (version) {
12
- executeSync("sentry-cli releases new " + version);
7
+ const child_process_1 = require("child_process");
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const constants_1 = require("../../constants");
10
+ const UNSUPPORTED_PLATFORMS = [constants_1.Platforms.WEBTV];
11
+ const executeSync = (cmd) => child_process_1.execSync(cmd, { stdio: 'inherit' });
12
+ const createNewRelease = (version) => {
13
+ executeSync(`sentry-cli releases new ${version}`);
13
14
  };
14
- var uploadSourceMaps = function (params) {
15
- var version = params.version, sourceMapsPath = params.sourceMapsPath, urlPrefix = params.urlPrefix;
15
+ const uploadSourceMaps = (params) => {
16
+ const { version, sourceMapsPath, urlPrefix } = params;
16
17
  executeSync('sentry-cli releases '
17
- + ("files " + version + " ")
18
- + ("upload-sourcemaps " + sourceMapsPath + " ")
19
- + ("--url-prefix \"~/" + urlPrefix + "\" ")
18
+ + `files ${version} `
19
+ + `upload-sourcemaps ${sourceMapsPath} `
20
+ + `--url-prefix "~/${urlPrefix}" `
20
21
  + '--rewrite --validate');
21
22
  };
22
- var setReleaseCommits = function (version) {
23
+ const setReleaseCommits = (version) => {
23
24
  try {
24
- executeSync("sentry-cli releases set-commits " + version + " --auto --log-level=debug");
25
+ executeSync(`sentry-cli releases set-commits ${version} --auto --log-level=debug`);
25
26
  }
26
27
  catch (error) {
27
28
  console.log('Sentry release commits failed: ', error);
28
29
  }
29
30
  };
30
- var finalizeRelease = function (version) {
31
- executeSync("sentry-cli releases finalize " + version);
31
+ const finalizeRelease = (version) => {
32
+ executeSync(`sentry-cli releases finalize ${version}`);
32
33
  };
33
- var processPlatform = function (c, platform, version) {
34
+ const processPlatform = (c, platform, version) => {
34
35
  var _a;
35
- var processFlavour = function (flavour) {
36
- var platformBuildsDir = c.buildConfig.paths.platformBuildsDir;
37
- var mapsPath = platformBuildsDir + "/" + flavour + "_" + platform + "-public/public/content/js";
38
- var urlPrefix = "builds/" + platform + "/" + flavour + "/dist/" + version + "/public/content/js/";
39
- if (!fs_1["default"].existsSync(mapsPath))
36
+ const processFlavour = (flavour) => {
37
+ const { platformBuildsDir } = c.buildConfig.paths;
38
+ const mapsPath = `${platformBuildsDir}/${flavour}_${platform}-public/public/content/js`;
39
+ const urlPrefix = `builds/${platform}/${flavour}/dist/${version}/public/content/js/`;
40
+ if (!fs_1.default.existsSync(mapsPath))
40
41
  return;
41
- console.log("Uploading " + flavour + "_" + platform + " sourcemaps to Sentry...");
42
- uploadSourceMaps({ version: version, sourceMapsPath: mapsPath, urlPrefix: urlPrefix });
42
+ console.log(`Uploading ${flavour}_${platform} sourcemaps to Sentry...`);
43
+ uploadSourceMaps({ version, sourceMapsPath: mapsPath, urlPrefix });
43
44
  };
44
- var _b = (((_a = c.buildConfig.platforms[platform]) === null || _a === void 0 ? void 0 : _a.deploy) || {}).supportedFlavours, supportedFlavours = _b === void 0 ? [] : _b;
45
+ const { supportedFlavours = [] } = ((_a = c.buildConfig.platforms[platform]) === null || _a === void 0 ? void 0 : _a.deploy) || {};
45
46
  supportedFlavours.forEach(processFlavour);
46
47
  };
47
- var isSentryProjectConfigured = function () {
48
+ const isSentryProjectConfigured = () => {
48
49
  var _a;
49
- var cmd = child_process_1.execSync('sentry-cli info --config-status-json');
50
- var sentryConfig = JSON.parse(cmd.toString()) || {};
50
+ const cmd = child_process_1.execSync('sentry-cli info --config-status-json');
51
+ const sentryConfig = JSON.parse(cmd.toString()) || {};
51
52
  return !!((_a = sentryConfig.config) === null || _a === void 0 ? void 0 : _a.project);
52
53
  };
53
- var sentryRelease = function (c) {
54
+ const sentryRelease = (c) => {
54
55
  var _a;
55
56
  if (!isSentryProjectConfigured()) {
56
57
  console.log('Project is not defined...');
57
58
  return;
58
59
  }
59
- var version = "v" + ((_a = c.buildConfig.common) === null || _a === void 0 ? void 0 : _a.packageVersion);
60
+ const version = `v${(_a = c.buildConfig.common) === null || _a === void 0 ? void 0 : _a.packageVersion}`;
60
61
  if (!version)
61
62
  return;
62
- var _b = (c.buildConfig.defaults || {}).supportedPlatforms, supportedPlatforms = _b === void 0 ? [] : _b;
63
- var supportedPlatformsBySentry = supportedPlatforms.filter(function (platform) { return !UNSUPPORTED_PLATFORMS.includes(platform); });
63
+ const { supportedPlatforms = [] } = c.buildConfig.defaults || {};
64
+ const supportedPlatformsBySentry = supportedPlatforms.filter((platform) => !UNSUPPORTED_PLATFORMS.includes(platform));
64
65
  createNewRelease(version);
65
- supportedPlatformsBySentry.forEach(function (platform) { return processPlatform(c, platform, version); });
66
+ supportedPlatformsBySentry.forEach((platform) => processPlatform(c, platform, version));
66
67
  setReleaseCommits(version);
67
68
  finalizeRelease(version);
68
69
  console.log('Source Maps uploaded...');
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getUrlsMarkdown = void 0;
4
- var getDeployLocations_1 = require("../../utils/getDeployLocations");
5
- var newLine = '\r\n';
6
- var getDataToProceed = function (c, customPlatformList) {
7
- if (customPlatformList === void 0) { customPlatformList = []; }
8
- var locations = getDeployLocations_1.getDeployLocations(c);
9
- var versions = locations.versions;
10
- var platforms = versions[Object.keys(versions)[0]].platforms;
4
+ const constants_1 = require("../../constants");
5
+ const resolvers_1 = require("../../resolvers");
6
+ const newLine = '\r\n';
7
+ const getDataToProceed = (c, customPlatformList = []) => {
8
+ const locations = resolvers_1.resolveDeployLocations(c);
9
+ const { versions } = locations;
10
+ const { platforms } = versions[Object.keys(versions)[0]];
11
11
  if (!customPlatformList.length)
12
12
  return platforms;
13
- var outputData = {};
14
- var addToOutputIfPlatformHasData = function (platformName) {
15
- var platformData = platforms[platformName];
13
+ const outputData = {};
14
+ const addToOutputIfPlatformHasData = (platformName) => {
15
+ const platformData = platforms[platformName];
16
16
  if (platformData) {
17
17
  outputData[platformName] = platformData;
18
18
  }
@@ -20,38 +20,37 @@ var getDataToProceed = function (c, customPlatformList) {
20
20
  customPlatformList.forEach(addToOutputIfPlatformHasData);
21
21
  return outputData;
22
22
  };
23
- var beautifyPlatformName = function (platformName) {
23
+ const beautifyPlatformName = (platformName) => {
24
24
  switch (platformName.toLowerCase()) {
25
- case 'entone': return 'Entone';
26
- case 'hbbtv': return 'HbbTV';
27
- case 'tizen': return 'Tizen (Samsung)';
28
- case 'webos': return 'webOS (LG)';
29
- case 'webtv': return 'WebTV';
25
+ case constants_1.Platforms.ENTONE: return 'Entone';
26
+ case constants_1.Platforms.HBBTV: return 'HbbTV';
27
+ case constants_1.Platforms.TIZEN: return 'Tizen (Samsung)';
28
+ case constants_1.Platforms.WEBOS: return 'webOS (LG)';
29
+ case constants_1.Platforms.WEBTV: return 'WebTV';
30
30
  default: return platformName;
31
31
  }
32
32
  };
33
- var getPlatformOutput = function (data, platformName) {
34
- if (platformName === 'tizen' || platformName === 'webos') {
33
+ const getPlatformOutput = (data, platformName) => {
34
+ if (platformName === constants_1.Platforms.TIZEN || platformName === constants_1.Platforms.WEBOS) {
35
35
  return '';
36
36
  }
37
- var platformData = data[platformName];
38
- var output = "**" + beautifyPlatformName(platformName) + "**" + newLine;
39
- var processPlatformEntry = function (_a) {
40
- var flavour = _a[0], flavourData = _a[1];
41
- var indexUrl = flavourData.indexUrl;
42
- output += "* [" + flavour + "](" + indexUrl + ")" + newLine;
37
+ const platformData = data[platformName];
38
+ let output = `**${beautifyPlatformName(platformName)}**${newLine}`;
39
+ const processPlatformEntry = ([flavour, flavourData]) => {
40
+ const { indexUrl } = flavourData;
41
+ output += `* [${flavour}](${indexUrl})${newLine}`;
43
42
  };
44
43
  Object.entries(platformData).forEach(processPlatformEntry);
45
44
  return output;
46
45
  };
47
- var getUrlsMarkdown = function (c, customPlatformList) {
48
- var dataToProceed = getDataToProceed(c, customPlatformList);
49
- var markdownWithoutHeader = Object.keys(dataToProceed)
50
- .map(function (platformName) { return getPlatformOutput(dataToProceed, platformName); })
46
+ const getUrlsMarkdown = (c, customPlatformList) => {
47
+ const dataToProceed = getDataToProceed(c, customPlatformList);
48
+ const markdownWithoutHeader = Object.keys(dataToProceed)
49
+ .map((platformName) => getPlatformOutput(dataToProceed, platformName))
51
50
  .filter(Boolean)
52
51
  .join(newLine);
53
52
  if (markdownWithoutHeader.length) {
54
- var urlHeader = newLine + "## URL" + newLine;
53
+ const urlHeader = `${newLine}## URL${newLine}`;
55
54
  return urlHeader + markdownWithoutHeader;
56
55
  }
57
56
  return '';
@@ -1,40 +1,39 @@
1
1
  "use strict";
2
- exports.__esModule = true;
3
- var child_process_1 = require("child_process");
4
- var forEachSupportedPlatformFlavour_1 = require("../utils/forEachSupportedPlatformFlavour");
5
- var getBaseConfig_1 = require("../utils/getBaseConfig");
6
- var getDeployLocations_1 = require("../utils/getDeployLocations");
7
- var zipBuildsByPlatforms_1 = require("../utils/zipBuildsByPlatforms");
8
- var deleteSourceMaps_1 = require("./release/deleteSourceMaps");
9
- var deployToAppCenter_1 = require("./release/deployToAppCenter");
10
- var githubRelease_1 = require("./release/githubRelease");
11
- var notifySlack_1 = require("./release/notifySlack/notifySlack");
12
- var sentryRelease_1 = require("./release/sentryRelease");
13
- var deployTask = function (options) {
14
- var scheme = options.scheme, platform = options.platform, flavour = options.flavour;
15
- var cmd = "npx rnv deploy -s " + scheme + " -p " + platform + " -c " + flavour + " --ci --only";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const child_process_1 = require("child_process");
4
+ const forEachSupportedPlatformFlavour_1 = require("../utils/forEachSupportedPlatformFlavour");
5
+ const resolvers_1 = require("../resolvers");
6
+ const zipBuildsByPlatforms_1 = require("../utils/zipBuildsByPlatforms");
7
+ const deleteSourceMaps_1 = require("./release/deleteSourceMaps");
8
+ const deployToAppCenter_1 = require("./release/deployToAppCenter");
9
+ const githubRelease_1 = require("./release/githubRelease");
10
+ const notifySlack_1 = require("./release/notifySlack/notifySlack");
11
+ const sentryRelease_1 = require("./release/sentryRelease");
12
+ const deployTask = (options) => {
13
+ const { scheme, platform, flavour } = options;
14
+ const cmd = `npx rnv deploy -s ${scheme} -p ${platform} -c ${flavour} --ci --only`;
16
15
  child_process_1.execSync(cmd, { stdio: 'inherit' });
17
16
  };
18
- var deployBuilds = function (c) {
17
+ const deployBuilds = (c) => {
19
18
  console.log('Deploying the builds...');
20
19
  forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour(c, deployTask);
21
20
  return true;
22
21
  };
23
- var doLatestDevelopmentRelease = function (c) {
22
+ const doLatestDevelopmentRelease = (c) => {
24
23
  console.log('doLatestDevelopmentRelease');
25
24
  return deployBuilds(c);
26
25
  };
27
- var doLatestReleaseCandidateRelease = function (c) {
26
+ const doLatestReleaseCandidateRelease = (c) => {
28
27
  console.log('doLatestReleaseCandidateRelease');
29
28
  deployBuilds(c);
30
29
  notifySlack_1.notifySlack(c);
31
30
  return true;
32
31
  };
33
- var doLatestRelease = function (c) {
32
+ const doLatestRelease = (c) => {
34
33
  console.log('doLatestRelease');
35
34
  return deployBuilds(c);
36
35
  };
37
- var doDistributionRelease = function (c) {
36
+ const doDistributionRelease = (c) => {
38
37
  console.log('doDistributionRelease');
39
38
  zipBuildsByPlatforms_1.zipBuildsByPlatforms(c);
40
39
  deployBuilds(c);
@@ -45,12 +44,12 @@ var doDistributionRelease = function (c) {
45
44
  notifySlack_1.notifySlack(c);
46
45
  return true;
47
46
  };
48
- var releaseAllWithScheme = function () {
49
- var scheme = process.argv[2];
47
+ const releaseAllWithScheme = () => {
48
+ const scheme = process.argv[2];
50
49
  if (!scheme) {
51
50
  throw new Error('No scheme name to use found! Please use rnv scheme name as a param.');
52
51
  }
53
- var c = getBaseConfig_1.getBaseConfig();
52
+ const c = resolvers_1.getBaseConfig();
54
53
  c.runtime.scheme = scheme;
55
54
  switch (scheme) {
56
55
  case 'dev:latest':
@@ -68,12 +67,12 @@ var releaseAllWithScheme = function () {
68
67
  default:
69
68
  throw new Error('Unsupported scheme to release!');
70
69
  }
71
- var spacing = 4;
72
- console.log(JSON.stringify(getDeployLocations_1.getDeployLocations(c), null, spacing));
70
+ const spacing = 4;
71
+ console.log(JSON.stringify(resolvers_1.resolveDeployLocations(c), null, spacing));
73
72
  return true;
74
73
  };
75
- var startTimestamp = Date.now();
74
+ const startTimestamp = Date.now();
76
75
  releaseAllWithScheme();
77
- var msPerSecond = 1000;
78
- var scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
79
- console.log("buildAllWithScheme: done in " + scriptTotalTimeInSeconds + " second(s)!");
76
+ const msPerSecond = 1000;
77
+ const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
78
+ console.log(`buildAllWithScheme: done in ${scriptTotalTimeInSeconds} second(s)!`);
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- var execSync = require('child_process').execSync;
3
- var cmdSync = function (command, options) { return execSync(command, options); };
4
- var cmdSyncInheritOut = function (command) { return cmdSync(command, { stdio: 'inherit' }); };
5
- var cmdSyncPipeOut = function (command) { return cmdSync(command, { stdio: 'pipe' }); };
6
- var cmdSyncTrimOut = function (command) { return cmdSync(command).toString().trim(); };
2
+ const { execSync } = require('child_process');
3
+ const cmdSync = (command, options) => execSync(command, options);
4
+ const cmdSyncInheritOut = (command) => cmdSync(command, { stdio: 'inherit' });
5
+ const cmdSyncPipeOut = (command) => cmdSync(command, { stdio: 'pipe' });
6
+ const cmdSyncTrimOut = (command) => cmdSync(command).toString().trim();
7
7
  module.exports = {
8
- cmdSync: cmdSync,
9
- cmdSyncInheritOut: cmdSyncInheritOut,
10
- cmdSyncPipeOut: cmdSyncPipeOut,
11
- cmdSyncTrimOut: cmdSyncTrimOut
8
+ cmdSync,
9
+ cmdSyncInheritOut,
10
+ cmdSyncPipeOut,
11
+ cmdSyncTrimOut,
12
12
  };
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- var fs = require('fs');
3
- var ok = require('assert').strict.ok;
4
- var getFileContentAsString = function (filePath) { return fs.readFileSync(filePath).toString(); };
5
- var assertPath = function (path) {
6
- var errorMsg = "File or path " + path + " does not exist!";
2
+ const fs = require('fs');
3
+ const { ok } = require('assert').strict;
4
+ const getFileContentAsString = (filePath) => fs.readFileSync(filePath).toString();
5
+ const assertPath = (path) => {
6
+ const errorMsg = `File or path ${path} does not exist!`;
7
7
  ok(fs.existsSync(path), errorMsg);
8
8
  };
9
9
  module.exports = {
10
- getFileContentAsString: getFileContentAsString,
11
- assertPath: assertPath
10
+ getFileContentAsString,
11
+ assertPath,
12
12
  };
@@ -1,78 +1,78 @@
1
1
  "use strict";
2
- var ok = require('assert').strict.ok;
3
- var _a = require('./cmdUtils'), cmdSyncTrimOut = _a.cmdSyncTrimOut, cmdSyncInheritOut = _a.cmdSyncInheritOut, cmdSyncPipeOut = _a.cmdSyncPipeOut;
4
- var splitByNewLine = require('./stringUtils').splitByNewLine;
5
- var statusList = function () {
6
- var gitCmd = 'git status --porcelain';
7
- var outputString = cmdSyncTrimOut(gitCmd);
2
+ const { ok } = require('assert').strict;
3
+ const { cmdSyncTrimOut, cmdSyncInheritOut, cmdSyncPipeOut } = require('./cmdUtils');
4
+ const { splitByNewLine } = require('./stringUtils');
5
+ const statusList = () => {
6
+ const gitCmd = 'git status --porcelain';
7
+ const outputString = cmdSyncTrimOut(gitCmd);
8
8
  if (!outputString)
9
9
  return [];
10
- var handleMultipleWhitespaces = function (rowString) {
11
- var spaceChar = ' ';
12
- var parts = rowString.split(spaceChar);
10
+ const handleMultipleWhitespaces = (rowString) => {
11
+ const spaceChar = ' ';
12
+ const parts = rowString.split(spaceChar);
13
13
  return parts.filter(Boolean).join(spaceChar);
14
14
  };
15
15
  return splitByNewLine(outputString).map(handleMultipleWhitespaces);
16
16
  };
17
- var getCurrentBranchName = function () { return cmdSyncTrimOut('git branch --show-current'); };
18
- var pullRequest = function (fromBranch, toBranch, prTitle) {
19
- var cmdTool = 'hub';
20
- var installDocUrl = 'https://github.com/github/hub#installation';
21
- var errorMsg = cmdTool + " is not installed! See " + installDocUrl + "\n";
17
+ const getCurrentBranchName = () => cmdSyncTrimOut('git branch --show-current');
18
+ const pullRequest = (fromBranch, toBranch, prTitle) => {
19
+ const cmdTool = 'hub';
20
+ const installDocUrl = 'https://github.com/github/hub#installation';
21
+ const errorMsg = `${cmdTool} is not installed! See ${installDocUrl}\n`;
22
22
  try {
23
- var toolPath = cmdSyncTrimOut(cmdTool + " --version");
23
+ const toolPath = cmdSyncTrimOut(`${cmdTool} --version`);
24
24
  ok(toolPath, errorMsg);
25
25
  }
26
26
  catch (error) {
27
27
  throw new Error(errorMsg);
28
28
  }
29
- var cmd = cmdTool + " pull-request -m \"" + prTitle + "\" --head " + fromBranch + " --base " + toBranch;
29
+ const cmd = `${cmdTool} pull-request -m "${prTitle}" --head ${fromBranch} --base ${toBranch}`;
30
30
  cmdSyncInheritOut(cmd);
31
31
  };
32
- var remoteBranchExists = function (expectedBranchName) {
33
- var gitCmd = "git ls-remote --heads origin " + expectedBranchName;
34
- var output = cmdSyncTrimOut(gitCmd);
32
+ const remoteBranchExists = (expectedBranchName) => {
33
+ const gitCmd = `git ls-remote --heads origin ${expectedBranchName}`;
34
+ const output = cmdSyncTrimOut(gitCmd);
35
35
  return Boolean(output);
36
36
  };
37
- var pull = function () { return cmdSyncPipeOut('git remote update -p && git merge --ff-only @{u}'); };
38
- var addAll = function () { return cmdSyncPipeOut('git add --all'); };
39
- var add = function (fileList) { return cmdSyncPipeOut("git add " + fileList.join(' ')); };
40
- var checkout = function (branchName) { return cmdSyncPipeOut("git checkout " + branchName); };
41
- var createBranch = function (branchName) { return cmdSyncPipeOut("git branch " + branchName); };
42
- var commit = function (commitMessage, noVerify) {
43
- var maybeNoVerifyParam = noVerify ? '--no-verify' : '';
44
- return cmdSyncPipeOut(("git commit -m \"" + commitMessage + "\" " + maybeNoVerifyParam).trimEnd());
37
+ const pull = () => cmdSyncPipeOut('git remote update -p && git merge --ff-only @{u}');
38
+ const addAll = () => cmdSyncPipeOut('git add --all');
39
+ const add = (fileList) => cmdSyncPipeOut(`git add ${fileList.join(' ')}`);
40
+ const checkout = (branchName) => cmdSyncPipeOut(`git checkout ${branchName}`);
41
+ const createBranch = (branchName) => cmdSyncPipeOut(`git branch ${branchName}`);
42
+ const commit = (commitMessage, noVerify) => {
43
+ const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
44
+ return cmdSyncPipeOut(`git commit -m "${commitMessage}" ${maybeNoVerifyParam}`.trimEnd());
45
45
  };
46
- var push = function (branchName, noVerify) {
47
- var maybeNoVerifyParam = noVerify ? '--no-verify' : '';
48
- var cmd = ("git push --set-upstream origin " + branchName + " " + maybeNoVerifyParam).trimEnd();
46
+ const push = (branchName, noVerify) => {
47
+ const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
48
+ const cmd = `git push --set-upstream origin ${branchName} ${maybeNoVerifyParam}`.trimEnd();
49
49
  return cmdSyncPipeOut(cmd);
50
50
  };
51
- var assertEmptyStatusList = function () {
51
+ const assertEmptyStatusList = () => {
52
52
  ok(statusList().length === 0, 'An empty GIT stage is expected!');
53
53
  };
54
- var assertCurrentBranch = function (expectedBranchName) {
55
- var currentGitBranchName = getCurrentBranchName();
56
- var errorMsg = "The " + expectedBranchName + " branch is expected to be active, not \"" + currentGitBranchName + "\"";
54
+ const assertCurrentBranch = (expectedBranchName) => {
55
+ const currentGitBranchName = getCurrentBranchName();
56
+ const errorMsg = `The ${expectedBranchName} branch is expected to be active, not "${currentGitBranchName}"`;
57
57
  ok(currentGitBranchName === expectedBranchName, errorMsg);
58
58
  };
59
- var assertRemoteBranch = function (expectedBranchName) {
60
- var errorMsg = "Remote branch " + expectedBranchName + " does not exist!";
59
+ const assertRemoteBranch = (expectedBranchName) => {
60
+ const errorMsg = `Remote branch ${expectedBranchName} does not exist!`;
61
61
  ok(remoteBranchExists(expectedBranchName), errorMsg);
62
62
  };
63
63
  module.exports = {
64
- statusList: statusList,
65
- getCurrentBranchName: getCurrentBranchName,
66
- pullRequest: pullRequest,
67
- remoteBranchExists: remoteBranchExists,
68
- pull: pull,
69
- addAll: addAll,
70
- add: add,
71
- checkout: checkout,
72
- createBranch: createBranch,
73
- commit: commit,
74
- push: push,
75
- assertEmptyStatusList: assertEmptyStatusList,
76
- assertCurrentBranch: assertCurrentBranch,
77
- assertRemoteBranch: assertRemoteBranch
64
+ statusList,
65
+ getCurrentBranchName,
66
+ pullRequest,
67
+ remoteBranchExists,
68
+ pull,
69
+ addAll,
70
+ add,
71
+ checkout,
72
+ createBranch,
73
+ commit,
74
+ push,
75
+ assertEmptyStatusList,
76
+ assertCurrentBranch,
77
+ assertRemoteBranch,
78
78
  };
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
- var cmdUtils = require('./cmdUtils');
3
- var fsUtils = require('./fsUtils');
4
- var gitUtils = require('./gitUtils');
5
- var stringUtils = require('./stringUtils');
2
+ const cmdUtils = require('./cmdUtils');
3
+ const fsUtils = require('./fsUtils');
4
+ const gitUtils = require('./gitUtils');
5
+ const stringUtils = require('./stringUtils');
6
6
  module.exports = {
7
- cmdUtils: cmdUtils,
8
- fsUtils: fsUtils,
9
- gitUtils: gitUtils,
10
- stringUtils: stringUtils
7
+ cmdUtils,
8
+ fsUtils,
9
+ gitUtils,
10
+ stringUtils,
11
11
  };
@@ -1,8 +1,5 @@
1
1
  "use strict";
2
- var splitByNewLine = function (string) {
3
- if (string === void 0) { string = ''; }
4
- return string.split(/\r?\n/);
5
- };
2
+ const splitByNewLine = (string = '') => string.split(/\r?\n/);
6
3
  module.exports = {
7
- splitByNewLine: splitByNewLine
4
+ splitByNewLine,
8
5
  };