@24i/smartapps-bigscreen-rnv-build-engine 0.8.7-alpha.1417 → 0.8.7-alpha.1421

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 (113) hide show
  1. package/README.md +1 -2
  2. package/coverage/clover.xml +199 -0
  3. package/coverage/coverage-final.json +10 -0
  4. package/coverage/lcov-report/base.css +224 -0
  5. package/coverage/lcov-report/block-navigation.js +79 -0
  6. package/coverage/lcov-report/clean.ts.html +113 -0
  7. package/coverage/lcov-report/download.ts.html +260 -0
  8. package/coverage/lcov-report/favicon.png +0 -0
  9. package/coverage/lcov-report/index.html +141 -0
  10. package/coverage/lcov-report/index.ts.html +86 -0
  11. package/coverage/lcov-report/install.ts.html +161 -0
  12. package/coverage/lcov-report/prettify.css +1 -0
  13. package/coverage/lcov-report/prettify.js +2 -0
  14. package/coverage/lcov-report/registerSdkPath.ts.html +134 -0
  15. package/coverage/lcov-report/sdk-installer/index.html +126 -0
  16. package/coverage/lcov-report/sdk-installer/index.ts.html +83 -0
  17. package/coverage/lcov-report/sdk-installer/sdkInstaller.ts.html +233 -0
  18. package/coverage/lcov-report/sdk-installer/services/clean.ts.html +113 -0
  19. package/coverage/lcov-report/sdk-installer/services/download.ts.html +260 -0
  20. package/coverage/lcov-report/sdk-installer/services/index.html +171 -0
  21. package/coverage/lcov-report/sdk-installer/services/index.ts.html +92 -0
  22. package/coverage/lcov-report/sdk-installer/services/install.ts.html +161 -0
  23. package/coverage/lcov-report/sdk-installer/services/unzip.ts.html +116 -0
  24. package/coverage/lcov-report/sdk-utils/index.html +126 -0
  25. package/coverage/lcov-report/sdk-utils/index.ts.html +86 -0
  26. package/coverage/lcov-report/sdk-utils/installSdk.ts.html +113 -0
  27. package/coverage/lcov-report/sdk-utils/registerSdkPath.ts.html +134 -0
  28. package/coverage/lcov-report/sdk-utils/sdk-installer/index.html +126 -0
  29. package/coverage/lcov-report/sdk-utils/sdk-installer/index.ts.html +83 -0
  30. package/coverage/lcov-report/sdk-utils/sdk-installer/sdkInstaller.ts.html +224 -0
  31. package/coverage/lcov-report/sdk-utils/sdk-installer/services/clean.ts.html +113 -0
  32. package/coverage/lcov-report/sdk-utils/sdk-installer/services/download.ts.html +260 -0
  33. package/coverage/lcov-report/sdk-utils/sdk-installer/services/index.html +171 -0
  34. package/coverage/lcov-report/sdk-utils/sdk-installer/services/index.ts.html +92 -0
  35. package/coverage/lcov-report/sdk-utils/sdk-installer/services/install.ts.html +161 -0
  36. package/coverage/lcov-report/sdk-utils/sdk-installer/services/unzip.ts.html +116 -0
  37. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  38. package/coverage/lcov-report/sorter.js +170 -0
  39. package/coverage/lcov-report/unzip.ts.html +116 -0
  40. package/coverage/lcov.info +371 -0
  41. package/dist/src/__tests__/sdks/sdk-utils/registerSdkPath.spec.js +60 -0
  42. package/dist/src/__tests__/sdks/sdk-utils/sdk-installer/sdkInstaller.spec.js +85 -0
  43. package/dist/src/__tests__/sdks/sdk-utils/sdk-installer/services/clean.spec.js +46 -0
  44. package/dist/src/__tests__/sdks/sdk-utils/sdk-installer/services/download.spec.js +121 -0
  45. package/dist/src/__tests__/sdks/sdk-utils/sdk-installer/services/install.spec.js +53 -0
  46. package/dist/src/__tests__/sdks/sdk-utils/sdk-installer/services/unzip.spec.js +47 -0
  47. package/dist/src/resolvers/resolveBaseUrl.js +1 -1
  48. package/dist/src/resolvers/resolveBuildFileName.js +2 -2
  49. package/dist/src/resolvers/resolveBuildVersion.js +2 -2
  50. package/dist/src/resolvers/resolveBuildVersionOffset.js +2 -2
  51. package/dist/src/resolvers/resolveDeployLocations.js +5 -5
  52. package/dist/src/resolvers/resolveGenericRnvConfig.js +2 -2
  53. package/dist/src/resolvers/resolveHbbtvDeployUrl.js +2 -2
  54. package/dist/src/resolvers/resolveUsedFlavours.js +1 -1
  55. package/dist/src/scripts/buildAllWithScheme.js +3 -3
  56. package/dist/src/scripts/generateDeployUrls/index.js +4 -4
  57. package/dist/src/scripts/generateDeployUrls/makeTableDataByScheme.js +3 -3
  58. package/dist/src/scripts/gitReleaser/afterVersionBump.js +6 -6
  59. package/dist/src/scripts/gitReleaser/beforeVersionBump.js +6 -6
  60. package/dist/src/scripts/gitReleaser/checkReleaseNotes.js +1 -1
  61. package/dist/src/scripts/gitReleaser/pushRelease.js +7 -7
  62. package/dist/src/scripts/gitReleaser/pushReleaseCandidate.js +1 -1
  63. package/dist/src/scripts/gitReleaser/pushReleaseNotes.js +7 -7
  64. package/dist/src/scripts/release/deleteSourceMaps.js +1 -1
  65. package/dist/src/scripts/release/deployToAppCenter.js +6 -6
  66. package/dist/src/scripts/release/githubRelease.js +16 -16
  67. package/dist/src/scripts/release/notifySlack/makePayload.js +1 -1
  68. package/dist/src/scripts/release/notifySlack/notifySlack.js +1 -1
  69. package/dist/src/scripts/release/sentryRelease.js +3 -3
  70. package/dist/src/scripts/release/urlsMarkdown.js +1 -1
  71. package/dist/src/scripts/releaseAllWithScheme.js +11 -11
  72. package/dist/src/scripts/utils/cmdUtils.js +1 -1
  73. package/dist/src/scripts/utils/fsUtils.js +1 -1
  74. package/dist/src/scripts/utils/gitUtils.js +17 -17
  75. package/dist/src/sdks/sdk-tizen/index.js +10 -10
  76. package/dist/src/sdks/sdk-utils/index.js +14 -0
  77. package/dist/src/sdks/sdk-utils/registerSdkPath.js +14 -0
  78. package/dist/src/sdks/sdk-utils/sdk-installer/index.js +5 -0
  79. package/dist/src/sdks/sdk-utils/sdk-installer/sdkInstaller.js +39 -0
  80. package/dist/src/sdks/sdk-utils/sdk-installer/services/clean.js +11 -0
  81. package/dist/src/sdks/sdk-utils/sdk-installer/services/download.js +74 -0
  82. package/dist/src/sdks/sdk-utils/sdk-installer/services/index.js +11 -0
  83. package/dist/src/sdks/sdk-utils/sdk-installer/services/install.js +23 -0
  84. package/dist/src/sdks/sdk-utils/sdk-installer/services/unzip.js +12 -0
  85. package/dist/src/sdks/sdk-webos/index.js +5 -5
  86. package/dist/src/tasks/deploy/aswS3/aws.js +2 -2
  87. package/dist/src/tasks/deploy/aswS3/deployS3.js +2 -2
  88. package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +7 -7
  89. package/dist/src/tasks/task.rnv.build.js +8 -8
  90. package/dist/src/tasks/task.rnv.configure.js +1 -1
  91. package/dist/src/tasks/task.rnv.configureSoft.js +2 -2
  92. package/dist/src/tasks/task.rnv.deploy.js +3 -3
  93. package/dist/src/tasks/task.rnv.hooks.run.js +1 -1
  94. package/dist/src/tasks/task.rnv.project.configure.js +2 -2
  95. package/dist/src/utils/forEachSupportedPlatformFlavour.js +1 -1
  96. package/dist/src/utils/replaceRelevantStringsInConfig/replaceRelevantStringsInConfig.js +1 -1
  97. package/dist/src/utils/replaceRelevantStringsInConfig/replaceTemplateString.js +1 -1
  98. package/dist/src/utils/zipBuildsByPlatforms.js +9 -9
  99. package/dist/templates/platforms/entone/webpack.config.dev.js +1 -1
  100. package/dist/templates/platforms/entone/webpack.config.prod.js +1 -1
  101. package/dist/templates/platforms/hbbtv/webpack.config.dev.js +1 -1
  102. package/dist/templates/platforms/hbbtv/webpack.config.prod.js +1 -1
  103. package/dist/templates/platforms/saphi/webpack.config.dev.js +1 -1
  104. package/dist/templates/platforms/saphi/webpack.config.prod.js +1 -1
  105. package/dist/templates/platforms/tizen/webpack.config.dev.js +1 -1
  106. package/dist/templates/platforms/tizen/webpack.config.prod.js +1 -1
  107. package/dist/templates/platforms/webos/webpack.config.dev.js +1 -1
  108. package/dist/templates/platforms/webos/webpack.config.prod.js +1 -1
  109. package/dist/templates/platforms/webtv/webpack.config.dev.js +1 -1
  110. package/dist/templates/platforms/webtv/webpack.config.prod.js +1 -1
  111. package/jest.config.js +6 -0
  112. package/package.json +22 -25
  113. package/dist/src/sdks/sdkUtils.js +0 -18
