@24i/smartapps-bigscreen-rnv-build-engine 0.0.2-alpha.1322 → 0.0.2-alpha.1323

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 (64) hide show
  1. package/dist/src/index.js +3 -1
  2. package/dist/src/tasks/deploy/aswS3/deployS3.js +3 -2
  3. package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +12 -9
  4. package/dist/src/tasks/task.rnv.build.js +17 -15
  5. package/dist/src/tasks/task.rnv.configure.js +3 -1
  6. package/dist/src/tasks/task.rnv.configureSoft.js +3 -1
  7. package/dist/src/tasks/task.rnv.deploy.js +5 -2
  8. package/dist/src/tasks/task.rnv.hooks.run.js +4 -2
  9. package/dist/src/utils/forEachSupportedPlatformFlavour.js +8 -8
  10. package/dist/src/utils/getBaseConfig.js +5 -3
  11. package/dist/src/utils/getDeployLocations.js +1 -3
  12. package/dist/src/utils/getVersionOffset.js +4 -4
  13. package/dist/src/utils/replaceRelevantStringsInConfig/replaceTemplateString.js +2 -2
  14. package/engine/src/enginePlatforms.js +16 -0
  15. package/engine/src/index.js +67 -0
  16. package/engine/src/scripts/buildAllWithScheme.js +29 -0
  17. package/engine/src/scripts/gitReleaser/afterVersionBump.js +24 -0
  18. package/engine/src/scripts/gitReleaser/beforeVersionBump.js +15 -0
  19. package/engine/src/scripts/gitReleaser/checkReleaseNotes.js +22 -0
  20. package/engine/src/scripts/gitReleaser/pushRelease.js +41 -0
  21. package/engine/src/scripts/gitReleaser/pushReleaseCandidate.js +8 -0
  22. package/engine/src/scripts/gitReleaser/pushReleaseNotes.js +53 -0
  23. package/engine/src/scripts/release/deleteSourceMaps.js +14 -0
  24. package/engine/src/scripts/release/deployToAppCenter.js +79 -0
  25. package/engine/src/scripts/release/githubRelease.js +138 -0
  26. package/engine/src/scripts/release/notifySlack/makePayload.js +103 -0
  27. package/engine/src/scripts/release/notifySlack/notifySlack.js +26 -0
  28. package/engine/src/scripts/release/notifySlack/slackBlockKitBuilder.js +44 -0
  29. package/engine/src/scripts/release/sentryRelease.js +79 -0
  30. package/engine/src/scripts/release/urlsMarkdown.js +85 -0
  31. package/engine/src/scripts/releaseAllWithScheme.js +91 -0
  32. package/engine/src/scripts/utils/cmdUtils.js +16 -0
  33. package/engine/src/scripts/utils/fsUtils.js +14 -0
  34. package/engine/src/scripts/utils/gitUtils.js +94 -0
  35. package/engine/src/scripts/utils/index.js +11 -0
  36. package/engine/src/scripts/utils/stringUtils.js +5 -0
  37. package/engine/src/sdks/index.js +22 -0
  38. package/engine/src/sdks/sdk-tizen/index.js +287 -0
  39. package/engine/src/sdks/sdk-webos/index.js +201 -0
  40. package/engine/src/sdks/sdk-webpack/index.js +45 -0
  41. package/engine/src/sdks/sdkUtils.js +22 -0
  42. package/engine/src/tasks/deploy/aswS3/aws.js +27 -0
  43. package/engine/src/tasks/deploy/aswS3/deployS3.js +71 -0
  44. package/engine/src/tasks/deploy/hbbtv/deployHbbtv.js +144 -0
  45. package/engine/src/tasks/engineTasks.js +23 -0
  46. package/engine/src/tasks/task.rnv.build.js +126 -0
  47. package/engine/src/tasks/task.rnv.configure.js +52 -0
  48. package/engine/src/tasks/task.rnv.configureSoft.js +31 -0
  49. package/engine/src/tasks/task.rnv.deploy.js +40 -0
  50. package/engine/src/tasks/task.rnv.hooks.run.js +61 -0
  51. package/engine/src/tasks/task.rnv.package.js +27 -0
  52. package/engine/src/tasks/task.rnv.project.configure.js +109 -0
  53. package/engine/src/tasks/task.rnv.start.js +52 -0
  54. package/engine/src/utils/forEachSupportedPlatformFlavour.js +29 -0
  55. package/engine/src/utils/getBaseConfig.js +57 -0
  56. package/engine/src/utils/getDeployLocations.js +78 -0
  57. package/engine/src/utils/getVersionOffset.js +39 -0
  58. package/engine/src/utils/replaceRelevantStringsInConfig/index.js +1 -0
  59. package/engine/src/utils/replaceRelevantStringsInConfig/replaceRelevantStringsInConfig.js +36 -0
  60. package/engine/src/utils/replaceRelevantStringsInConfig/replaceTemplateString.js +70 -0
  61. package/engine/src/utils/resolveBaseUrl.js +35 -0
  62. package/engine/src/utils/resolveBuildVersion.js +47 -0
  63. package/engine/src/utils/zipBuildsByPlatforms.js +70 -0
  64. package/package.json +4 -3
