@24i/smartapps-bigscreen-rnv-build-engine 0.0.2-alpha.1337 → 0.0.2-alpha.1340

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 (83) hide show
  1. package/dist/src/constants/buildSchemes.js +3 -3
  2. package/dist/src/constants/index.js +10 -3
  3. package/dist/src/constants/platforms.js +3 -3
  4. package/dist/src/index.js +31 -29
  5. package/dist/src/resolvers/index.js +17 -10
  6. package/dist/src/resolvers/resolveBaseUrl.js +15 -14
  7. package/dist/src/resolvers/resolveBuildVersion.js +17 -16
  8. package/dist/src/resolvers/resolveBuildVersionOffset.js +12 -12
  9. package/dist/src/resolvers/resolveDeployLocations.js +56 -44
  10. package/dist/src/resolvers/resolveGenericRnvConfig.js +30 -18
  11. package/dist/src/resolvers/resolveHbbtvDeployConfig.js +4 -4
  12. package/dist/src/resolvers/resolveHbbtvDeployUrl.js +7 -7
  13. package/dist/src/resolvers/resolveHbbtvRemoteBuildDirRelativePath.js +12 -12
  14. package/dist/src/resolvers/resolveZippedPlatformBuildsRelativeFilePath.js +11 -11
  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 +38 -37
  24. package/dist/src/scripts/release/githubRelease.js +64 -60
  25. package/dist/src/scripts/release/notifySlack/makePayload.js +48 -44
  26. package/dist/src/scripts/release/notifySlack/notifySlack.js +10 -10
  27. package/dist/src/scripts/release/notifySlack/slackBlockKitBuilder.js +28 -25
  28. package/dist/src/scripts/release/sentryRelease.js +34 -34
  29. package/dist/src/scripts/release/urlsMarkdown.js +25 -23
  30. package/dist/src/scripts/releaseAllWithScheme.js +26 -26
  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 +5 -2
  36. package/dist/src/sdks/index.js +54 -15
  37. package/dist/src/sdks/sdk-tizen/index.js +254 -154
  38. package/dist/src/sdks/sdk-webos/index.js +231 -136
  39. package/dist/src/sdks/sdk-webpack/index.js +69 -20
  40. package/dist/src/sdks/sdkUtils.js +59 -14
  41. package/dist/src/tasks/deploy/aswS3/aws.js +9 -9
  42. package/dist/src/tasks/deploy/aswS3/deployS3.js +83 -44
  43. package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +139 -70
  44. package/dist/src/tasks/engineTasks.js +10 -10
  45. package/dist/src/tasks/task.rnv.build.js +132 -75
  46. package/dist/src/tasks/task.rnv.configure.js +88 -39
  47. package/dist/src/tasks/task.rnv.configureSoft.js +75 -22
  48. package/dist/src/tasks/task.rnv.deploy.js +78 -28
  49. package/dist/src/tasks/task.rnv.hooks.run.js +92 -42
  50. package/dist/src/tasks/task.rnv.package.js +61 -18
  51. package/dist/src/tasks/task.rnv.project.configure.js +183 -80
  52. package/dist/src/tasks/task.rnv.start.js +87 -42
  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 +9 -2
  57. package/dist/src/utils/replaceRelevantStringsInConfig/replaceRelevantStringsInConfig.js +11 -10
  58. package/dist/src/utils/replaceRelevantStringsInConfig/replaceTemplateString.js +29 -23
  59. package/dist/src/utils/zipBuildsByPlatforms.js +25 -25
  60. package/dist/templates/platforms/_shared/template.js +41 -56
  61. package/dist/templates/platforms/_shared/webpack.base.js +140 -120
  62. package/dist/templates/platforms/entone/webpack.config.dev.js +22 -27
  63. package/dist/templates/platforms/entone/webpack.config.prod.js +20 -21
  64. package/dist/templates/platforms/hbbtv/webpack.config.dev.js +24 -42
  65. package/dist/templates/platforms/hbbtv/webpack.config.prod.js +22 -36
  66. package/dist/templates/platforms/tizen/webpack.config.dev.js +22 -28
  67. package/dist/templates/platforms/tizen/webpack.config.prod.js +20 -21
  68. package/dist/templates/platforms/webos/webpack.config.dev.js +24 -31
  69. package/dist/templates/platforms/webos/webpack.config.prod.js +22 -23
  70. package/dist/templates/platforms/webtv/webpack.config.dev.js +22 -27
  71. package/dist/templates/platforms/webtv/webpack.config.prod.js +20 -21
  72. package/dist/types/src/index.d.ts +1 -1
  73. package/dist/types/src/resolvers/resolveBaseUrl.d.ts +3 -3
  74. package/dist/types/src/resolvers/resolveBuildVersion.d.ts +3 -3
  75. package/dist/types/src/resolvers/resolveGenericRnvConfig.d.ts +1 -1
  76. package/dist/types/src/resolvers/resolveHbbtvDeployConfig.d.ts +1 -1
  77. package/dist/types/src/resolvers/resolveHbbtvRemoteBuildDirRelativePath.d.ts +1 -1
  78. package/dist/types/src/scripts/release/notifySlack/makePayload.d.ts +3 -9
  79. package/dist/types/src/tasks/engineTasks.d.ts +9 -3
  80. package/dist/types/src/tasks/task.rnv.configureSoft.d.ts +1 -1
  81. package/dist/types/src/tasks/task.rnv.hooks.run.d.ts +1 -1
  82. package/dist/types/src/tasks/task.rnv.project.configure.d.ts +1 -1
  83. package/package.json +2 -2
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.__esModule = true;
3
3
  exports.resolveZippedPlatformBuildsRelativeFilePath = void 0;
