@24i/smartapps-bigscreen-rnv-build-engine 0.0.2-alpha.1355 → 0.0.2-alpha.1357

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