package/dist/src/index.js CHANGED
@@ -32,7 +32,9 @@ var generateEngineExtensions = function generateEngineExtensions() {
32
32
  });
33
33
  });
34
34
  return output;
35
- };
35
+ }; // keeping default export due to rnv
36
+ // eslint-disable-next-line import/no-default-export
37
+
36
38
 
37
39
  var _default = {
38
40
  initializeRuntimeConfig: function initializeRuntimeConfig(c) {
@@ -87,9 +87,10 @@ var deployToS3 = /*#__PURE__*/function () {
87
87
  break;
88
88
  }
89
89
 
90
- process.stdout.write("For ".concat(platform, " platform, only deploying built ZIP package is configured. Skipping deploying app content to AWS S3.\n"));
90
+ // eslint-disable-next-line max-len
91
+ process.stdout.write("For ".concat(platform, " platform, only ZIP package deployment is configured. Skipping deploying app content to AWS S3.\n"));
91
92
  process.stdout.write('Deploy done.\n');
92
- return _context.abrupt("return");
93
+ return _context.abrupt("return", true);
93
94
 
94
95
  case 13:
95
96
  sourceDirPath = isBuildHosted ? "".concat(sourcePath, "-public") : sourcePath;
@@ -146,14 +146,15 @@ var getHbbTVDeployUrl = function getHbbTVDeployUrl() {
146
146
  var scheme = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
147
147
  var appConfigId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
148
148
  var host = deployConfig.host;
149
- return "http://".concat(host, "/").concat(getRemoteBuildDirRelativePath(c, scheme, appConfigId), "/public/index.html");
149
+ var remoteDirRelativePath = getRemoteBuildDirRelativePath(c, scheme, appConfigId);
150
+ return "http://".concat(host, "/").concat(remoteDirRelativePath, "/public/index.html");
150
151
  };
151
152
 
152
153
  exports.getHbbTVDeployUrl = getHbbTVDeployUrl;
153
154
 
154
155
  var deployHbbTV = /*#__PURE__*/function () {
155
156
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(c) {
156
- var remotePaths, dockerContainerName, host, remotePackagePath, dockerExecPrefix, dockerAppDirPath, ssh, indexHtmlParentDirPath;
157
+ var remotePaths, dockerContainerName, host, remotePackagePath, dockerExecPrefix, dockerAppDirPath, ssh, indexHtmlParentDirPath, sourcePath, destPath, cmd;
157
158
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
158
159
  while (1) {
159
160
  switch (_context2.prev = _context2.next) {
@@ -221,20 +222,22 @@ var deployHbbTV = /*#__PURE__*/function () {
221
222
 
222
223
  case 33:
223
224
  log('Copying unzipped build package from host to host\'s docker path...\n');
224
- _context2.next = 36;
225
- return ssh.execCommand("docker cp ".concat(remotePaths.serverTempDirPath, "/. ").concat(dockerContainerName, ":").concat(indexHtmlParentDirPath));
225
+ sourcePath = "".concat(remotePaths.serverTempDirPath, "/.");
226
+ destPath = "".concat(dockerContainerName, ":").concat(indexHtmlParentDirPath);
227
+ cmd = "docker cp ".concat(sourcePath, " ").concat(destPath);
228
+ _context2.next = 39;
229
+ return ssh.execCommand(cmd);
226
230
 
227
- case 36:
231
+ case 39:
228
232
  log('Clearing temporary dir on host side...\n');
229
- _context2.next = 39;
233
+ _context2.next = 42;
230
234
  return ssh.execCommand("rm -Rf ".concat(remotePaths.serverTempDirPath));
231
235
 
232
- case 39:
236
+ case 42:
233
237
  log("\nThe build is deployed at ".concat(getHbbTVDeployUrl(c), "\n"));
234
238
  log('Deploy done.\n');
235
- return _context2.abrupt("return", true);
236
239
 
237
- case 42:
240
+ case 44:
238
241
  case "end":
239
242
  return _context2.stop();
240
243
  }
@@ -35,20 +35,6 @@ var TASK_BUILD = _rnv.Constants.TASK_BUILD,
35
35
  TASK_PACKAGE = _rnv.Constants.TASK_PACKAGE,
36
36
  PARAMS = _rnv.Constants.PARAMS;
37
37
 
38
- var makeZipOutput = function makeZipOutput(c) {
39
- var platformBuildDir = (0, _common.getPlatformBuildDir)(c);
40
- var copiedProjectBuildDir = "".concat(platformBuildDir, "/build");
41
- var defaultZipFileName = "".concat(c.platform, "_").concat(c.runtime.appId, ".zip");
42
- var fileName = makeBuildName(c) || defaultZipFileName;
43
- (0, _child_process.execSync)("cp -r ".concat((0, _common.getPlatformProjectDir)(c), "/public ").concat(copiedProjectBuildDir));
44
- (0, _child_process.execSync)("rm -rf ".concat(platformBuildDir, "/output"));
45
- (0, _child_process.execSync)("mkdir ".concat(platformBuildDir, "/output"));
46
- (0, _child_process.execSync)("zip -r ../output/".concat(fileName, " *"), {
47
- cwd: copiedProjectBuildDir
48
- });
49
- (0, _child_process.execSync)("rm -rf ".concat(copiedProjectBuildDir));
50
- };
51
-
52
38
  var getPackageExtensionByPlatform = function getPackageExtensionByPlatform() {
53
39
  var platform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
54
40
 
@@ -98,6 +84,20 @@ var makeBuildName = function makeBuildName(c) {
98
84
  return "".concat(appNameInFileName, "_").concat(platformName, "_").concat(buildVersion, "_").concat(appConfigId, ".").concat(extension);
99
85
  };
100
86
 
87
+ var makeZipOutput = function makeZipOutput(c) {
88
+ var platformBuildDir = (0, _common.getPlatformBuildDir)(c);
89
+ var copiedProjectBuildDir = "".concat(platformBuildDir, "/build");
90
+ var defaultZipFileName = "".concat(c.platform, "_").concat(c.runtime.appId, ".zip");
91
+ var fileName = makeBuildName(c) || defaultZipFileName;
92
+ (0, _child_process.execSync)("cp -r ".concat((0, _common.getPlatformProjectDir)(c), "/public ").concat(copiedProjectBuildDir));
93
+ (0, _child_process.execSync)("rm -rf ".concat(platformBuildDir, "/output"));
94
+ (0, _child_process.execSync)("mkdir ".concat(platformBuildDir, "/output"));
95
+ (0, _child_process.execSync)("zip -r ../output/".concat(fileName, " *"), {
96
+ cwd: copiedProjectBuildDir
97
+ });
98
+ (0, _child_process.execSync)("rm -rf ".concat(copiedProjectBuildDir));
99
+ };
100
+
101
101
  var renameOutput = function renameOutput(c) {
102
102
  var packageOutputDirPath = "".concat(c.runtime.appDir, "/output");
103
103
  if (!_fs["default"].existsSync(packageOutputDirPath)) return;
@@ -175,7 +175,9 @@ var taskRnvBuild = /*#__PURE__*/function () {
175
175
  return function taskRnvBuild(_x, _x2, _x3) {
176
176
  return _ref.apply(this, arguments);
177
177
  };
178
- }();
178
+ }(); // keeping default export due to rnv
179
+ // eslint-disable-next-line import/no-default-export
180
+
179
181
 
180
182
  exports.taskRnvBuild = taskRnvBuild;
181
183
  var _default = {
@@ -94,7 +94,9 @@ var taskRnvConfigure = /*#__PURE__*/function () {
94
94
  return function taskRnvConfigure(_x, _x2, _x3) {
95
95
  return _ref.apply(this, arguments);
96
96
  };
97
- }();
97
+ }(); // keeping default export due to rnv
98
+ // eslint-disable-next-line import/no-default-export
99
+
98
100
 
99
101
  exports.taskRnvConfigure = taskRnvConfigure;
100
102
  var _default = {
@@ -70,7 +70,9 @@ var taskRnvConfigureSoft = /*#__PURE__*/function () {
70
70
  return function taskRnvConfigureSoft(_x, _x2, _x3) {
71
71
  return _ref.apply(this, arguments);
72
72
  };
73
- }();
73
+ }(); // keeping default export due to rnv
74
+ // eslint-disable-next-line import/no-default-export
75
+
74
76
 
75
77
  exports.taskRnvConfigureSoft = taskRnvConfigureSoft;
76
78
  var _default = {
@@ -55,8 +55,9 @@ var taskRnvDeploy = /*#__PURE__*/function () {
55
55
 
56
56
  case 12:
57
57
  logErrorPlatform(c);
58
+ return _context.abrupt("return", false);
58
59
 
59
- case 13:
60
+ case 14:
60
61
  case "end":
61
62
  return _context.stop();
62
63
  }
@@ -67,7 +68,9 @@ var taskRnvDeploy = /*#__PURE__*/function () {
67
68
  return function taskRnvDeploy(_x, _x2, _x3) {
68
69
  return _ref.apply(this, arguments);
69
70
  };
70
- }();
71
+ }(); // keeping default export due to rnv
72
+ // eslint-disable-next-line import/no-default-export
73
+
71
74
 
72
75
  exports.taskRnvDeploy = taskRnvDeploy;
73
76
  var _default = {
@@ -60,7 +60,7 @@ var taskRnvHooksRun = /*#__PURE__*/function () {
60
60
  break;
61
61
  }
62
62
 
63
- return _context.abrupt("return", Promise.reject('Build hooks have not been compiled properly!'));
63
+ return _context.abrupt("return", Promise.reject(new Error('Build hooks have not been compiled properly!')));
64
64
 
65
65
  case 11:
66
66
  hookName = (_c$program = c.program) === null || _c$program === void 0 ? void 0 : _c$program.exeMethod;
@@ -109,7 +109,9 @@ var taskRnvHooksRun = /*#__PURE__*/function () {
109
109
  return function taskRnvHooksRun(_x, _x2, _x3) {
110
110
  return _ref.apply(this, arguments);
111
111
  };
112
- }();
112
+ }(); // keeping default export due to rnv
113
+ // eslint-disable-next-line import/no-default-export
114
+
113
115
 
114
116
  exports.taskRnvHooksRun = taskRnvHooksRun;
115
117
  var _default = {
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.forEachSupportedPlatformFlavour = void 0;
7
7
 
8
- var makeCurrentStateMessage = function makeCurrentStateMessage(supportedPlatforms, platformIndex, supportedFlavours, flavourIndex) {
9
- var string = "\nProcessing \"".concat(supportedPlatforms[platformIndex], "\" platform");
10
- string += " (".concat(platformIndex + 1, "/").concat(supportedPlatforms.length, ")");
11
- string += " and its \"".concat(supportedFlavours[flavourIndex], "\" flavour");
12
- string += " (".concat(flavourIndex + 1, "/").concat(supportedFlavours.length, ")...");
8
+ var getProgressMessage = function getProgressMessage(platforms, platformIndex, flavours, flavourIndex) {
9
+ var string = "\nProcessing \"".concat(platforms[platformIndex], "\" platform");
10
+ string += " (".concat(platformIndex + 1, "/").concat(platforms.length, ")");
11
+ string += " and its \"".concat(flavours[flavourIndex], "\" flavour");
12
+ string += " (".concat(flavourIndex + 1, "/").concat(flavours.length, ")...");
13
13
  return string;
14
14
  };
15
15
 
16
16
  var forEachSupportedPlatformFlavour = function forEachSupportedPlatformFlavour(c, cb) {
17
- var processPlatformFlavours = function processPlatformFlavours(platform, platformIndex, supportedPlatforms) {
17
+ var processPlatformFlavours = function processPlatformFlavours(platform, platformIndex, platforms) {
18
18
  var _c$buildConfig$platfo;
19
19
 
20
- var processFlavour = function processFlavour(flavour, flavourIndex, supportedFlavours) {
21
- console.log(makeCurrentStateMessage(supportedPlatforms, platformIndex, supportedFlavours, flavourIndex));
20
+ var processFlavour = function processFlavour(flavour, flavourIndex, flavours) {
21
+ console.log(getProgressMessage(platforms, platformIndex, flavours, flavourIndex));
22
22
  return cb({
23
23
  platform: platform,
24
24
  flavour: flavour,
@@ -37,14 +37,14 @@ var mergeDeep = function mergeDeep(target) {
37
37
  var source = sources.shift();
38
38
 
39
39
  if (isObject(target) && isObject(source)) {
40
- for (var key in source) {
40
+ Object.keys(source).forEach(function (key) {
41
41
  if (isObject(source[key])) {
42
42
  if (!target[key]) Object.assign(target, _defineProperty({}, key, {}));
43
43
  mergeDeep(target[key], source[key]);
44
44
  } else {
45
45
  Object.assign(target, _defineProperty({}, key, source[key]));
46
46
  }
47
- }
47
+ });
48
48
  }
49
49
 
50
50
  return mergeDeep.apply(void 0, [target].concat(sources));
@@ -72,7 +72,9 @@ var getBaseConfig = function getBaseConfig() {
72
72
 
73
73
  mergeFileJsonIntoObject(c.paths.project.config, c.buildConfig); // appConfigs/base/renative.json
74
74
 
75
- mergeFileJsonIntoObject(_path["default"].join(c.paths.project.appConfigBase.dir, 'renative.json'), c.buildConfig);
75
+ var baseConfigPath = _path["default"].join(c.paths.project.appConfigBase.dir, 'renative.json');
76
+
77
+ mergeFileJsonIntoObject(baseConfigPath, c.buildConfig);
76
78
  (0, _replaceRelevantStringsInConfig.replaceRelevantStringsInConfig)(c);
77
79
  return c;
78
80
  };
@@ -7,8 +7,6 @@ exports.getDeployLocations = void 0;
7
7
 
8
8
  var _fs = _interopRequireDefault(require("fs"));
9
9
 
10
- var _common = require("rnv/dist/core/common");
11
-
12
10
  var _deployHbbtv = require("../tasks/deploy/hbbtv/deployHbbtv");
13
11
 
14
12
  var _resolveBaseUrl = require("./resolveBaseUrl");
@@ -77,7 +75,7 @@ var makeUrls = function makeUrls(c, platformName, flavourName) {
77
75
  scheme: c.runtime.scheme || '',
78
76
  appConfigId: flavourName
79
77
  });
80
- if (!baseUrl) return;
78
+ if (!baseUrl) return null;
81
79
  var packageOutputDirPath = "platformBuilds/".concat(flavourName, "_").concat(platformName, "/output");
82
80
 
83
81
  var outputFilenameList = _fs["default"].readdirSync(packageOutputDirPath);
@@ -16,13 +16,13 @@ var getCurrentGitBranchName = function getCurrentGitBranchName() {
16
16
  }).toString().trim();
17
17
  };
18
18
 
19
- var getMergedPullRequestsOffsetFromBranch = function getMergedPullRequestsOffsetFromBranch(branchName) {
19
+ var getMergedPullRequestsOffsetFromBranch = function getMergedPullRequestsOffsetFromBranch(branch) {
20
20
  var defaultValue = '';
21
+ var mergeTitleRegex = '^Merge pull request #'; // it's a default title for GitHub
21
22
 
22
- try {
23
- var mergeTitleRegex = '^Merge pull request #'; // it's a default title for GitHub
23
+ var cmd = "git rev-list --count --merges --grep=\"".concat(mergeTitleRegex, "\" HEAD ^origin/").concat(branch);
24
24
 
25
- var cmd = "git rev-list --count --merges --grep=\"".concat(mergeTitleRegex, "\" HEAD ^origin/").concat(branchName);
25
+ try {
26
26
  var diffCount = (0, _child_process.execSync)(cmd, {
27
27
  stdio: 'pipe'
28
28
  }).toString().trim();
@@ -79,8 +79,8 @@ var replaceTemplateString = function replaceTemplateString(c) {
79
79
  if (!string || typeof string !== 'string') return '';
80
80
 
81
81
  var replacer = function replacer(match) {
82
- var stringBetweenBracelets = match.slice(injectorStartMark.length, -injectorEndMark.length);
83
- var value = getValue(c, stringBetweenBracelets);
82
+ var stringInBracelets = match.slice(injectorStartMark.length, -injectorEndMark.length);
83
+ var value = getValue(c, stringInBracelets);
84
84
  return value === match ? value : replaceTemplateString(c, value);
85
85
  };
86
86
 
@@ -0,0 +1,16 @@
1
+ const enginePlatforms = {
2
+ ENTONE: 'entone',
3
+ HBBTV: 'hbbtv',
4
+ TIZEN: 'tizen',
5
+ WEBOS: 'webos',
6
+ WEBTV: 'webtv',
7
+ };
8
+
9
+ const enginePlatformList = Object
10
+ .keys(enginePlatforms)
11
+ .map((platform) => platform);
12
+
13
+ export {
14
+ enginePlatforms,
15
+ enginePlatformList,
16
+ };
@@ -0,0 +1,67 @@
1
+ import { EngineManager, Config } from 'rnv';
2
+ import CNF from '../../renative.engine.json';
3
+ import { enginePlatforms } from './enginePlatforms';
4
+ import { engineTaskList } from './tasks/engineTasks';
5
+
6
+ const { generateEngineTasks } = EngineManager;
7
+
8
+ const generateEngineExtensions = (platformExtensions = []) => {
9
+ const fileExtensions = ['js', 'jsx', 'ts', 'tsx', 'json'];
10
+ const output = [];
11
+
12
+ fileExtensions.forEach((fileExtension) => {
13
+ output.push(fileExtension);
14
+
15
+ platformExtensions.forEach((platformExtension) => {
16
+ output.push(`${platformExtension}.${fileExtension}`);
17
+ });
18
+ });
19
+
20
+ return output;
21
+ };
22
+
23
+ // keeping default export due to rnv
24
+ // eslint-disable-next-line import/no-default-export
25
+ export default {
26
+ initializeRuntimeConfig: (c) => Config.initializeConfig(c),
27
+ tasks: generateEngineTasks(engineTaskList),
28
+ config: CNF,
29
+ projectDirName: 'project',
30
+ serverDirName: 'server',
31
+ ejectPlatform: null,
32
+ platforms: {
33
+ [enginePlatforms.ENTONE]: {
34
+ // NOTE: 'extenstions' is correct property name here.
35
+ // It's a typo in rnv which needs to be fixed in core.
36
+ extenstions: generateEngineExtensions(['entone']),
37
+ defaultPort: 8095,
38
+
39
+ },
40
+ [enginePlatforms.HBBTV]: {
41
+ // NOTE: 'extenstions' is correct property name here.
42
+ // It's a typo in rnv which needs to be fixed in core.
43
+ extenstions: generateEngineExtensions(['hbbtv.tv']),
44
+ defaultPort: 8096,
45
+
46
+ },
47
+ [enginePlatforms.TIZEN]: {
48
+ // NOTE: 'extenstions' is correct property name here.
49
+ // It's a typo in rnv which needs to be fixed in core.
50
+ extenstions: generateEngineExtensions(['tizen.tv']),
51
+ defaultPort: 8087,
52
+
53
+ },
54
+ [enginePlatforms.WEBOS]: {
55
+ // NOTE: 'extenstions' is correct property name here.
56
+ // It's a typo in rnv which needs to be fixed in core.
57
+ extenstions: generateEngineExtensions(['webos.tv']),
58
+ defaultPort: 8088,
59
+ },
60
+ [enginePlatforms.WEBTV]: {
61
+ // NOTE: 'extenstions' is correct property name here.
62
+ // It's a typo in rnv which needs to be fixed in core.
63
+ extenstions: generateEngineExtensions(['webtv']),
64
+ defaultPort: 8080,
65
+ },
66
+ },
67
+ };
@@ -0,0 +1,29 @@
1
+ import { execSync } from 'child_process';
2
+ import { forEachSupportedPlatformFlavour } from '../utils/forEachSupportedPlatformFlavour';
3
+ import { getBaseConfig } from '../utils/getBaseConfig';
4
+
5
+ const buildTask = (options) => {
6
+ const { scheme, platform, flavour } = options;
7
+ const cmd = `npx rnv build -s ${scheme} -p ${platform} -c ${flavour} --ci`;
8
+ execSync(cmd, { stdio: 'inherit' });
9
+ };
10
+
11
+ const buildAllWithScheme = () => {
12
+ const scheme = process.argv[2];
13
+ if (!scheme) {
14
+ throw new Error ('No scheme name to use found! Please use rnv scheme name as a param.');
15
+ }
16
+
17
+ const c = getBaseConfig();
18
+ c.runtime.scheme = scheme;
19
+
20
+ forEachSupportedPlatformFlavour(c, buildTask);
21
+ return true;
22
+ };
23
+
24
+ const startTimestamp = Date.now();
25
+
26
+ buildAllWithScheme();
27
+
28
+ const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / 1000);
29
+ console.log(`buildAllWithScheme: done in ${scriptTotalTimeInSeconds} second(s)!`);
@@ -0,0 +1,24 @@
1
+ import { getBaseConfig } from '../../utils/getBaseConfig';
2
+ import { addAll, checkout, createBranch, commit, push } from '../utils/gitUtils';
3
+
4
+ const c = getBaseConfig();
5
+
6
+ const { branchNames = {}, commitTitles = {} } = c.buildConfig?.common?.git || {};
7
+ const { packageVersion = '' } = c.buildConfig?.common || {};
8
+
9
+ const newReleaseBranchName = branchNames.rc;
10
+
11
+ createBranch(newReleaseBranchName);
12
+ checkout(newReleaseBranchName);
13
+ addAll(); // add version changes into a git stage
14
+
15
+ const withNoVerifyFlag = true;
16
+
17
+ console.log('Creating commit with changed version...');
18
+ commit(commitTitles.versionBump, withNoVerifyFlag);
19
+
20
+ console.log(`Pushing ${newReleaseBranchName} branch...`);
21
+ push(newReleaseBranchName, withNoVerifyFlag);
22
+
23
+ console.log(`\nDone! The version has been bumped to ${packageVersion} and ${newReleaseBranchName} branch pushed into the remote repository.`);
24
+ console.log('Note: Do not forget to update release notes for upcoming release!');
@@ -0,0 +1,15 @@
1
+ import { strict } from 'assert';
2
+ import { getBaseConfig } from '../../utils/getBaseConfig';
3
+ import { assertCurrentBranch, assertEmptyStatusList } from '../utils/gitUtils';
4
+
5
+ const { ok } = strict;
6
+
7
+ const c = getBaseConfig();
8
+ const { branchNames = {}, commitTitles = {} } = c.buildConfig?.common?.git || {};
9
+
10
+ ok(branchNames.dev);
11
+ ok(branchNames.rc);
12
+ ok(commitTitles.versionBump);
13
+
14
+ assertCurrentBranch(branchNames.dev);
15
+ assertEmptyStatusList();
@@ -0,0 +1,22 @@
1
+ import { strict } from 'assert';
2
+ import { fsUtils } from '../utils';
3
+
4
+ const { ok } = strict;
5
+
6
+ const checkReleaseNotes = (c) => {
7
+ const { relativePath, requiredRows = [] } = c.buildConfig?.common?.releaseNotes || {};
8
+
9
+ fsUtils.assertPath(relativePath);
10
+ const fileContent = fsUtils.getFileContentAsString(relativePath);
11
+
12
+ const assertFileContentRow = (expectedRowContent) => {
13
+ const errorMsg = `File ${relativePath} should contain following row: "${expectedRowContent}"`;
14
+ ok(fileContent.includes(expectedRowContent), errorMsg);
15
+ };
16
+
17
+ requiredRows.forEach(assertFileContentRow);
18
+ };
19
+
20
+ export {
21
+ checkReleaseNotes,
22
+ };
@@ -0,0 +1,41 @@
1
+ import { strict } from 'assert';
2
+ import { getBaseConfig } from '../../utils/getBaseConfig';
3
+ import { gitUtils } from '../utils';
4
+ import { checkReleaseNotes } from './checkReleaseNotes';
5
+
6
+ const { ok } = strict;
7
+
8
+ const c = getBaseConfig();
9
+ const { branchNames = {}, pullRequestTitles } = c.buildConfig?.common?.git || {};
10
+
11
+ const rcBranchName = branchNames.rc;
12
+ const distBranchName = branchNames.dist;
13
+ const devBranchName = branchNames.dev;
14
+
15
+ ok(rcBranchName);
16
+ ok(distBranchName);
17
+ ok(devBranchName);
18
+
19
+ gitUtils.assertCurrentBranch(rcBranchName);
20
+ gitUtils.assertEmptyStatusList();
21
+ gitUtils.assertRemoteBranch(rcBranchName);
22
+ gitUtils.assertRemoteBranch(distBranchName);
23
+
24
+ const distributionPrTitle = pullRequestTitles.rcToDist;
25
+ const developmentPrTitle = pullRequestTitles.rcToDev;
26
+
27
+ ok(distributionPrTitle);
28
+ ok(developmentPrTitle);
29
+
30
+ gitUtils.pull();
31
+ checkReleaseNotes(c);
32
+
33
+ console.log(`Creating Pull Request from ${rcBranchName} branch to ${distBranchName} branch...`);
34
+ console.log(`Applied PR title: "${distributionPrTitle}"`);
35
+ gitUtils.pullRequest(rcBranchName, distBranchName, distributionPrTitle);
36
+
37
+ console.log(`\nCreating Pull Request from ${rcBranchName} branch to ${devBranchName} branch...`);
38
+ console.log(`Applied PR title: "${developmentPrTitle}"`);
39
+ gitUtils.pullRequest(rcBranchName, devBranchName, developmentPrTitle);
40
+
41
+ console.log('\nDone! Pull requests have been created!');
@@ -0,0 +1,8 @@
1
+ import { execSync } from 'child_process';
2
+
3
+ console.log('Bumping the version...');
4
+ const bumpType = process.argv[2] || 'patch'; // major | minor | patch
5
+ execSync(`npm --no-git-tag-version version ${bumpType}`, { stdio: 'inherit' });
6
+
7
+ // If preversion, version, or postversion are in the scripts property of the package.json,
8
+ // they will be executed as part of running npm version.
@@ -0,0 +1,53 @@
1
+ import { strict } from 'assert';
2
+ import { getBaseConfig } from '../../utils/getBaseConfig';
3
+ import { gitUtils } from '../utils';
4
+ import { checkReleaseNotes } from './checkReleaseNotes';
5
+
6
+ const { ok } = strict;
7
+
8
+ const pushReleaseNotes = () => {
9
+ const c = getBaseConfig();
10
+ const { branchNames = {}, commitTitles = {}, pullRequestTitles = {} } = c.buildConfig?.common?.git || {};
11
+ const { relativePath = [] } = c.buildConfig?.common?.releaseNotes || {};
12
+
13
+ const rcBranchName = branchNames.rc;
14
+ const releaseNotesBranchName = branchNames.rcReleaseNotes;
15
+
16
+ const commitTitle = commitTitles.rcReleaseNotes;
17
+ const prTitle = pullRequestTitles.releaseNotesToRc;
18
+
19
+ ok(relativePath);
20
+ ok(releaseNotesBranchName);
21
+ ok(commitTitle);
22
+ ok(prTitle);
23
+
24
+ gitUtils.assertCurrentBranch(rcBranchName);
25
+ gitUtils.assertRemoteBranch(rcBranchName);
26
+
27
+ checkReleaseNotes(c);
28
+ gitUtils.pull();
29
+
30
+ const changedFilesCount = gitUtils.statusList().length;
31
+
32
+ if (changedFilesCount === 0) {
33
+ console.log(`It seems ${relativePath} file has been updated before.`);
34
+ console.log('Excluding making a commit, if needed, please continue on your own (manually).');
35
+ return;
36
+ }
37
+
38
+ ok(changedFilesCount === 1, `Only ${relativePath} should contain changes!`);
39
+
40
+ gitUtils.createBranch(releaseNotesBranchName);
41
+ gitUtils.checkout(releaseNotesBranchName);
42
+
43
+ gitUtils.add([relativePath]);
44
+ gitUtils.commit(commitTitle);
45
+ gitUtils.push(releaseNotesBranchName, true); // `true` is for push with --no-verify flag
46
+
47
+ console.log('Creating pull request with updated release notes...');
48
+ gitUtils.pullRequest(releaseNotesBranchName, rcBranchName, prTitle);
49
+
50
+ console.log('Done! Pull request has been created!');
51
+ }
52
+
53
+ pushReleaseNotes();
@@ -0,0 +1,14 @@
1
+ import { execSync } from 'child_process';
2
+
3
+ const executeSync = (cmd) => execSync(cmd, { stdio: 'inherit' });
4
+
5
+ const deleteSourceMaps = (c) => {
6
+ const { platformBuildsDir } = c.buildConfig.paths;
7
+ executeSync(`find ${platformBuildsDir} -type f -iname "*.map" -delete`);
8
+
9
+ console.log('Source Maps deleted...');
10
+ };
11
+
12
+ export {
13
+ deleteSourceMaps,
14
+ };