4
- const common_1 = require("rnv/dist/core/common");
5
- const resolveZippedPlatformBuildsRelativeFilePath = (c, platformName) => {
6
- const { platformBuildsDir } = c.buildConfig.paths;
7
- const appNameInFileName = common_1.getConfigProp(c, platformName, 'appNameInFileName', '');
8
- const buildVersion = common_1.getConfigProp(c, platformName, 'packageVersion', '');
9
- const zippedFilesParentDir = 'zipped_by_platform';
10
- const fileExtension = 'zip';
11
- const relativePathToDir = `${platformBuildsDir}/${zippedFilesParentDir}`;
12
- const zipFileName = `${appNameInFileName}_${platformName}_${buildVersion}.${fileExtension}`;
13
- return `${relativePathToDir}/${zipFileName}`;
4
+ var common_1 = require("rnv/dist/core/common");
5
+ var resolveZippedPlatformBuildsRelativeFilePath = function (c, platformName) {
6
+ var platformBuildsDir = c.buildConfig.paths.platformBuildsDir;
7
+ var appNameInFileName = common_1.getConfigProp(c, platformName, 'appNameInFileName', '');
8
+ var buildVersion = common_1.getConfigProp(c, platformName, 'packageVersion', '');
9
+ var zippedFilesParentDir = 'zipped_by_platform';
10
+ var fileExtension = 'zip';
11
+ var relativePathToDir = platformBuildsDir + "/" + zippedFilesParentDir;
12
+ var zipFileName = appNameInFileName + "_" + platformName + "_" + buildVersion + "." + fileExtension;
13
+ return relativePathToDir + "/" + zipFileName;
14
14
  };
15
15
  exports.resolveZippedPlatformBuildsRelativeFilePath = resolveZippedPlatformBuildsRelativeFilePath;
@@ -1,25 +1,25 @@
1
1
  "use strict";
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 buildTask = (options) => {
7
- const { scheme, platform, flavour } = options;
8
- const cmd = `npx rnv build -s ${scheme} -p ${platform} -c ${flavour} --ci`;
2
+ exports.__esModule = true;
3
+ var child_process_1 = require("child_process");
4
+ var forEachSupportedPlatformFlavour_1 = require("../utils/forEachSupportedPlatformFlavour");
5
+ var resolvers_1 = require("../resolvers");
6
+ var buildTask = function (options) {
7
+ var scheme = options.scheme, platform = options.platform, flavour = options.flavour;
8
+ var cmd = "npx rnv build -s " + scheme + " -p " + platform + " -c " + flavour + " --ci";
9
9
  child_process_1.execSync(cmd, { stdio: 'inherit' });
10
10
  };
11
- const buildAllWithScheme = () => {
12
- const scheme = process.argv[2];
11
+ var buildAllWithScheme = function () {
12
+ var scheme = process.argv[2];
13
13
  if (!scheme) {
14
14
  throw new Error('No scheme name to use found! Please use rnv scheme name as a param.');
15
15
  }
16
- const c = resolvers_1.getBaseConfig();
16
+ var c = resolvers_1.getBaseConfig();
17
17
  c.runtime.scheme = scheme;
18
18
  forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour(c, buildTask);
19
19
  return true;
20
20
  };
21
- const startTimestamp = Date.now();
21
+ var startTimestamp = Date.now();
22
22
  buildAllWithScheme();
23
- const msPerSecond = 1000;
24
- const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
25
- console.log(`buildAllWithScheme: done in ${scriptTotalTimeInSeconds} second(s)!`);
23
+ var msPerSecond = 1000;
24
+ var scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
25
+ console.log("buildAllWithScheme: done in " + scriptTotalTimeInSeconds + " second(s)!");
@@ -1,19 +1,19 @@
1
1
  "use strict";
2
2
  var _a, _b, _c;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const resolvers_1 = require("../../resolvers");
5
- const gitUtils_1 = require("../utils/gitUtils");
6
- const c = resolvers_1.getBaseConfig();
7
- const { branchNames = {}, commitTitles = {} } = ((_b = (_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.git) || {};
8
- const { packageVersion = '' } = ((_c = c.buildConfig) === null || _c === void 0 ? void 0 : _c.common) || {};
9
- const newReleaseBranchName = branchNames.rc;
3
+ exports.__esModule = true;
4
+ var resolvers_1 = require("../../resolvers");
5
+ var gitUtils_1 = require("../utils/gitUtils");
6
+ var c = resolvers_1.getBaseConfig();
7
+ var _d = ((_b = (_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.git) || {}, _e = _d.branchNames, branchNames = _e === void 0 ? {} : _e, _f = _d.commitTitles, commitTitles = _f === void 0 ? {} : _f;
8
+ var _g = (((_c = c.buildConfig) === null || _c === void 0 ? void 0 : _c.common) || {}).packageVersion, packageVersion = _g === void 0 ? '' : _g;
9
+ var newReleaseBranchName = branchNames.rc;
10
10
  gitUtils_1.createBranch(newReleaseBranchName);
11
11
  gitUtils_1.checkout(newReleaseBranchName);
12
12
  gitUtils_1.addAll();
13
- const withNoVerifyFlag = true;
13
+ var withNoVerifyFlag = true;
14
14
  console.log('Creating commit with changed version...');
15
15
  gitUtils_1.commit(commitTitles.versionBump, withNoVerifyFlag);
16
- console.log(`Pushing ${newReleaseBranchName} branch...`);
16
+ console.log("Pushing " + newReleaseBranchName + " branch...");
17
17
  gitUtils_1.push(newReleaseBranchName, withNoVerifyFlag);
18
- console.log(`\nDone! The version has been bumped to ${packageVersion} and ${newReleaseBranchName} branch pushed into the remote repository.`);
18
+ console.log("\nDone! The version has been bumped to " + packageVersion + " and " + newReleaseBranchName + " branch pushed into the remote repository.");
19
19
  console.log('Note: Do not forget to update release notes for upcoming release!');
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  var _a, _b;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const assert_1 = require("assert");
5
- const resolvers_1 = require("../../resolvers");
6
- const gitUtils_1 = require("../utils/gitUtils");
7
- const { ok } = assert_1.strict;
8
- const c = resolvers_1.getBaseConfig();
9
- const { branchNames = {}, commitTitles = {} } = ((_b = (_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.git) || {};
3
+ exports.__esModule = true;
4
+ var assert_1 = require("assert");
5
+ var resolvers_1 = require("../../resolvers");
6
+ var gitUtils_1 = require("../utils/gitUtils");
7
+ var ok = assert_1.strict.ok;
8
+ var c = resolvers_1.getBaseConfig();
9
+ var _c = ((_b = (_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.git) || {}, _d = _c.branchNames, branchNames = _d === void 0 ? {} : _d, _e = _c.commitTitles, commitTitles = _e === void 0 ? {} : _e;
10
10
  ok(branchNames.dev);
11
11
  ok(branchNames.rc);
12
12
  ok(commitTitles.versionBump);
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.__esModule = true;
3
3
  exports.checkReleaseNotes = void 0;
4
- const assert_1 = require("assert");
5
- const utils_1 = require("../utils");
6
- const { ok } = assert_1.strict;
7
- const checkReleaseNotes = (c) => {
4
+ var assert_1 = require("assert");
5
+ var utils_1 = require("../utils");
6
+ var ok = assert_1.strict.ok;
7
+ var checkReleaseNotes = function (c) {
8
8
  var _a, _b;
9
- const { relativePath, requiredRows = [] } = ((_b = (_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.releaseNotes) || {};
9
+ var _c = ((_b = (_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.releaseNotes) || {}, relativePath = _c.relativePath, _d = _c.requiredRows, requiredRows = _d === void 0 ? [] : _d;
10
10
  utils_1.fsUtils.assertPath(relativePath);
11
- const fileContent = utils_1.fsUtils.getFileContentAsString(relativePath);
12
- const assertFileContentRow = (expectedRowContent) => {
13
- const errorMsg = `${relativePath} should contain following row: "${expectedRowContent}"`;
11
+ var fileContent = utils_1.fsUtils.getFileContentAsString(relativePath);
12
+ var assertFileContentRow = function (expectedRowContent) {
13
+ var errorMsg = relativePath + " should contain following row: \"" + expectedRowContent + "\"";
14
14
  ok(fileContent.includes(expectedRowContent), errorMsg);
15
15
  };
16
16
  requiredRows.forEach(assertFileContentRow);
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  var _a, _b;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const assert_1 = require("assert");
5
- const resolvers_1 = require("../../resolvers");
6
- const utils_1 = require("../utils");
7
- const checkReleaseNotes_1 = require("./checkReleaseNotes");
8
- const { ok } = assert_1.strict;
9
- const c = resolvers_1.getBaseConfig();
10
- const { branchNames = {}, pullRequestTitles } = ((_b = (_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.git) || {};
11
- const rcBranchName = branchNames.rc;
12
- const distBranchName = branchNames.dist;
13
- const devBranchName = branchNames.dev;
3
+ exports.__esModule = true;
4
+ var assert_1 = require("assert");
5
+ var resolvers_1 = require("../../resolvers");
6
+ var utils_1 = require("../utils");
7
+ var checkReleaseNotes_1 = require("./checkReleaseNotes");
8
+ var ok = assert_1.strict.ok;
9
+ var c = resolvers_1.getBaseConfig();
10
+ var _c = ((_b = (_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.git) || {}, _d = _c.branchNames, branchNames = _d === void 0 ? {} : _d, pullRequestTitles = _c.pullRequestTitles;
11
+ var rcBranchName = branchNames.rc;
12
+ var distBranchName = branchNames.dist;
13
+ var devBranchName = branchNames.dev;
14
14
  ok(rcBranchName);
15
15
  ok(distBranchName);
16
16
  ok(devBranchName);
@@ -18,16 +18,16 @@ utils_1.gitUtils.assertCurrentBranch(rcBranchName);
18
18
  utils_1.gitUtils.assertEmptyStatusList();
19
19
  utils_1.gitUtils.assertRemoteBranch(rcBranchName);
20
20
  utils_1.gitUtils.assertRemoteBranch(distBranchName);
21
- const distributionPrTitle = pullRequestTitles.rcToDist;
22
- const developmentPrTitle = pullRequestTitles.rcToDev;
21
+ var distributionPrTitle = pullRequestTitles.rcToDist;
22
+ var developmentPrTitle = pullRequestTitles.rcToDev;
23
23
  ok(distributionPrTitle);
24
24
  ok(developmentPrTitle);
25
25
  utils_1.gitUtils.pull();
26
26
  checkReleaseNotes_1.checkReleaseNotes(c);
27
- console.log(`Creating Pull Request from ${rcBranchName} branch to ${distBranchName} branch...`);
28
- console.log(`Applied PR title: "${distributionPrTitle}"`);
27
+ console.log("Creating Pull Request from " + rcBranchName + " branch to " + distBranchName + " branch...");
28
+ console.log("Applied PR title: \"" + distributionPrTitle + "\"");
29
29
  utils_1.gitUtils.pullRequest(rcBranchName, distBranchName, distributionPrTitle);
30
- console.log(`\nCreating Pull Request from ${rcBranchName} branch to ${devBranchName} branch...`);
31
- console.log(`Applied PR title: "${developmentPrTitle}"`);
30
+ console.log("\nCreating Pull Request from " + rcBranchName + " branch to " + devBranchName + " branch...");
31
+ console.log("Applied PR title: \"" + developmentPrTitle + "\"");
32
32
  utils_1.gitUtils.pullRequest(rcBranchName, devBranchName, developmentPrTitle);
33
33
  console.log('\nDone! Pull requests have been created!');
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const child_process_1 = require("child_process");
2
+ exports.__esModule = true;
3
+ var child_process_1 = require("child_process");
4
4
  console.log('Bumping the version...');
5
- const bumpType = process.argv[2] || 'patch';
6
- child_process_1.execSync(`npm --no-git-tag-version version ${bumpType}`, { stdio: 'inherit' });
5
+ var bumpType = process.argv[2] || 'patch';
6
+ child_process_1.execSync("npm --no-git-tag-version version " + bumpType, { stdio: 'inherit' });
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
  var _a, _b, _c, _d;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const assert_1 = require("assert");
5
- const resolvers_1 = require("../../resolvers");
6
- const utils_1 = require("../utils");
7
- const checkReleaseNotes_1 = require("./checkReleaseNotes");
8
- const { ok } = assert_1.strict;
9
- const c = resolvers_1.getBaseConfig();
10
- const { branchNames = {}, commitTitles = {}, pullRequestTitles = {}, } = ((_b = (_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.git) || {};
11
- const { relativePath = [] } = ((_d = (_c = c.buildConfig) === null || _c === void 0 ? void 0 : _c.common) === null || _d === void 0 ? void 0 : _d.releaseNotes) || {};
12
- const rcBranchName = branchNames.rc;
13
- const releaseNotesBranchName = branchNames.rcReleaseNotes;
14
- const commitTitle = commitTitles.rcReleaseNotes;
15
- const prTitle = pullRequestTitles.releaseNotesToRc;
3
+ exports.__esModule = true;
4
+ var assert_1 = require("assert");
5
+ var resolvers_1 = require("../../resolvers");
6
+ var utils_1 = require("../utils");
7
+ var checkReleaseNotes_1 = require("./checkReleaseNotes");
8
+ var ok = assert_1.strict.ok;
9
+ var c = resolvers_1.getBaseConfig();
10
+ var _e = ((_b = (_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.git) || {}, _f = _e.branchNames, branchNames = _f === void 0 ? {} : _f, _g = _e.commitTitles, commitTitles = _g === void 0 ? {} : _g, _h = _e.pullRequestTitles, pullRequestTitles = _h === void 0 ? {} : _h;
11
+ var _j = (((_d = (_c = c.buildConfig) === null || _c === void 0 ? void 0 : _c.common) === null || _d === void 0 ? void 0 : _d.releaseNotes) || {}).relativePath, relativePath = _j === void 0 ? [] : _j;
12
+ var rcBranchName = branchNames.rc;
13
+ var releaseNotesBranchName = branchNames.rcReleaseNotes;
14
+ var commitTitle = commitTitles.rcReleaseNotes;
15
+ var prTitle = pullRequestTitles.releaseNotesToRc;
16
16
  ok(relativePath);
17
17
  ok(releaseNotesBranchName);
18
18
  ok(commitTitle);
@@ -21,13 +21,13 @@ utils_1.gitUtils.assertCurrentBranch(rcBranchName);
21
21
  utils_1.gitUtils.assertRemoteBranch(rcBranchName);
22
22
  checkReleaseNotes_1.checkReleaseNotes(c);
23
23
  utils_1.gitUtils.pull();
24
- const changedFilesCount = utils_1.gitUtils.statusList().length;
24
+ var changedFilesCount = utils_1.gitUtils.statusList().length;
25
25
  if (changedFilesCount === 0) {
26
- console.log(`It seems ${relativePath} file has been updated before.`);
26
+ console.log("It seems " + relativePath + " file has been updated before.");
27
27
  console.log('Skipping making a commit, if needed, please continue on your own (manually).');
28
28
  }
29
29
  else {
30
- ok(changedFilesCount === 1, `Only ${relativePath} should contain changes!`);
30
+ ok(changedFilesCount === 1, "Only " + relativePath + " should contain changes!");
31
31
  utils_1.gitUtils.createBranch(releaseNotesBranchName);
32
32
  utils_1.gitUtils.checkout(releaseNotesBranchName);
33
33
  utils_1.gitUtils.add([relativePath]);
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.__esModule = true;
3
3
  exports.deleteSourceMaps = void 0;
4
- const child_process_1 = require("child_process");
5
- const executeSync = (cmd) => child_process_1.execSync(cmd, { stdio: 'inherit' });
6
- const deleteSourceMaps = (c) => {
7
- const { platformBuildsDir } = c.buildConfig.paths;
8
- executeSync(`find ${platformBuildsDir} -type f -iname "*.map" -delete`);
4
+ var child_process_1 = require("child_process");
5
+ var executeSync = function (cmd) { return child_process_1.execSync(cmd, { stdio: 'inherit' }); };
6
+ var deleteSourceMaps = function (c) {
7
+ var platformBuildsDir = c.buildConfig.paths.platformBuildsDir;
8
+ executeSync("find " + platformBuildsDir + " -type f -iname \"*.map\" -delete");
9
9
  console.log('Source Maps deleted...');
10
10
  };
11
11
  exports.deleteSourceMaps = deleteSourceMaps;
@@ -2,26 +2,26 @@
2
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.__esModule = true;
6
6
  exports.deployToAppCenter = void 0;
7
- const child_process_1 = require("child_process");
8
- const fs_1 = __importDefault(require("fs"));
9
- const common_1 = require("rnv/dist/core/common");
10
- const resolvers_1 = require("../../resolvers");
11
- const urlsMarkdown_1 = require("./urlsMarkdown");
12
- const appCenterRelease = (params) => {
13
- const { filePath, releaseNotesPath, buildVersion, token, projectName, group = 'Collaborators', organizationName = '24i-Media', } = params;
14
- const app = `${organizationName}/${projectName}`;
7
+ var child_process_1 = require("child_process");
8
+ var fs_1 = __importDefault(require("fs"));
9
+ var common_1 = require("rnv/dist/core/common");
10
+ var resolvers_1 = require("../../resolvers");
11
+ var urlsMarkdown_1 = require("./urlsMarkdown");
12
+ var appCenterRelease = function (params) {
13
+ var filePath = params.filePath, releaseNotesPath = params.releaseNotesPath, buildVersion = params.buildVersion, token = params.token, projectName = params.projectName, _a = params.group, group = _a === void 0 ? 'Collaborators' : _a, _b = params.organizationName, organizationName = _b === void 0 ? '24i-Media' : _b;
14
+ var app = organizationName + "/" + projectName;
15
15
  child_process_1.execSync('appcenter distribute release '
16
- + `--file "${filePath}" `
17
- + `--release-notes-file "${releaseNotesPath}" `
18
- + `--build-version "${buildVersion}" `
19
- + `--app "${app}" `
20
- + `--token "${token}" `
21
- + `--group "${group}" `
16
+ + ("--file \"" + filePath + "\" ")
17
+ + ("--release-notes-file \"" + releaseNotesPath + "\" ")
18
+ + ("--build-version \"" + buildVersion + "\" ")
19
+ + ("--app \"" + app + "\" ")
20
+ + ("--token \"" + token + "\" ")
21
+ + ("--group \"" + group + "\" ")
22
22
  + '--disable-telemetry', { stdio: 'inherit' });
23
23
  };
24
- const getAppCenterConfigByPlatformName = (c, platformName) => {
24
+ var getAppCenterConfigByPlatformName = function (c, platformName) {
25
25
  try {
26
26
  return c.buildConfig.platforms[platformName].deploy.appCenter || null;
27
27
  }
@@ -29,39 +29,40 @@ const getAppCenterConfigByPlatformName = (c, platformName) => {
29
29
  return null;
30
30
  }
31
31
  };
32
- const getTokenByPlatform = (platformName = '') => {
33
- const envVariableName = `APPCENTER_TOKEN_${platformName.toUpperCase()}`;
32
+ var getTokenByPlatform = function (platformName) {
33
+ if (platformName === void 0) { platformName = ''; }
34
+ var envVariableName = "APPCENTER_TOKEN_" + platformName.toUpperCase();
34
35
  return process.env[envVariableName] || '';
35
36
  };
36
- const processPlatform = (c, platformName) => {
37
- const appCenterConfig = getAppCenterConfigByPlatformName(c, platformName);
37
+ var processPlatform = function (c, platformName) {
38
+ var appCenterConfig = getAppCenterConfigByPlatformName(c, platformName);
38
39
  if (!appCenterConfig)
39
40
  return;
40
- const { appName } = appCenterConfig;
41
- const token = getTokenByPlatform(platformName);
42
- const zipPath = resolvers_1.resolveZippedPlatformBuildsRelativeFilePath(c, platformName);
43
- const buildVersion = common_1.getConfigProp(c, platformName, 'packageVersion', '');
44
- const releaseNotesPath = common_1.getConfigProp(c, platformName, 'releaseNotes', {}).relativePath || '';
41
+ var appName = appCenterConfig.appName;
42
+ var token = getTokenByPlatform(platformName);
43
+ var zipPath = resolvers_1.resolveZippedPlatformBuildsRelativeFilePath(c, platformName);
44
+ var buildVersion = common_1.getConfigProp(c, platformName, 'packageVersion', '');
45
+ var releaseNotesPath = common_1.getConfigProp(c, platformName, 'releaseNotes', {}).relativePath || '';
45
46
  if (!appName || !token || !releaseNotesPath || !zipPath || !buildVersion)
46
47
  return;
47
- const tempReleaseNotesPath = `RELEASE_NOTES_APPCENTER_${platformName.toUpperCase()}.md`;
48
- if (fs_1.default.existsSync(tempReleaseNotesPath)) {
49
- fs_1.default.unlinkSync(tempReleaseNotesPath);
48
+ var tempReleaseNotesPath = "RELEASE_NOTES_APPCENTER_" + platformName.toUpperCase() + ".md";
49
+ if (fs_1["default"].existsSync(tempReleaseNotesPath)) {
50
+ fs_1["default"].unlinkSync(tempReleaseNotesPath);
50
51
  }
51
- child_process_1.execSync(`cat ${releaseNotesPath} >> ${tempReleaseNotesPath}`);
52
- const urlsMarkdown = urlsMarkdown_1.getUrlsMarkdown(c, [platformName]);
53
- child_process_1.execSync(`echo "${urlsMarkdown}" >> ${tempReleaseNotesPath}`);
54
- console.log(`Deploying ${platformName} platform to AppCenter.ms...`);
52
+ child_process_1.execSync("cat " + releaseNotesPath + " >> " + tempReleaseNotesPath);
53
+ var urlsMarkdown = urlsMarkdown_1.getUrlsMarkdown(c, [platformName]);
54
+ child_process_1.execSync("echo \"" + urlsMarkdown + "\" >> " + tempReleaseNotesPath);
55
+ console.log("Deploying " + platformName + " platform to AppCenter.ms...");
55
56
  appCenterRelease({
56
57
  projectName: appName,
57
- buildVersion,
58
+ buildVersion: buildVersion,
58
59
  filePath: zipPath,
59
60
  releaseNotesPath: tempReleaseNotesPath,
60
- token,
61
+ token: token
61
62
  });
62
63
  };
63
- const deployToAppCenter = (c) => {
64
- const { supportedPlatforms = [] } = c.buildConfig.defaults || {};
65
- supportedPlatforms.forEach((platformName) => processPlatform(c, platformName));
64
+ var deployToAppCenter = function (c) {
65
+ var _a = (c.buildConfig.defaults || {}).supportedPlatforms, supportedPlatforms = _a === void 0 ? [] : _a;
66
+ supportedPlatforms.forEach(function (platformName) { return processPlatform(c, platformName); });
66
67
  };
67
68
  exports.deployToAppCenter = deployToAppCenter;
@@ -2,33 +2,36 @@
2
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.__esModule = true;
6
6
  exports.githubRelease = void 0;
7
- const child_process_1 = require("child_process");
8
- const fs_1 = __importDefault(require("fs"));
9
- const assert_1 = require("assert");
10
- const path_1 = require("path");
11
- const resolvers_1 = require("../../resolvers");
12
- const urlsMarkdown_1 = require("./urlsMarkdown");
13
- const { ok } = assert_1.strict;
14
- const token = process.env.GITHUB_TOKEN;
15
- const targetCommit = process.env.TRAVIS_COMMIT;
16
- const githubContentType = 'application/vnd.github.v3+json';
17
- const githubReleaseNotesPath = 'RELEASE_NOTES_GITHUB.md';
18
- const handleResponseErrors = (response) => {
19
- const { errors, message } = response;
7
+ var child_process_1 = require("child_process");
8
+ var fs_1 = __importDefault(require("fs"));
9
+ var assert_1 = require("assert");
10
+ var path_1 = require("path");
11
+ var resolvers_1 = require("../../resolvers");
12
+ var urlsMarkdown_1 = require("./urlsMarkdown");
13
+ var ok = assert_1.strict.ok;
14
+ var token = process.env.GITHUB_TOKEN;
15
+ var targetCommit = process.env.TRAVIS_COMMIT;
16
+ var githubContentType = 'application/vnd.github.v3+json';
17
+ var githubReleaseNotesPath = 'RELEASE_NOTES_GITHUB.md';
18
+ var handleResponseErrors = function (response) {
19
+ var errors = response.errors, message = response.message;
20
20
  if (message && !errors)
21
- throw new Error(`GitHub error: ${message}`);
21
+ throw new Error("GitHub error: " + message);
22
22
  if (!errors)
23
23
  return;
24
- const makeErrorDetailString = (error = {}) => Object
25
- .keys(error)
26
- .map((key) => `${key}: "${error[key]}"`)
27
- .join(', ');
28
- const errorsDetails = errors.map(makeErrorDetailString);
29
- throw new Error(`GitHub error: ${message || ''}\n${errorsDetails.join('\n')}`);
24
+ var makeErrorDetailString = function (error) {
25
+ if (error === void 0) { error = {}; }
26
+ return Object
27
+ .keys(error)
28
+ .map(function (key) { return key + ": \"" + error[key] + "\""; })
29
+ .join(', ');
30
+ };
31
+ var errorsDetails = errors.map(makeErrorDetailString);
32
+ throw new Error("GitHub error: " + (message || '') + "\n" + errorsDetails.join('\n'));
30
33
  };
31
- const getReleaseNotesPath = (c) => {
34
+ var getReleaseNotesPath = function (c) {
32
35
  try {
33
36
  return c.buildConfig.common.releaseNotes.relativePath || '';
34
37
  }
@@ -36,80 +39,81 @@ const getReleaseNotesPath = (c) => {
36
39
  return '';
37
40
  }
38
41
  };
39
- const deleteFileIfExists = (filePath) => {
40
- if (fs_1.default.existsSync(filePath)) {
41
- fs_1.default.unlinkSync(filePath);
42
+ var deleteFileIfExists = function (filePath) {
43
+ if (fs_1["default"].existsSync(filePath)) {
44
+ fs_1["default"].unlinkSync(filePath);
42
45
  }
43
46
  };
44
- const makeGitHubReleaseNotes = (c) => {
45
- const releaseNotesPath = getReleaseNotesPath(c);
47
+ var makeGitHubReleaseNotes = function (c) {
48
+ var releaseNotesPath = getReleaseNotesPath(c);
46
49
  ok(releaseNotesPath, 'The path to the file with release notes is missing!');
47
50
  deleteFileIfExists(githubReleaseNotesPath);
48
- child_process_1.execSync(`sed '1d;2d' ${releaseNotesPath} >> ${githubReleaseNotesPath}`);
49
- const textToAppend = urlsMarkdown_1.getUrlsMarkdown(c);
50
- child_process_1.execSync(`echo "${textToAppend}" >> ${githubReleaseNotesPath}`);
51
+ child_process_1.execSync("sed '1d;2d' " + releaseNotesPath + " >> " + githubReleaseNotesPath);
52
+ var textToAppend = urlsMarkdown_1.getUrlsMarkdown(c);
53
+ child_process_1.execSync("echo \"" + textToAppend + "\" >> " + githubReleaseNotesPath);
51
54
  };
52
- const createRelease = (c) => {
53
- const { packageVersion, git = {} } = c.buildConfig.common;
54
- const versionLabel = `v${packageVersion}`;
55
+ var createRelease = function (c) {
56
+ var _a = c.buildConfig.common, packageVersion = _a.packageVersion, _b = _a.git, git = _b === void 0 ? {} : _b;
57
+ var versionLabel = "v" + packageVersion;
55
58
  ok(token, 'process.env.GITHUB_TOKEN is not set!');
56
59
  ok(targetCommit, 'process.env.TRAVIS_COMMIT is not set!');
57
60
  ok(git.owner, 'Missing value for rnv config prop: common.git.owner');
58
61
  ok(git.repo, 'Missing value for rnv config prop: common.git.repo');
59
62
  ok(packageVersion);
60
63
  makeGitHubReleaseNotes(c);
61
- const releaseNotesContent = fs_1.default.readFileSync(githubReleaseNotesPath).toString();
62
- const data = {
64
+ var releaseNotesContent = fs_1["default"].readFileSync(githubReleaseNotesPath).toString();
65
+ var data = {
63
66
  tag_name: versionLabel,
64
67
  target_commitish: targetCommit,
65
68
  name: versionLabel,
66
69
  body: releaseNotesContent,
67
70
  draft: false,
68
- prerelease: false,
71
+ prerelease: false
69
72
  };
70
- const url = `https://api.github.com/repos/${git.owner}/${git.repo}/releases`;
71
- const headers = `-H "Accept: ${githubContentType}" -H "Authorization: token ${token}"`;
72
- const dataStringWithFixedSingleQuotes = JSON.stringify(data).replace(/'/g, "'\\''");
73
- const cmd = `curl -X POST ${headers} ${url} -d '${dataStringWithFixedSingleQuotes}'`;
74
- console.log(`Pushing GitHub Release: ${versionLabel}...`);
75
- const responseString = child_process_1.execSync(cmd, { stdio: 'pipe' }).toString();
76
- const response = JSON.parse(responseString);
73
+ var url = "https://api.github.com/repos/" + git.owner + "/" + git.repo + "/releases";
74
+ var headers = "-H \"Accept: " + githubContentType + "\" -H \"Authorization: token " + token + "\"";
75
+ var dataStringWithFixedSingleQuotes = JSON.stringify(data).replace(/'/g, "'\\''");
76
+ var cmd = "curl -X POST " + headers + " " + url + " -d '" + dataStringWithFixedSingleQuotes + "'";
77
+ console.log("Pushing GitHub Release: " + versionLabel + "...");
78
+ var responseString = child_process_1.execSync(cmd, { stdio: 'pipe' }).toString();
79
+ var response = JSON.parse(responseString);
77
80
  handleResponseErrors(response);
78
81
  console.log('Pushing done.');
79
82
  return response;
80
83
  };
81
- const getFileMimeType = (filepath) => {
82
- const cmd = `file --mime-type -b ${filepath}`;
84
+ var getFileMimeType = function (filepath) {
85
+ var cmd = "file --mime-type -b " + filepath;
83
86
  return child_process_1.execSync(cmd, { stdio: 'pipe' })
84
87
  .toString()
85
88
  .replace(/\r?\n/, '');
86
89
  };
87
- const uploadAsset = (uploadUrl = '', filePath) => {
90
+ var uploadAsset = function (uploadUrl, filePath) {
91
+ if (uploadUrl === void 0) { uploadUrl = ''; }
88
92
  if (!uploadUrl)
89
93
  return null;
90
- const url = `${uploadUrl.replace('{?name,label}', '')}`;
91
- const headers = `-H "Accept: ${githubContentType}" -H "Authorization: token ${token}" -H "content-type: ${getFileMimeType(filePath)}" -H "content-length: ${fs_1.default.statSync(filePath).size}"`;
92
- const cmd = `curl --data-binary @"${filePath}" ${headers} ${url}?name=${path_1.basename(filePath)}`;
93
- console.log(`Uploading ${filePath} asset to created GitHub Release...`);
94
- const responseString = child_process_1.execSync(cmd, { stdio: 'pipe' }).toString();
95
- const uploadResponse = JSON.parse(responseString);
94
+ var url = "" + uploadUrl.replace('{?name,label}', '');
95
+ var headers = "-H \"Accept: " + githubContentType + "\" -H \"Authorization: token " + token + "\" -H \"content-type: " + getFileMimeType(filePath) + "\" -H \"content-length: " + fs_1["default"].statSync(filePath).size + "\"";
96
+ var cmd = "curl --data-binary @\"" + filePath + "\" " + headers + " " + url + "?name=" + path_1.basename(filePath);
97
+ console.log("Uploading " + filePath + " asset to created GitHub Release...");
98
+ var responseString = child_process_1.execSync(cmd, { stdio: 'pipe' }).toString();
99
+ var uploadResponse = JSON.parse(responseString);
96
100
  handleResponseErrors(uploadResponse);
97
101
  console.log('Uploading done.');
98
102
  return uploadResponse;
99
103
  };
100
- const uploadZipWithPlatformBuilds = (c, platformName, githubUploadUrl) => {
101
- const zipFilePath = resolvers_1.resolveZippedPlatformBuildsRelativeFilePath(c, platformName);
104
+ var uploadZipWithPlatformBuilds = function (c, platformName, githubUploadUrl) {
105
+ var zipFilePath = resolvers_1.resolveZippedPlatformBuildsRelativeFilePath(c, platformName);
102
106
  if (zipFilePath) {
103
107
  uploadAsset(githubUploadUrl, zipFilePath);
104
108
  }
105
109
  };
106
- const githubRelease = (c) => {
107
- const releaseResponse = createRelease(c) || {};
108
- const uploadUrl = releaseResponse.upload_url;
110
+ var githubRelease = function (c) {
111
+ var releaseResponse = createRelease(c) || {};
112
+ var uploadUrl = releaseResponse.upload_url;
109
113
  ok(uploadUrl, 'Missing "upload_url" in release response!');
110
- const { defaults = {} } = c.buildConfig;
111
- const { supportedPlatforms = [] } = defaults;
112
- supportedPlatforms.forEach((platformName) => {
114
+ var _a = c.buildConfig.defaults, defaults = _a === void 0 ? {} : _a;
115
+ var _b = defaults.supportedPlatforms, supportedPlatforms = _b === void 0 ? [] : _b;
116
+ supportedPlatforms.forEach(function (platformName) {
113
117
  uploadZipWithPlatformBuilds(c, platformName, uploadUrl);
114
118
  });
115
119
  deleteFileIfExists(githubReleaseNotesPath);