@@ -13,11 +13,11 @@ const constants_1 = require("../constants");
13
13
  const deployTask = (options) => {
14
14
  const { scheme, platform, flavour } = options;
15
15
  const cmd = `npx rnv deploy -s ${scheme} -p ${platform} -c ${flavour} --ci --only`;
16
- (0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
16
+ child_process_1.execSync(cmd, { stdio: 'inherit' });
17
17
  };
18
18
  const deployBuilds = (c) => {
19
19
  console.log('Deploying the builds...');
20
- (0, forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour)(c, deployTask);
20
+ forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour(c, deployTask);
21
21
  return true;
22
22
  };
23
23
  const doLatestDevelopmentRelease = (c) => {
@@ -27,7 +27,7 @@ const doLatestDevelopmentRelease = (c) => {
27
27
  const doLatestReleaseCandidateRelease = (c) => {
28
28
  console.log('doLatestReleaseCandidateRelease');
29
29
  deployBuilds(c);
30
- (0, notifySlack_1.notifySlack)(c);
30
+ notifySlack_1.notifySlack(c);
31
31
  return true;
32
32
  };
33
33
  const doLatestRelease = (c) => {
@@ -36,13 +36,13 @@ const doLatestRelease = (c) => {
36
36
  };
37
37
  const doDistributionRelease = (c) => {
38
38
  console.log('doDistributionRelease');
39
- (0, zipBuildsByPlatforms_1.zipBuildsByPlatforms)(c);
39
+ zipBuildsByPlatforms_1.zipBuildsByPlatforms(c);
40
40
  deployBuilds(c);
41
- (0, sentryRelease_1.sentryRelease)(c);
42
- (0, deleteSourceMaps_1.deleteSourceMaps)(c);
43
- (0, githubRelease_1.githubRelease)(c);
44
- (0, deployToAppCenter_1.deployToAppCenter)(c);
45
- (0, notifySlack_1.notifySlack)(c);
41
+ sentryRelease_1.sentryRelease(c);
42
+ deleteSourceMaps_1.deleteSourceMaps(c);
43
+ githubRelease_1.githubRelease(c);
44
+ deployToAppCenter_1.deployToAppCenter(c);
45
+ notifySlack_1.notifySlack(c);
46
46
  return true;
47
47
  };
48
48
  const releaseAllWithScheme = () => {
@@ -50,7 +50,7 @@ const releaseAllWithScheme = () => {
50
50
  if (!scheme) {
51
51
  throw new Error('No scheme name to use found! Please use rnv scheme name as a param.');
52
52
  }
53
- const c = (0, resolvers_1.getBaseConfig)();
53
+ const c = resolvers_1.getBaseConfig();
54
54
  c.runtime.scheme = scheme;
55
55
  switch (scheme) {
56
56
  case constants_1.BuildSchemes.DEV_LATEST:
@@ -69,7 +69,7 @@ const releaseAllWithScheme = () => {
69
69
  throw new Error('Unsupported scheme to release!');
70
70
  }
71
71
  const spacing = 4;
72
- console.log(JSON.stringify((0, resolvers_1.resolveDeployLocations)(c), null, spacing));
72
+ console.log(JSON.stringify(resolvers_1.resolveDeployLocations(c), null, spacing));
73
73
  return true;
74
74
  };
75
75
  const startTimestamp = Date.now();
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cmdSyncTrimOut = exports.cmdSyncPipeOut = exports.cmdSyncInheritOut = exports.cmdSync = void 0;
4
4
  const child_process_1 = require("child_process");
5
- const cmdSync = (command, options) => (0, child_process_1.execSync)(command, options);
5
+ const cmdSync = (command, options) => child_process_1.execSync(command, options);
6
6
  exports.cmdSync = cmdSync;
7
7
  const cmdSyncInheritOut = (command) => cmdSync(command, { stdio: 'inherit' });
8
8
  exports.cmdSyncInheritOut = cmdSyncInheritOut;
@@ -26,7 +26,7 @@ const getFileContentAsString = (filePath) => fs.readFileSync(filePath).toString(
26
26
  exports.getFileContentAsString = getFileContentAsString;
27
27
  const assertPath = (path) => {
28
28
  const errorMsg = `File or path ${path} does not exist!`;
29
- (0, assert_1.ok)(fs.existsSync(path), errorMsg);
29
+ assert_1.ok(fs.existsSync(path), errorMsg);
30
30
  };
31
31
  exports.assertPath = assertPath;
32
32
  const isDir = (verifiedPath) => (fs.existsSync(verifiedPath) && fs.lstatSync(verifiedPath).isDirectory());
@@ -6,7 +6,7 @@ const cmdUtils_1 = require("./cmdUtils");
6
6
  const stringUtils_1 = require("./stringUtils");
7
7
  const statusList = () => {
8
8
  const gitCmd = 'git status --porcelain';
9
- const outputString = (0, cmdUtils_1.cmdSyncTrimOut)(gitCmd);
9
+ const outputString = cmdUtils_1.cmdSyncTrimOut(gitCmd);
10
10
  if (!outputString)
11
11
  return [];
12
12
  const handleMultipleWhitespaces = (rowString) => {
@@ -14,65 +14,65 @@ const statusList = () => {
14
14
  const parts = rowString.split(spaceChar);
15
15
  return parts.filter(Boolean).join(spaceChar);
16
16
  };
17
- return (0, stringUtils_1.splitByNewLine)(outputString).map(handleMultipleWhitespaces);
17
+ return stringUtils_1.splitByNewLine(outputString).map(handleMultipleWhitespaces);
18
18
  };
19
19
  exports.statusList = statusList;
20
- const getCurrentBranchName = () => (0, cmdUtils_1.cmdSyncTrimOut)('git branch --show-current');
20
+ const getCurrentBranchName = () => cmdUtils_1.cmdSyncTrimOut('git branch --show-current');
21
21
  exports.getCurrentBranchName = getCurrentBranchName;
22
22
  const pullRequest = (fromBranch, toBranch, prTitle) => {
23
23
  const cmdTool = 'hub';
24
24
  const installDocUrl = 'https://github.com/github/hub#installation';
25
25
  const errorMsg = `${cmdTool} is not installed! See ${installDocUrl}\n`;
26
26
  try {
27
- const toolPath = (0, cmdUtils_1.cmdSyncTrimOut)(`${cmdTool} --version`);
28
- (0, assert_1.ok)(toolPath, errorMsg);
27
+ const toolPath = cmdUtils_1.cmdSyncTrimOut(`${cmdTool} --version`);
28
+ assert_1.ok(toolPath, errorMsg);
29
29
  }
30
30
  catch (error) {
31
31
  throw new Error(errorMsg);
32
32
  }
33
33
  const cmd = `${cmdTool} pull-request -m "${prTitle}" --head ${fromBranch} --base ${toBranch}`;
34
- (0, cmdUtils_1.cmdSyncInheritOut)(cmd);
34
+ cmdUtils_1.cmdSyncInheritOut(cmd);
35
35
  };
36
36
  exports.pullRequest = pullRequest;
37
37
  const remoteBranchExists = (expectedBranchName) => {
38
38
  const gitCmd = `git ls-remote --heads origin ${expectedBranchName}`;
39
- const output = (0, cmdUtils_1.cmdSyncTrimOut)(gitCmd);
39
+ const output = cmdUtils_1.cmdSyncTrimOut(gitCmd);
40
40
  return Boolean(output);
41
41
  };
42
42
  exports.remoteBranchExists = remoteBranchExists;
43
- const pull = () => (0, cmdUtils_1.cmdSyncPipeOut)('git remote update -p && git merge --ff-only @{u}');
43
+ const pull = () => cmdUtils_1.cmdSyncPipeOut('git remote update -p && git merge --ff-only @{u}');
44
44
  exports.pull = pull;
45
- const addAll = () => (0, cmdUtils_1.cmdSyncPipeOut)('git add --all');
45
+ const addAll = () => cmdUtils_1.cmdSyncPipeOut('git add --all');
46
46
  exports.addAll = addAll;
47
- const add = (fileList) => (0, cmdUtils_1.cmdSyncPipeOut)(`git add ${fileList.join(' ')}`);
47
+ const add = (fileList) => cmdUtils_1.cmdSyncPipeOut(`git add ${fileList.join(' ')}`);
48
48
  exports.add = add;
49
- const checkout = (branchName) => (0, cmdUtils_1.cmdSyncPipeOut)(`git checkout ${branchName}`);
49
+ const checkout = (branchName) => cmdUtils_1.cmdSyncPipeOut(`git checkout ${branchName}`);
50
50
  exports.checkout = checkout;
51
- const createBranch = (branchName) => (0, cmdUtils_1.cmdSyncPipeOut)(`git branch ${branchName}`);
51
+ const createBranch = (branchName) => cmdUtils_1.cmdSyncPipeOut(`git branch ${branchName}`);
52
52
  exports.createBranch = createBranch;
53
53
  const commit = (commitMessage, noVerify) => {
54
54
  const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
55
- return (0, cmdUtils_1.cmdSyncPipeOut)(`git commit -m "${commitMessage}" ${maybeNoVerifyParam}`.trimEnd());
55
+ return cmdUtils_1.cmdSyncPipeOut(`git commit -m "${commitMessage}" ${maybeNoVerifyParam}`.trimEnd());
56
56
  };
57
57
  exports.commit = commit;
58
58
  const push = (branchName, noVerify) => {
59
59
  const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
60
60
  const cmd = `git push --set-upstream origin ${branchName} ${maybeNoVerifyParam}`.trimEnd();
61
- return (0, cmdUtils_1.cmdSyncPipeOut)(cmd);
61
+ return cmdUtils_1.cmdSyncPipeOut(cmd);
62
62
  };
63
63
  exports.push = push;
64
64
  const assertEmptyStatusList = () => {
65
- (0, assert_1.ok)(statusList().length === 0, 'An empty GIT stage is expected!');
65
+ assert_1.ok(statusList().length === 0, 'An empty GIT stage is expected!');
66
66
  };
67
67
  exports.assertEmptyStatusList = assertEmptyStatusList;
68
68
  const assertCurrentBranch = (expectedBranchName) => {
69
69
  const currentGitBranchName = getCurrentBranchName();
70
70
  const errorMsg = `The ${expectedBranchName} branch is expected to be active, not "${currentGitBranchName}"`;
71
- (0, assert_1.ok)(currentGitBranchName === expectedBranchName, errorMsg);
71
+ assert_1.ok(currentGitBranchName === expectedBranchName, errorMsg);
72
72
  };
73
73
  exports.assertCurrentBranch = assertCurrentBranch;
74
74
  const assertRemoteBranch = (expectedBranchName) => {
75
75
  const errorMsg = `Remote branch ${expectedBranchName} does not exist!`;
76
- (0, assert_1.ok)(remoteBranchExists(expectedBranchName), errorMsg);
76
+ assert_1.ok(remoteBranchExists(expectedBranchName), errorMsg);
77
77
  };
78
78
  exports.assertRemoteBranch = assertRemoteBranch;
@@ -26,7 +26,7 @@ const os = __importStar(require("os"));
26
26
  const semver = __importStar(require("semver"));
27
27
  const child_process_1 = require("child_process");
28
28
  const rnv_1 = require("rnv");
29
- const sdkUtils_1 = require("../sdkUtils");
29
+ const sdk_utils_1 = require("../sdk-utils");
30
30
  const constants_1 = require("../../constants");
31
31
  const { execCLI } = rnv_1.Exec;
32
32
  const { CLI_TIZEN, REMOTE_DEBUGGER_ENABLED_PLATFORMS } = rnv_1.Constants;
@@ -163,11 +163,11 @@ exports.configureTizenProject = configureTizenProject;
163
163
  const handleLinuxKeyring = () => {
164
164
  if (process.env.CI && os.platform() === 'linux') {
165
165
  const options = { stdio: 'inherit' };
166
- (0, child_process_1.execSync)('eval $(dbus-launch --sh-syntax)', options);
167
- (0, child_process_1.execSync)('mkdir -p ~/.cache', options);
168
- (0, child_process_1.execSync)('mkdir -p ~/.local/share/keyrings', options);
169
- (0, child_process_1.execSync)('eval "$(printf \'\\n\' | gnome-keyring-daemon --unlock)"', options);
170
- (0, child_process_1.execSync)('eval "$(printf \'\\n\' | /usr/bin/gnome-keyring-daemon --start)"', options);
166
+ child_process_1.execSync('eval $(dbus-launch --sh-syntax)', options);
167
+ child_process_1.execSync('mkdir -p ~/.cache', options);
168
+ child_process_1.execSync('mkdir -p ~/.local/share/keyrings', options);
169
+ child_process_1.execSync('eval "$(printf \'\\n\' | gnome-keyring-daemon --unlock)"', options);
170
+ child_process_1.execSync('eval "$(printf \'\\n\' | /usr/bin/gnome-keyring-daemon --start)"', options);
171
171
  }
172
172
  };
173
173
  const setTizenCertificate = (c) => {
@@ -185,7 +185,7 @@ const setTizenCertificate = (c) => {
185
185
  console.log('\'c.cli.tizen\' is not set');
186
186
  return false;
187
187
  }
188
- const spawnSyncReturn = (0, child_process_1.spawnSync)(tizenCliPath, [
188
+ const spawnSyncReturn = child_process_1.spawnSync(tizenCliPath, [
189
189
  'security-profiles', 'add',
190
190
  '-n', TIZEN_SECURITY_PROFILE_NAME,
191
191
  '-a', TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH,
@@ -225,12 +225,12 @@ const handleTizenSdk = async (c) => {
225
225
  if (!TIZEN_SDK) {
226
226
  handleLinuxKeyring();
227
227
  if (fs.existsSync(installPath)) {
228
- await (0, sdkUtils_1.registerSdkPath)(c, rnvSdkKey, installPath);
228
+ await sdk_utils_1.registerSdkPath(c, rnvSdkKey, installPath);
229
229
  }
230
230
  else {
231
- const sdkInstalledToPath = await (0, sdkUtils_1.installSdk)(TIZEN_SDK_INSTALLER_URL, installPath);
231
+ const sdkInstalledToPath = await sdk_utils_1.sdkInstaller(TIZEN_SDK_INSTALLER_URL, installPath);
232
232
  if (sdkInstalledToPath) {
233
- await (0, sdkUtils_1.registerSdkPath)(c, rnvSdkKey, sdkInstalledToPath);
233
+ await sdk_utils_1.registerSdkPath(c, rnvSdkKey, sdkInstalledToPath);
234
234
  }
235
235
  }
236
236
  }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./sdk-installer"), exports);
14
+ __exportStar(require("./registerSdkPath"), exports);
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerSdkPath = void 0;
4
+ const rnv_1 = require("rnv");
5
+ const registerSdkPath = async (c, sdkKey, sdkValue) => {
6
+ const rnvWorkspaceConfigPath = c.paths.workspace.config;
7
+ const sdkEntry = { [sdkKey]: sdkValue };
8
+ rnv_1.FileUtils.updateObjectSync(rnvWorkspaceConfigPath, { sdks: sdkEntry });
9
+ if (!c.buildConfig.sdks) {
10
+ c.buildConfig.sdks = {};
11
+ }
12
+ Object.assign(c.buildConfig.sdks, sdkEntry);
13
+ };
14
+ exports.registerSdkPath = registerSdkPath;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sdkInstaller = void 0;
4
+ var sdkInstaller_1 = require("./sdkInstaller");
5
+ Object.defineProperty(exports, "sdkInstaller", { enumerable: true, get: function () { return sdkInstaller_1.sdkInstaller; } });
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sdkInstaller = void 0;
4
+ const path_1 = require("path");
5
+ const url_1 = require("url");
6
+ const services_1 = require("./services");
7
+ const log = (message) => process.stdout.write(message);
8
+ const noLog = () => false;
9
+ const sdkInstaller = async (remoteZipPath, installToPath, disableLogs = false) => {
10
+ const logger = disableLogs ? noLog : log;
11
+ const pathsToDelete = [];
12
+ let usedInstallPath;
13
+ try {
14
+ const parsedZipPath = path_1.parse(remoteZipPath);
15
+ const parsedZipUrl = url_1.parse(remoteZipPath);
16
+ if (!parsedZipUrl.protocol) {
17
+ throw new Error('Installation from local packages is not supported yet.');
18
+ }
19
+ logger('Downloading...');
20
+ const downloadedFilePath = `${process.cwd()}/${parsedZipPath.base}`;
21
+ pathsToDelete.push(downloadedFilePath);
22
+ await services_1.download(remoteZipPath, downloadedFilePath);
23
+ logger('\rUnpacking...');
24
+ const unzippedDirPath = `${process.cwd()}/${parsedZipPath.name}`;
25
+ pathsToDelete.push(unzippedDirPath);
26
+ services_1.unzip(downloadedFilePath);
27
+ logger('\rInstalling...');
28
+ usedInstallPath = services_1.install(unzippedDirPath, installToPath);
29
+ }
30
+ catch (e) {
31
+ services_1.clean(pathsToDelete);
32
+ throw e;
33
+ }
34
+ logger('\rCleaning...');
35
+ services_1.clean(pathsToDelete);
36
+ logger(`\rInstalled to ${usedInstallPath}\n`);
37
+ return usedInstallPath;
38
+ };
39
+ exports.sdkInstaller = sdkInstaller;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clean = void 0;
4
+ const child_process_1 = require("child_process");
5
+ const deleteFileOrDirectory = (path) => {
6
+ child_process_1.spawnSync('rm', ['-r', path]);
7
+ };
8
+ const clean = (pathsToBeDeleted) => {
9
+ pathsToBeDeleted.forEach(deleteFileOrDirectory);
10
+ };
11
+ exports.clean = clean;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.download = void 0;
23
+ const fs = __importStar(require("fs"));
24
+ const path = __importStar(require("path"));
25
+ const url = __importStar(require("url"));
26
+ const http = __importStar(require("http"));
27
+ const https = __importStar(require("https"));
28
+ const createDirPathIfDoesntExist = async (dirPath) => {
29
+ if (!fs.existsSync(dirPath)) {
30
+ fs.mkdirSync(dirPath, { recursive: true });
31
+ }
32
+ };
33
+ const getNetworkProtocolAdapter = (requestedUrl) => {
34
+ const { protocol } = url.parse(requestedUrl);
35
+ switch (protocol) {
36
+ case 'http:': return http;
37
+ case 'https:': return https;
38
+ default: throw new Error(`${protocol} protocol is not supported`);
39
+ }
40
+ };
41
+ const getResponseError = (response) => {
42
+ const HTTP_RESPONSE_STATUS_CODE_OK = 200;
43
+ const { statusCode, headers } = response;
44
+ const contentType = headers['content-type'];
45
+ if (statusCode !== HTTP_RESPONSE_STATUS_CODE_OK) {
46
+ return new Error(`Request Failed. Status Code: ${statusCode}`);
47
+ }
48
+ if (!contentType) {
49
+ return new Error('Missing Content-Type: expected application/zip');
50
+ }
51
+ if (!/^application\/zip/.test(contentType)) {
52
+ return new Error(`Wrong Content-Type: expected application/zip, received ${contentType}`);
53
+ }
54
+ return null;
55
+ };
56
+ const download = async (fromUrl, toFilePath) => {
57
+ const toDirPath = path.parse(toFilePath).dir;
58
+ await createDirPathIfDoesntExist(toDirPath);
59
+ return new Promise((resolve, reject) => {
60
+ const request = getNetworkProtocolAdapter(fromUrl).get(fromUrl, (response) => {
61
+ const error = getResponseError(response);
62
+ if (error) {
63
+ reject(error);
64
+ return;
65
+ }
66
+ const file = fs.createWriteStream(toFilePath);
67
+ file.on('error', reject);
68
+ file.on('finish', resolve);
69
+ response.pipe(file);
70
+ });
71
+ request.on('error', reject);
72
+ });
73
+ };
74
+ exports.download = download;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clean = exports.install = exports.unzip = exports.download = void 0;
4
+ var download_1 = require("./download");
5
+ Object.defineProperty(exports, "download", { enumerable: true, get: function () { return download_1.download; } });
6
+ var unzip_1 = require("./unzip");
7
+ Object.defineProperty(exports, "unzip", { enumerable: true, get: function () { return unzip_1.unzip; } });
8
+ var install_1 = require("./install");
9
+ Object.defineProperty(exports, "install", { enumerable: true, get: function () { return install_1.install; } });
10
+ var clean_1 = require("./clean");
11
+ Object.defineProperty(exports, "clean", { enumerable: true, get: function () { return clean_1.clean; } });
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.install = void 0;
4
+ const child_process_1 = require("child_process");
5
+ const getInstalledPathFromOutput = (output) => {
6
+ const prefix = 'INSTALL_PATH=';
7
+ const installedPathRow = output
8
+ .split('\n')
9
+ .map((outputRow) => outputRow.trim())
10
+ .filter((trimmedOutputRow) => trimmedOutputRow.startsWith(prefix));
11
+ return installedPathRow[0]?.replace(prefix, '') || '';
12
+ };
13
+ const install = (installerDirPath, installToPath) => {
14
+ const installationScriptPath = `${installerDirPath}/install.js`;
15
+ const installationCommandWithoutCustomPath = `node ${installationScriptPath}`;
16
+ const installationCmdToBeUsed = installToPath
17
+ ? `${installationCommandWithoutCustomPath} ${installToPath}`
18
+ : installationCommandWithoutCustomPath;
19
+ const execOptions = { maxBuffer: 5242880 };
20
+ const installationScriptOutput = child_process_1.execSync(installationCmdToBeUsed, execOptions).toString();
21
+ return getInstalledPathFromOutput(installationScriptOutput);
22
+ };
23
+ exports.install = install;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.unzip = void 0;
4
+ const child_process_1 = require("child_process");
5
+ const unzip = (filePath) => {
6
+ const spawnOptions = { maxBuffer: 5242880 };
7
+ const unzipProcess = child_process_1.spawnSync('unzip', ['-n', filePath], spawnOptions);
8
+ if (unzipProcess.stderr.length) {
9
+ throw new Error(unzipProcess.stderr.toString());
10
+ }
11
+ };
12
+ exports.unzip = unzip;
@@ -24,7 +24,7 @@ const fs = __importStar(require("fs"));
24
24
  const path = __importStar(require("path"));
25
25
  const os_1 = require("os");
26
26
  const rnv_1 = require("rnv");
27
- const sdkUtils_1 = require("../sdkUtils");
27
+ const sdk_utils_1 = require("../sdk-utils");
28
28
  const { writeCleanFile } = rnv_1.FileUtils;
29
29
  const { execCLI } = rnv_1.Exec;
30
30
  const { getPlatformProjectDir, getTemplateProjectDir, getPlatformBuildDir, getConfigProp, checkPortInUse, confirmActiveBundler, } = rnv_1.Common;
@@ -119,15 +119,15 @@ const sdkInstallerUUrl = 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.
119
119
  const handleWebosSdk = async (c) => {
120
120
  const { WEBOS_SDK_INSTALLER_URL = sdkInstallerUUrl } = process.env;
121
121
  const { WEBOS_SDK } = c.buildConfig.sdks || {};
122
- const installPath = `${(0, os_1.homedir)()}/webOS_TV_SDK`;
122
+ const installPath = `${os_1.homedir()}/webOS_TV_SDK`;
123
123
  const rnvSdkKey = 'WEBOS_SDK';
124
124
  if (!WEBOS_SDK) {
125
125
  if (fs.existsSync(installPath)) {
126
- await (0, sdkUtils_1.registerSdkPath)(c, rnvSdkKey, installPath);
126
+ await sdk_utils_1.registerSdkPath(c, rnvSdkKey, installPath);
127
127
  }
128
- const sdkInstalledToPath = await (0, sdkUtils_1.installSdk)(WEBOS_SDK_INSTALLER_URL, installPath);
128
+ const sdkInstalledToPath = await sdk_utils_1.sdkInstaller(WEBOS_SDK_INSTALLER_URL, installPath);
129
129
  if (sdkInstalledToPath) {
130
- await (0, sdkUtils_1.registerSdkPath)(c, rnvSdkKey, sdkInstalledToPath);
130
+ await sdk_utils_1.registerSdkPath(c, rnvSdkKey, sdkInstalledToPath);
131
131
  }
132
132
  }
133
133
  await rnv_1.SDKManager.Installer.checkAndConfigureWebosSdks(c);
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.rm = exports.cp = void 0;
4
4
  const child_process_1 = require("child_process");
5
5
  const fsUtils_1 = require("../../../scripts/utils/fsUtils");
6
- const runCmdSync = (cmd) => (0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
6
+ const runCmdSync = (cmd) => child_process_1.execSync(cmd, { stdio: 'inherit' });
7
7
  const cp = (source, destination) => {
8
8
  let cmd = `aws s3 cp ${source} s3://${destination} --acl public-read`;
9
- if ((0, fsUtils_1.isDir)(source)) {
9
+ if (fsUtils_1.isDir(source)) {
10
10
  cmd += ' --recursive';
11
11
  }
12
12
  runCmdSync(cmd);
@@ -28,7 +28,7 @@ const resolvers_1 = require("../../../resolvers");
28
28
  const { getConfigProp } = rnv_1.Common;
29
29
  const uploadPackage = (c, sourcePath, uploadPath) => {
30
30
  const packageOutputDirPath = `${sourcePath}/output`;
31
- const packageFileName = (0, resolvers_1.resolveBuildFileName)(c);
31
+ const packageFileName = resolvers_1.resolveBuildFileName(c);
32
32
  const packageLocalPath = `"${packageOutputDirPath}/${packageFileName}"`;
33
33
  const packageRemotePath = `"${uploadPath}/build/${packageFileName}"`;
34
34
  aws.cp(packageLocalPath, packageRemotePath);
@@ -47,7 +47,7 @@ const deployToS3 = async (c) => {
47
47
  const { platform, runtime } = c;
48
48
  const sourcePath = runtime.appDir;
49
49
  const { isBuildHosted } = getConfigProp(c, platform, 'webpackConfig', {});
50
- const baseUrl = (0, resolvers_1.resolveBaseUrl)({
50
+ const baseUrl = resolvers_1.resolveBaseUrl({
51
51
  platform,
52
52
  scheme: runtime.scheme || '',
53
53
  flavour: runtime.appId,
@@ -30,7 +30,7 @@ const getSshKeyAbsolutePath = (c, sshKeyRelativePath) => {
30
30
  return path.join(c.paths.project.dir, sshKeyRelativePath);
31
31
  };
32
32
  const makeSshConnection = async (c) => {
33
- const { host, username, privateKeyRelativePath } = (0, resolvers_1.resolveHbbtvDeployConfig)();
33
+ const { host, username, privateKeyRelativePath } = resolvers_1.resolveHbbtvDeployConfig();
34
34
  const privateKey = getSshKeyAbsolutePath(c, privateKeyRelativePath);
35
35
  const passphrase = process.env.CI_SSH_KEY_PASSPHRASE;
36
36
  if (!privateKey || !passphrase) {
@@ -40,10 +40,10 @@ const makeSshConnection = async (c) => {
40
40
  await ssh.connect({ host, username, privateKey, passphrase });
41
41
  return ssh;
42
42
  };
43
- const getLocalBuildPackagePath = (c) => (path.join(c.runtime.appDir, 'output', (0, resolvers_1.resolveBuildFileName)(c)));
43
+ const getLocalBuildPackagePath = (c) => (path.join(c.runtime.appDir, 'output', resolvers_1.resolveBuildFileName(c)));
44
44
  const resolveRemotePaths = (c) => {
45
- const remoteBuildDirRelativePath = (0, resolvers_1.resolveHbbtvRemoteBuildDirRelativePath)(c);
46
- const { hostHomeDir, dockerHtmlRootDir } = (0, resolvers_1.resolveHbbtvDeployConfig)();
45
+ const remoteBuildDirRelativePath = resolvers_1.resolveHbbtvRemoteBuildDirRelativePath(c);
46
+ const { hostHomeDir, dockerHtmlRootDir } = resolvers_1.resolveHbbtvDeployConfig();
47
47
  const hostTempDirName = 'travis-ci-temp';
48
48
  return {
49
49
  serverTempDirPath: `${hostHomeDir}/${hostTempDirName}/${remoteBuildDirRelativePath}`,
@@ -57,8 +57,8 @@ const deployHbbTV = async (c) => {
57
57
  const { scheme, appId } = c.runtime;
58
58
  log('HbbTV deploy via SSH.\n\n');
59
59
  const remotePaths = resolveRemotePaths(c);
60
- const { dockerContainerName } = (0, resolvers_1.resolveHbbtvDeployConfig)();
61
- const remotePackagePath = `${remotePaths.serverTempDirPath}/${(0, resolvers_1.resolveBuildFileName)(c)}`;
60
+ const { dockerContainerName } = resolvers_1.resolveHbbtvDeployConfig();
61
+ const remotePackagePath = `${remotePaths.serverTempDirPath}/${resolvers_1.resolveBuildFileName(c)}`;
62
62
  const dockerExecPrefix = `docker exec -t ${dockerContainerName}`;
63
63
  const dockerAppDirPath = remotePaths.dockerProjectDirPath;
64
64
  log('Creating connection...\n');
@@ -86,7 +86,7 @@ const deployHbbTV = async (c) => {
86
86
  await ssh.execCommand(cmd);
87
87
  log('Clearing temporary dir on host side...\n');
88
88
  await ssh.execCommand(`rm -Rf ${remotePaths.serverTempDirPath}`);
89
- const deployedUrl = (0, resolvers_1.resolveHbbtvDeployUrl)(c, scheme, appId);
89
+ const deployedUrl = resolvers_1.resolveHbbtvDeployUrl(c, scheme, appId);
90
90
  log(`\nThe build is deployed at ${deployedUrl}\n`);
91
91
  log('Deploy done.\n');
92
92
  };
@@ -38,12 +38,12 @@ const makeZipOutput = (c) => {
38
38
  const platformBuildDir = getPlatformBuildDir(c);
39
39
  const copiedProjectBuildDir = `${platformBuildDir}/build`;
40
40
  const defaultZipFileName = `${c.platform}_${c.runtime.appId}.zip`;
41
- const fileName = (0, resolvers_1.resolveBuildFileName)(c) || defaultZipFileName;
42
- (0, child_process_1.execSync)(`cp -r ${getPlatformProjectDir(c)}/public ${copiedProjectBuildDir}`);
43
- (0, child_process_1.execSync)(`rm -rf ${platformBuildDir}/output`);
44
- (0, child_process_1.execSync)(`mkdir ${platformBuildDir}/output`);
45
- (0, child_process_1.execSync)(`zip -r ../output/${fileName} *`, { cwd: copiedProjectBuildDir });
46
- (0, child_process_1.execSync)(`rm -rf ${copiedProjectBuildDir}`);
41
+ const fileName = resolvers_1.resolveBuildFileName(c) || defaultZipFileName;
42
+ child_process_1.execSync(`cp -r ${getPlatformProjectDir(c)}/public ${copiedProjectBuildDir}`);
43
+ child_process_1.execSync(`rm -rf ${platformBuildDir}/output`);
44
+ child_process_1.execSync(`mkdir ${platformBuildDir}/output`);
45
+ child_process_1.execSync(`zip -r ../output/${fileName} *`, { cwd: copiedProjectBuildDir });
46
+ child_process_1.execSync(`rm -rf ${copiedProjectBuildDir}`);
47
47
  };
48
48
  const renameOutput = (c) => {
49
49
  const packageOutputDirPath = `${c.runtime.appDir}/output`;
@@ -51,7 +51,7 @@ const renameOutput = (c) => {
51
51
  return;
52
52
  const outputFilenameList = fs.readdirSync(packageOutputDirPath);
53
53
  const packageFileName = outputFilenameList[0];
54
- const newFilename = (0, resolvers_1.resolveBuildFileName)(c);
54
+ const newFilename = resolvers_1.resolveBuildFileName(c);
55
55
  if (newFilename) {
56
56
  const oldPath = `${packageOutputDirPath}/${packageFileName}`;
57
57
  const newPath = `${packageOutputDirPath}/${newFilename}`;
@@ -62,7 +62,7 @@ const buildFn = async (c, parentTask, originTask) => {
62
62
  logTask('taskRnvBuild', `parent:${parentTask}`);
63
63
  const { platform } = c;
64
64
  c.runtime.forceBundleAssets = true;
65
- await (0, sdks_1.handlePlatformSdk)(c);
65
+ await sdks_1.handlePlatformSdk(c);
66
66
  await executeOrSkipTask(c, TASK_PACKAGE, TASK_BUILD, originTask);
67
67
  switch (platform) {
68
68
  case constants_1.Platforms.ENTONE:
@@ -16,7 +16,7 @@ const configureFn = async (c, parentTask, originTask) => {
16
16
  logTask('taskRnvConfigure');
17
17
  await executeTask(c, TASK_PLATFORM_CONFIGURE, TASK_CONFIGURE, originTask);
18
18
  await copySharedPlatforms(c);
19
- const generateSvgSpriteMapHook = (0, generateSvgSpritemap_1.generateSvgSpriteMap)({
19
+ const generateSvgSpriteMapHook = generateSvgSpritemap_1.generateSvgSpriteMap({
20
20
  iconsFolder: '/icons',
21
21
  cssOutput: '../../platformAssets/runtime/icons.css',
22
22
  jsonOutput: '/icons.json',
@@ -15,10 +15,10 @@ const configureSoftFn = async (c, parentTask, originTask) => {
15
15
  await configureRuntimeDefaults(c);
16
16
  await executeTask(c, TASK_APP_CONFIGURE, parentTask, originTask);
17
17
  await isPlatformSupported(c);
18
- await (0, schemeParser_1.isBuildSchemeSupported)(c);
18
+ await schemeParser_1.isBuildSchemeSupported(c);
19
19
  await checkSdk(c);
20
20
  await configureRuntimeDefaults(c);
21
- (0, replaceRelevantStringsInConfig_1.replaceRelevantStringsInConfig)(c);
21
+ replaceRelevantStringsInConfig_1.replaceRelevantStringsInConfig(c);
22
22
  return true;
23
23
  };
24
24
  const customRnvConfigureSoftTask = {
@@ -14,15 +14,15 @@ const deployFn = async (c, parentTask, originTask) => {
14
14
  await executeOrSkipTask(c, TASK_EXPORT, TASK_DEPLOY, originTask);
15
15
  switch (c.platform) {
16
16
  case constants_1.Platforms.HBBTV:
17
- await (0, deployHbbtv_1.deployHbbTV)(c);
18
- await (0, deployS3_1.deployToS3)(c);
17
+ await deployHbbtv_1.deployHbbTV(c);
18
+ await deployS3_1.deployToS3(c);
19
19
  return true;
20
20
  case constants_1.Platforms.ENTONE:
21
21
  case constants_1.Platforms.SAPHI:
22
22
  case constants_1.Platforms.TIZEN:
23
23
  case constants_1.Platforms.WEBOS:
24
24
  case constants_1.Platforms.WEBTV:
25
- return (0, deployS3_1.deployToS3)(c);
25
+ return deployS3_1.deployToS3(c);
26
26
  default:
27
27
  logErrorPlatform(c);
28
28
  return false;
@@ -35,7 +35,7 @@ const hooksRunFn = async (c, parentTask, originTask) => {
35
35
  else {
36
36
  logInfo('Your are running your buildHook outside of renative project');
37
37
  }
38
- await (0, buildHooks_1.buildHooks)(c);
38
+ await buildHooks_1.buildHooks(c);
39
39
  if (!c.buildHooks) {
40
40
  return Promise.reject(new Error('Build hooks have not been compiled properly!'));
41
41
  }