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

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 (70) hide show
  1. package/dist/src/scripts/buildAllWithScheme.js +2 -1
  2. package/dist/src/scripts/gitReleaser/afterVersionBump.js +2 -1
  3. package/dist/src/scripts/gitReleaser/checkReleaseNotes.js +1 -1
  4. package/dist/src/scripts/gitReleaser/pushReleaseNotes.js +31 -37
  5. package/dist/src/scripts/release/githubRelease.js +4 -3
  6. package/dist/src/scripts/release/notifySlack/makePayload.js +1 -0
  7. package/dist/src/scripts/release/sentryRelease.js +3 -3
  8. package/dist/src/scripts/release/urlsMarkdown.js +0 -4
  9. package/dist/src/scripts/releaseAllWithScheme.js +5 -3
  10. package/dist/src/scripts/utils/gitUtils.js +6 -3
  11. package/dist/src/sdks/index.js +6 -11
  12. package/dist/src/sdks/sdk-tizen/index.js +74 -70
  13. package/dist/src/sdks/sdk-webos/index.js +85 -90
  14. package/dist/src/sdks/sdk-webpack/index.js +1 -1
  15. package/dist/src/tasks/deploy/aswS3/aws.js +1 -1
  16. package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +2 -2
  17. package/dist/src/tasks/engineTasks.js +9 -11
  18. package/dist/src/tasks/task.rnv.build.js +7 -10
  19. package/dist/src/tasks/task.rnv.configure.js +7 -10
  20. package/dist/src/tasks/task.rnv.configureSoft.js +7 -10
  21. package/dist/src/tasks/task.rnv.deploy.js +7 -10
  22. package/dist/src/tasks/task.rnv.hooks.run.js +7 -10
  23. package/dist/src/tasks/task.rnv.package.js +6 -7
  24. package/dist/src/tasks/task.rnv.project.configure.js +17 -16
  25. package/dist/src/tasks/task.rnv.start.js +15 -15
  26. package/dist/src/utils/replaceRelevantStringsInConfig/replaceTemplateString.js +5 -5
  27. package/dist/templates/platforms/_shared/template.js +5 -2
  28. package/dist/templates/platforms/_shared/webpack.base.js +9 -6
  29. package/dist/templates/platforms/entone/webpack.config.dev.js +4 -2
  30. package/dist/templates/platforms/entone/webpack.config.prod.js +4 -2
  31. package/dist/templates/platforms/hbbtv/webpack.config.dev.js +8 -3
  32. package/dist/templates/platforms/hbbtv/webpack.config.prod.js +8 -3
  33. package/dist/templates/platforms/tizen/webpack.config.dev.js +4 -2
  34. package/dist/templates/platforms/tizen/webpack.config.prod.js +4 -2
  35. package/dist/templates/platforms/webos/webpack.config.dev.js +4 -2
  36. package/dist/templates/platforms/webos/webpack.config.prod.js +4 -2
  37. package/dist/templates/platforms/webtv/webpack.config.dev.js +4 -2
  38. package/dist/templates/platforms/webtv/webpack.config.prod.js +4 -2
  39. package/engine/src/scripts/buildAllWithScheme.js +3 -2
  40. package/engine/src/scripts/gitReleaser/afterVersionBump.js +1 -0
  41. package/engine/src/scripts/gitReleaser/checkReleaseNotes.js +1 -1
  42. package/engine/src/scripts/gitReleaser/pushReleaseNotes.js +22 -26
  43. package/engine/src/scripts/release/githubRelease.js +7 -6
  44. package/engine/src/scripts/release/notifySlack/makePayload.js +9 -13
  45. package/engine/src/scripts/release/notifySlack/notifySlack.js +3 -1
  46. package/engine/src/scripts/release/sentryRelease.js +4 -4
  47. package/engine/src/scripts/release/urlsMarkdown.js +0 -5
  48. package/engine/src/scripts/releaseAllWithScheme.js +7 -6
  49. package/engine/src/scripts/utils/gitUtils.js +7 -4
  50. package/engine/src/sdks/index.js +5 -5
  51. package/engine/src/sdks/sdk-tizen/index.js +76 -68
  52. package/engine/src/sdks/sdk-webos/index.js +51 -70
  53. package/engine/src/sdks/sdk-webpack/index.js +2 -3
  54. package/engine/src/sdks/sdkUtils.js +6 -8
  55. package/engine/src/tasks/deploy/aswS3/aws.js +1 -1
  56. package/engine/src/tasks/deploy/hbbtv/deployHbbtv.js +2 -2
  57. package/engine/src/tasks/engineTasks.js +16 -16
  58. package/engine/src/tasks/task.rnv.build.js +7 -5
  59. package/engine/src/tasks/task.rnv.configure.js +7 -5
  60. package/engine/src/tasks/task.rnv.configureSoft.js +7 -5
  61. package/engine/src/tasks/task.rnv.deploy.js +7 -5
  62. package/engine/src/tasks/task.rnv.hooks.run.js +9 -7
  63. package/engine/src/tasks/task.rnv.package.js +7 -3
  64. package/engine/src/tasks/task.rnv.project.configure.js +34 -16
  65. package/engine/src/tasks/task.rnv.start.js +10 -4
  66. package/engine/src/utils/getBaseConfig.js +1 -1
  67. package/engine/src/utils/getDeployLocations.js +1 -1
  68. package/engine/src/utils/replaceRelevantStringsInConfig/replaceTemplateString.js +8 -5
  69. package/engine/src/utils/zipBuildsByPlatforms.js +0 -1
  70. package/package.json +10 -6
@@ -8,7 +8,9 @@ const getPayload = (c) => {
8
8
  case 'dev:latest': return payload.makeDevelopmentPayload(c);
9
9
  case 'rc:latest': return payload.makeReleaseCandidatePayload(c);
10
10
  case 'release:dist': return payload.makeDistributionPayload(c);
11
- default: throw new Error('Notify Slack: unsupported or undefined release type! Did you pass it as an argument?');
11
+ default: throw new Error(
12
+ 'Notify Slack: unsupported or undefined release type! Did you pass it as an argument?',
13
+ );
12
14
  }
13
15
  };
14
16
 
@@ -35,12 +35,12 @@ const finalizeRelease = (version) => {
35
35
  const processPlatform = (c, platform, version) => {
36
36
  const processFlavour = (flavour) => {
37
37
  const { platformBuildsDir } = c.buildConfig.paths;
38
- const sourceMapsPath = `${platformBuildsDir}/${flavour}_${platform}-public/public/content/js`;
38
+ const mapsPath = `${platformBuildsDir}/${flavour}_${platform}-public/public/content/js`;
39
39
  const urlPrefix = `builds/${platform}/${flavour}/dist/${version}/public/content/js/`;
40
- if (!fs.existsSync(sourceMapsPath)) return;
40
+ if (!fs.existsSync(mapsPath)) return;
41
41
 
42
42
  console.log(`Uploading ${flavour}_${platform} sourcemaps to Sentry...`);
43
- uploadSourceMaps({ version, sourceMapsPath, urlPrefix });
43
+ uploadSourceMaps({ version, sourceMapsPath: mapsPath, urlPrefix });
44
44
  };
45
45
  const { supportedFlavours = [] } = c.buildConfig.platforms[platform]?.deploy || {};
46
46
  supportedFlavours.forEach(processFlavour);
@@ -50,7 +50,7 @@ const isSentryProjectConfigured = () => {
50
50
  const cmd = execSync('sentry-cli info --config-status-json');
51
51
  const sentryConfig = JSON.parse(cmd.toString()) || {};
52
52
  return !!sentryConfig.config?.project;
53
- }
53
+ };
54
54
 
55
55
  const sentryRelease = (c) => {
56
56
  if (!isSentryProjectConfigured()) {
@@ -1,14 +1,9 @@
1
1
  import { getDeployLocations } from '../../utils/getDeployLocations';
2
- import { strict } from 'assert';
3
-
4
- const { ok } = strict;
5
2
 
6
3
  const newLine = '\r\n';
7
4
 
8
5
  const getDataToProceed = (c, customPlatformList = []) => {
9
6
  const locations = getDeployLocations(c);
10
- ok(locations, 'It seems that file with remote locations has not been generated! Try to check rnv build hooks...');
11
-
12
7
  const { versions } = locations;
13
8
  const { platforms } = versions[Object.keys(versions)[0]];
14
9
 
@@ -16,7 +16,7 @@ const deployTask = (options) => {
16
16
  };
17
17
 
18
18
  const deployBuilds = (c) => {
19
- console.log(`Deploying the builds...`);
19
+ console.log('Deploying the builds...');
20
20
  forEachSupportedPlatformFlavour(c, deployTask);
21
21
  return true;
22
22
  };
@@ -56,7 +56,7 @@ const doDistributionRelease = (c) => {
56
56
  const releaseAllWithScheme = () => {
57
57
  const scheme = process.argv[2];
58
58
  if (!scheme) {
59
- throw new Error ('No scheme name to use found! Please use rnv scheme name as a param.');
59
+ throw new Error('No scheme name to use found! Please use rnv scheme name as a param.');
60
60
  }
61
61
 
62
62
  const c = getBaseConfig();
@@ -79,13 +79,14 @@ const releaseAllWithScheme = () => {
79
79
  throw new Error('Unsupported scheme to release!');
80
80
  }
81
81
 
82
- console.log(JSON.stringify(getDeployLocations(c), null, 4));
82
+ const spacing = 4;
83
+ console.log(JSON.stringify(getDeployLocations(c), null, spacing));
83
84
  return true;
84
85
  };
85
86
 
86
87
  const startTimestamp = Date.now();
88
+ releaseAllWithScheme();
87
89
 
88
- releaseAllWithScheme()
89
-
90
- const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / 1000);
90
+ const msPerSecond = 1000;
91
+ const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
91
92
  console.log(`buildAllWithScheme: done in ${scriptTotalTimeInSeconds} second(s)!`);
@@ -31,7 +31,8 @@ const pullRequest = (fromBranch, toBranch, prTitle) => {
31
31
  throw new Error(errorMsg);
32
32
  }
33
33
 
34
- cmdSyncInheritOut(`${cmdTool} pull-request -m "${prTitle}" --head ${fromBranch} --base ${toBranch}`);
34
+ const cmd = `${cmdTool} pull-request -m "${prTitle}" --head ${fromBranch} --base ${toBranch}`;
35
+ cmdSyncInheritOut(cmd);
35
36
  };
36
37
 
37
38
  const remoteBranchExists = (expectedBranchName) => {
@@ -53,12 +54,13 @@ const createBranch = (branchName) => cmdSyncPipeOut(`git branch ${branchName}`);
53
54
  const commit = (commitMessage, noVerify) => {
54
55
  const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
55
56
  return cmdSyncPipeOut(`git commit -m "${commitMessage}" ${maybeNoVerifyParam}`.trimEnd());
56
- }
57
+ };
57
58
 
58
59
  const push = (branchName, noVerify) => {
59
60
  const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
60
- return cmdSyncPipeOut(`git push --set-upstream origin ${branchName} ${maybeNoVerifyParam}`.trimEnd());
61
- }
61
+ const cmd = `git push --set-upstream origin ${branchName} ${maybeNoVerifyParam}`.trimEnd();
62
+ return cmdSyncPipeOut(cmd);
63
+ };
62
64
 
63
65
  const assertEmptyStatusList = () => {
64
66
  ok(statusList().length === 0, 'An empty GIT stage is expected!');
@@ -66,6 +68,7 @@ const assertEmptyStatusList = () => {
66
68
 
67
69
  const assertCurrentBranch = (expectedBranchName) => {
68
70
  const currentGitBranchName = getCurrentBranchName();
71
+ // eslint-disable-next-line max-len
69
72
  const errorMsg = `The ${expectedBranchName} branch is expected to be active, not "${currentGitBranchName}"`;
70
73
  ok(currentGitBranchName === expectedBranchName, errorMsg);
71
74
  };
@@ -6,13 +6,13 @@ import * as SDKWebpack from './sdk-webpack';
6
6
  const handlePlatformSdk = async (c) => {
7
7
  switch (c.platform) {
8
8
  case enginePlatforms.TIZEN:
9
- await SDKTizen.handleTizenSdk(c);
10
- break;
9
+ return SDKTizen.handleTizenSdk(c);
11
10
  case enginePlatforms.WEBOS:
12
- await SDKWebos.handleWebosSdk(c);
13
- break;
11
+ return SDKWebos.handleWebosSdk(c);
12
+ default:
13
+ return true;
14
14
  }
15
- }
15
+ };
16
16
 
17
17
  export {
18
18
  SDKWebos,
@@ -1,61 +1,57 @@
1
+ import fs from 'fs';
1
2
  import path from 'path';
2
- import semver from 'semver';
3
3
  import os from 'os';
4
- import fs from 'fs';
4
+ import semver from 'semver';
5
+ import {
6
+ Exec, WebpackUtils, FileUtils, Common, Logger, Constants, SDKManager, PlatformManager,
7
+ ProjectManager,
8
+ } from 'rnv';
9
+
5
10
  const { spawnSync, execSync } = require('child_process');
6
- const { installSdk, registerSdkPath } = require('../sdkUtils');
7
11
  const { checkAndConfigureTizenSdks } = require('rnv/dist/core/sdkManager/installer');
8
- import { Exec, WebpackUtils, FileUtils, Common, Logger, Constants, SDKManager, PlatformManager, ProjectManager } from 'rnv';
12
+ const { installSdk, registerSdkPath } = require('../sdkUtils');
9
13
 
10
14
  const { execCLI } = Exec;
11
15
  const { CLI_TIZEN, REMOTE_DEBUGGER_ENABLED_PLATFORMS } = Constants;
12
16
  const {
13
- getPlatformProjectDir,
14
- getAppVersion,
15
- getConfigProp,
16
- checkPortInUse,
17
- confirmActiveBundler,
18
- addSystemInjects
17
+ getPlatformProjectDir, getAppVersion, getConfigProp, checkPortInUse, confirmActiveBundler,
18
+ addSystemInjects,
19
19
  } = Common;
20
20
  const {
21
- chalk,
22
- logTask,
23
- logDebug,
24
- logError,
25
- logSuccess,
26
- logWarning,
27
- logInfo
21
+ chalk, logTask, logDebug, logError, logSuccess, logWarning, logInfo,
28
22
  } = Logger;
29
23
  const { isPlatformActive } = PlatformManager;
30
24
  const { writeCleanFile, fsExistsSync } = FileUtils;
31
- const { buildCoreWebpackProject, runWebpackServer, configureCoreWebProject, waitForWebpack } = WebpackUtils;
25
+ const {
26
+ buildCoreWebpackProject, runWebpackServer, configureCoreWebProject, waitForWebpack,
27
+ } = WebpackUtils;
32
28
  const { copyAssetsFolder, copyBuildsFolder } = ProjectManager;
33
29
 
34
30
  const {
35
31
  runTizenSimOrDevice, createDevelopTizenCertificate,
36
- DEFAULT_CERTIFICATE_NAME, DEFAULT_SECURITY_PROFILE_NAME
32
+ DEFAULT_CERTIFICATE_NAME, DEFAULT_SECURITY_PROFILE_NAME,
37
33
  } = SDKManager.Tizen;
38
34
 
39
35
  const DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION = `${DEFAULT_CERTIFICATE_NAME}.p12`;
40
36
 
41
- export const configureTizenGlobal = c => new Promise((resolve, reject) => {
37
+ const configureTizenGlobal = (c) => new Promise((resolve, reject) => {
42
38
  logTask('configureTizenGlobal');
43
39
  // Check Tizen Cert
44
- const tizenAuthorCert = path.join(c.paths.workspace.dir, DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION);
45
- if (fsExistsSync(tizenAuthorCert)) {
40
+ const authorCert = path.join(c.paths.workspace.dir, DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION);
41
+ if (fsExistsSync(authorCert)) {
46
42
  logDebug(`${DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION} file exists!`);
47
43
  resolve();
48
44
  } else {
49
45
  logWarning(
50
- `${DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION} file missing! Creating one for you...`
46
+ `${DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION} file missing! Creating one for you...`,
51
47
  );
52
48
  createDevelopTizenCertificate(c)
53
49
  .then(() => resolve())
54
- .catch(e => reject(e));
50
+ .catch((e) => reject(e));
55
51
  }
56
52
  });
57
53
 
58
- const _runTizenSimOrDevice = async (c) => {
54
+ const handleRunTizenSimOrDevice = async (c) => {
59
55
  try {
60
56
  await runTizenSimOrDevice(c);
61
57
  } catch (e) {
@@ -65,7 +61,7 @@ const _runTizenSimOrDevice = async (c) => {
65
61
  return true;
66
62
  };
67
63
 
68
- export const runTizen = async (c, target) => {
64
+ const runTizen = async (c, target) => {
69
65
  logTask('runTizen', `target:${target}`);
70
66
  const { platform } = c;
71
67
  const { hosted } = c.program;
@@ -87,21 +83,22 @@ export const runTizen = async (c, target) => {
87
83
 
88
84
  if (bundleAssets) {
89
85
  await buildCoreWebpackProject(c);
90
- await _runTizenSimOrDevice(c);
86
+ await handleRunTizenSimOrDevice(c);
91
87
  } else {
92
88
  const isPortActive = await checkPortInUse(c, platform, c.runtime.port);
93
- const isWeinreEnabled = REMOTE_DEBUGGER_ENABLED_PLATFORMS.includes(platform) && !bundleAssets && !hosted;
89
+ const isDebuggerEnabledForPlatform = REMOTE_DEBUGGER_ENABLED_PLATFORMS.includes(platform);
90
+ const isWeinreEnabled = isDebuggerEnabledForPlatform && !bundleAssets && !hosted;
94
91
 
95
92
  if (!isPortActive) {
96
93
  logInfo(
97
94
  `Your ${chalk().white(
98
- platform
95
+ platform,
99
96
  )} devServer at port ${chalk().white(
100
- c.runtime.port
101
- )} is not running. Starting it up for you...`
97
+ c.runtime.port,
98
+ )} is not running. Starting it up for you...`,
102
99
  );
103
100
  waitForWebpack(c)
104
- .then(() => _runTizenSimOrDevice(c))
101
+ .then(() => handleRunTizenSimOrDevice(c))
105
102
  .catch(logError);
106
103
  await runWebpackServer(c, isWeinreEnabled);
107
104
  } else {
@@ -109,17 +106,17 @@ export const runTizen = async (c, target) => {
109
106
 
110
107
  if (resetCompleted) {
111
108
  waitForWebpack(c)
112
- .then(() => _runTizenSimOrDevice(c))
109
+ .then(() => handleRunTizenSimOrDevice(c))
113
110
  .catch(logError);
114
111
  await runWebpackServer(c, isWeinreEnabled);
115
112
  } else {
116
- await _runTizenSimOrDevice(c);
113
+ await handleRunTizenSimOrDevice(c);
117
114
  }
118
115
  }
119
116
  }
120
117
  };
121
118
 
122
- export const buildTizenProject = async (c) => {
119
+ const buildTizenProject = async (c) => {
123
120
  logTask('buildTizenProject');
124
121
 
125
122
  await buildCoreWebpackProject(c);
@@ -137,7 +134,7 @@ export const buildTizenProject = async (c) => {
137
134
  await execCLI(
138
135
  c,
139
136
  CLI_TIZEN,
140
- `package -- ${tBuild} -s ${certProfile} -t wgt -o ${tOut}`
137
+ `package -- ${tBuild} -s ${certProfile} -t wgt -o ${tOut}`,
141
138
  );
142
139
 
143
140
  logSuccess(`Your WGT package is located in ${chalk().cyan(tOut)} .`);
@@ -146,31 +143,10 @@ export const buildTizenProject = async (c) => {
146
143
  return true;
147
144
  };
148
145
 
149
- let _isGlobalConfigured = false;
150
-
151
- export const configureTizenProject = async (c) => {
152
- logTask('configureTizenProject');
153
- const { platform } = c;
154
-
155
- c.runtime.platformBuildsProjectPath = `${getPlatformProjectDir(c)}`;
156
-
157
- if (!isPlatformActive(c, platform)) {
158
- return;
159
- }
160
-
161
- if (!_isGlobalConfigured) {
162
- _isGlobalConfigured = true;
163
- await configureTizenGlobal(c);
164
- }
165
-
166
- await copyAssetsFolder(c, platform);
167
- await configureCoreWebProject(c);
168
- await _configureProject(c);
169
- return copyBuildsFolder(c, platform);
170
- };
146
+ let isGlobalConfigured = false;
171
147
 
172
- const _configureProject = c => new Promise((resolve) => {
173
- logTask('_configureProject');
148
+ const configureProject = (c) => new Promise((resolve) => {
149
+ logTask('configureProject');
174
150
  const { platform } = c;
175
151
 
176
152
  const configFile = 'config.xml';
@@ -180,7 +156,7 @@ const _configureProject = c => new Promise((resolve) => {
180
156
  { pattern: '{{PACKAGE}}', override: p.package },
181
157
  { pattern: '{{ID}}', override: p.id },
182
158
  { pattern: '{{APP_NAME}}', override: p.appName },
183
- { pattern: '{{APP_VERSION}}', override: semver.coerce(getAppVersion(c, platform)) }
159
+ { pattern: '{{APP_VERSION}}', override: semver.coerce(getAppVersion(c, platform)) },
184
160
  ];
185
161
 
186
162
  addSystemInjects(c, injects);
@@ -191,6 +167,27 @@ const _configureProject = c => new Promise((resolve) => {
191
167
  resolve();
192
168
  });
193
169
 
170
+ const configureTizenProject = async (c) => {
171
+ logTask('configureTizenProject');
172
+ const { platform } = c;
173
+
174
+ c.runtime.platformBuildsProjectPath = `${getPlatformProjectDir(c)}`;
175
+
176
+ if (!isPlatformActive(c, platform)) {
177
+ return;
178
+ }
179
+
180
+ if (!isGlobalConfigured) {
181
+ isGlobalConfigured = true;
182
+ await configureTizenGlobal(c);
183
+ }
184
+
185
+ await copyAssetsFolder(c, platform);
186
+ await configureCoreWebProject(c);
187
+ await configureProject(c);
188
+ copyBuildsFolder(c, platform);
189
+ };
190
+
194
191
  const handleLinuxKeyring = () => {
195
192
  if (process.env.CI && os.platform() === 'linux') {
196
193
  const options = { stdio: 'inherit' };
@@ -212,17 +209,18 @@ const setTizenCertificate = (c) => {
212
209
  const tizenCliPath = c.cli.tizen;
213
210
 
214
211
  if (!fs.existsSync(TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH)) {
212
+ // eslint-disable-next-line max-len
215
213
  console.log(`'process.env.TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH' points to not existing location: ${TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH}`);
216
214
  return false;
217
215
  }
218
216
 
219
217
  if (!TIZEN_AUTHOR_CERTIFICATE_PASSWORD) {
220
- console.log(`'process.env.TIZEN_AUTHOR_CERTIFICATE_PASSWORD' password is not set`);
218
+ console.log('\'process.env.TIZEN_AUTHOR_CERTIFICATE_PASSWORD\' password is not set');
221
219
  return false;
222
220
  }
223
221
 
224
222
  if (!tizenCliPath) {
225
- console.log(`'c.cli.tizen' is not set`);
223
+ console.log('\'c.cli.tizen\' is not set');
226
224
  return false;
227
225
  }
228
226
 
@@ -235,7 +233,7 @@ const setTizenCertificate = (c) => {
235
233
 
236
234
  if (spawnSyncReturn.error) throw spawnSyncReturn.error;
237
235
  if (spawnSyncReturn.stdout.toString().includes('Invalid file or password')) {
238
- throw spawnSyncReturn.stdout.toString();
236
+ throw new Error(spawnSyncReturn.stdout.toString());
239
237
  }
240
238
 
241
239
  process.stdout.write(spawnSyncReturn.stdout || '');
@@ -255,19 +253,21 @@ const setTizenCertificate = (c) => {
255
253
  const getSdkInstallerUrl = () => {
256
254
  switch (os.platform()) {
257
255
  case 'darwin':
256
+ // eslint-disable-next-line max-len
258
257
  return 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/tizen/tizen_builder_v3.7_mac.zip';
259
258
  case 'linux':
259
+ // eslint-disable-next-line max-len
260
260
  return 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/tizen/tizen_builder_v3.7_ubuntu.zip';
261
261
  default:
262
262
  return '';
263
263
  }
264
- }
264
+ };
265
265
 
266
- export const handleTizenSdk = async (c) => {
266
+ const handleTizenSdk = async (c) => {
267
267
  const { TIZEN_SDK_INSTALLER_URL = getSdkInstallerUrl() } = process.env;
268
268
  const { TIZEN_SDK } = c.buildConfig?.sdks || {};
269
269
  const installPath = `${os.homedir()}/tizen-studio`;
270
- const rnvSdkKey = 'TIZEN_SDK'
270
+ const rnvSdkKey = 'TIZEN_SDK';
271
271
 
272
272
  if (!TIZEN_SDK) {
273
273
  handleLinuxKeyring(); // needed to work with Tizen certificate passwords
@@ -284,4 +284,12 @@ export const handleTizenSdk = async (c) => {
284
284
 
285
285
  await checkAndConfigureTizenSdks(c);
286
286
  setTizenCertificate(c);
287
- }
287
+ };
288
+
289
+ export {
290
+ buildTizenProject,
291
+ configureTizenGlobal,
292
+ configureTizenProject,
293
+ handleTizenSdk,
294
+ runTizen,
295
+ };
@@ -1,53 +1,36 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
3
  import semver from 'semver';
4
- const { homedir } = require('os');
5
- const { installSdk, registerSdkPath } = require('../sdkUtils');
6
- const { checkAndConfigureWebosSdks } = require('rnv/dist/core/sdkManager/installer');
7
- import { Exec, WebpackUtils, FileUtils, Common, Logger, Constants, PlatformManager, ProjectManager, SDKManager } from 'rnv';
4
+ import { homedir } from 'os';
5
+ import {
6
+ Exec, WebpackUtils, FileUtils, Common, Logger, Constants, PlatformManager, ProjectManager,
7
+ SDKManager,
8
+ } from 'rnv';
9
+ import { checkAndConfigureWebosSdks } from 'rnv/dist/core/sdkManager/installer';
10
+ import { installSdk, registerSdkPath } from '../sdkUtils';
8
11
 
9
12
  const { writeCleanFile } = FileUtils;
10
13
  const { execCLI } = Exec;
11
14
  const {
12
- getPlatformProjectDir,
13
- getTemplateProjectDir,
14
- getPlatformBuildDir,
15
- getAppVersion,
16
- getAppTitle,
17
- getAppId,
18
- getAppDescription,
19
- getConfigProp,
20
- checkPortInUse,
21
- confirmActiveBundler,
22
- addSystemInjects
15
+ getPlatformProjectDir, getTemplateProjectDir, getPlatformBuildDir, getAppVersion, getAppTitle,
16
+ getAppId, getAppDescription, getConfigProp, checkPortInUse, confirmActiveBundler,
17
+ addSystemInjects,
23
18
  } = Common;
24
- const { buildCoreWebpackProject, runWebpackServer, configureCoreWebProject, waitForWebpack } = WebpackUtils;
19
+ const {
20
+ buildCoreWebpackProject, runWebpackServer, configureCoreWebProject, waitForWebpack,
21
+ } = WebpackUtils;
25
22
 
26
23
  const { isPlatformActive } = PlatformManager;
27
- const {
28
- chalk,
29
- logTask,
30
- logInfo,
31
- logSuccess,
32
- logError
33
- } = Logger;
34
- const {
35
- copyBuildsFolder,
36
- copyAssetsFolder
37
- } = ProjectManager;
38
- const {
39
- CLI_WEBOS_ARES_PACKAGE,
40
- REMOTE_DEBUGGER_ENABLED_PLATFORMS
41
- } = Constants;
24
+ const { chalk, logTask, logInfo, logSuccess, logError } = Logger;
25
+ const { copyBuildsFolder, copyAssetsFolder } = ProjectManager;
26
+ const { CLI_WEBOS_ARES_PACKAGE, REMOTE_DEBUGGER_ENABLED_PLATFORMS } = Constants;
42
27
  const { runWebosSimOrDevice } = SDKManager.Webos;
43
28
 
44
-
45
29
  export const runWebOS = async (c) => {
46
30
  const { hosted } = c.program;
47
31
  const { target } = c.runtime;
48
32
  const { platform } = c;
49
33
 
50
-
51
34
  const isHosted = hosted && !getConfigProp(c, platform, 'bundleAssets');
52
35
 
53
36
  if (isHosted) {
@@ -68,15 +51,16 @@ export const runWebOS = async (c) => {
68
51
  await runWebosSimOrDevice(c);
69
52
  } else {
70
53
  const isPortActive = await checkPortInUse(c, platform, c.runtime.port);
71
- const isWeinreEnabled = REMOTE_DEBUGGER_ENABLED_PLATFORMS.includes(platform) && !bundleAssets && !hosted;
54
+ const isDebuggerEnabledForPlatform = REMOTE_DEBUGGER_ENABLED_PLATFORMS.includes(platform);
55
+ const isWeinreEnabled = isDebuggerEnabledForPlatform && !bundleAssets && !hosted;
72
56
 
73
57
  if (!isPortActive) {
74
58
  logInfo(
75
59
  `Your ${chalk().white(
76
- platform
60
+ platform,
77
61
  )} devServer at port ${chalk().white(
78
- c.runtime.port
79
- )} is not running. Starting it up for you...`
62
+ c.runtime.port,
63
+ )} is not running. Starting it up for you...`,
80
64
  );
81
65
  waitForWebpack(c)
82
66
  .then(() => runWebosSimOrDevice(c))
@@ -107,28 +91,13 @@ export const buildWebOSProject = async (c) => {
107
91
  await execCLI(c, CLI_WEBOS_ARES_PACKAGE, `-o ${tOut} ${tDir} -n`);
108
92
 
109
93
  logSuccess(
110
- `Your IPK package is located in ${chalk().cyan(tOut)} .`
94
+ `Your IPK package is located in ${chalk().cyan(tOut)} .`,
111
95
  );
112
96
  }
113
97
  };
114
98
 
115
- export const configureWebOSProject = async (c) => {
116
- logTask('configureWebOSProject');
117
-
118
- const { platform } = c;
119
-
120
- c.runtime.platformBuildsProjectPath = getPlatformProjectDir(c);
121
-
122
- if (!isPlatformActive(c, platform)) return;
123
-
124
- await copyAssetsFolder(c, platform);
125
- await configureCoreWebProject(c);
126
- await _configureProject(c);
127
- return copyBuildsFolder(c, platform);
128
- };
129
-
130
- const _configureProject = async (c) => {
131
- logTask('_configureProject');
99
+ const configureProject = async (c) => {
100
+ logTask('configureProject');
132
101
  const { platform } = c;
133
102
 
134
103
  const configFile = 'appinfo.json';
@@ -136,32 +105,32 @@ const _configureProject = async (c) => {
136
105
  const injects = [
137
106
  {
138
107
  pattern: '{{APPLICATION_ID}}',
139
- override: getAppId(c, platform).toLowerCase()
108
+ override: getAppId(c, platform).toLowerCase(),
140
109
  },
141
110
  {
142
111
  pattern: '{{APP_TITLE}}',
143
- override: getAppTitle(c, platform)
112
+ override: getAppTitle(c, platform),
144
113
  },
145
114
  {
146
115
  pattern: '{{APP_VERSION}}',
147
- override: semver.coerce(getAppVersion(c, platform))
116
+ override: semver.coerce(getAppVersion(c, platform)),
148
117
  },
149
118
  {
150
119
  pattern: '{{APP_DESCRIPTION}}',
151
- override: getAppDescription(c, platform)
120
+ override: getAppDescription(c, platform),
152
121
  },
153
122
  {
154
123
  pattern: '{{APP_BG_COLOR}}',
155
- override: getConfigProp(c, platform, 'bgColor', '#fff')
124
+ override: getConfigProp(c, platform, 'bgColor', '#fff'),
156
125
  },
157
126
  {
158
127
  pattern: '{{APP_ICON_COLOR}}',
159
- override: getConfigProp(c, platform, 'iconColor', '#000')
128
+ override: getConfigProp(c, platform, 'iconColor', '#000'),
160
129
  },
161
130
  {
162
131
  pattern: '{{APP_VENDOR}}',
163
- override: getConfigProp(c, platform, 'vendor', '24i')
164
- }
132
+ override: getConfigProp(c, platform, 'vendor', '24i'),
133
+ },
165
134
  ];
166
135
 
167
136
  addSystemInjects(c, injects);
@@ -169,22 +138,34 @@ const _configureProject = async (c) => {
169
138
  writeCleanFile(
170
139
  path.join(getTemplateProjectDir(c), configFile),
171
140
  path.join(getPlatformProjectDir(c), configFile),
172
- injects, null, c
141
+ injects, null, c,
173
142
  );
174
143
 
175
144
  return true;
176
145
  };
146
+ export const configureWebOSProject = async (c) => {
147
+ logTask('configureWebOSProject');
148
+
149
+ const { platform } = c;
177
150
 
178
- const getSdkInstallerUrl = () => {
179
- return 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/webos/ares_webos_builder_v1.10.4_multiplatform.zip';
180
- }
151
+ c.runtime.platformBuildsProjectPath = getPlatformProjectDir(c);
152
+
153
+ if (!isPlatformActive(c, platform)) return;
154
+
155
+ await copyAssetsFolder(c, platform);
156
+ await configureCoreWebProject(c);
157
+ await configureProject(c);
158
+ copyBuildsFolder(c, platform);
159
+ };
160
+
161
+ // eslint-disable-next-line max-len
162
+ const sdkInstallerUUrl = 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/webos/ares_webos_builder_v1.10.4_multiplatform.zip';
181
163
 
182
164
  export const handleWebosSdk = async (c) => {
183
- const { WEBOS_SDK_INSTALLER_URL = getSdkInstallerUrl() } = process.env;
165
+ const { WEBOS_SDK_INSTALLER_URL = sdkInstallerUUrl } = process.env;
184
166
  const { WEBOS_SDK } = c.buildConfig?.sdks || {};
185
167
  const installPath = `${homedir()}/webOS_TV_SDK`;
186
- const rnvSdkKey = 'WEBOS_SDK'
187
-
168
+ const rnvSdkKey = 'WEBOS_SDK';
188
169
 
189
170
  if (!WEBOS_SDK) {
190
171
  if (fs.existsSync(installPath)) {
@@ -1,4 +1,3 @@
1
-
2
1
  import { WebpackUtils, Common, Logger, PlatformManager, ProjectManager } from 'rnv';
3
2
 
4
3
  const { getPlatformProjectDir } = Common;
@@ -8,7 +7,7 @@ const { copyBuildsFolder, copyAssetsFolder } = ProjectManager;
8
7
 
9
8
  const { buildCoreWebpackProject, configureCoreWebProject } = WebpackUtils;
10
9
 
11
- export const buildWeb = async c => buildCoreWebpackProject(c);
10
+ export const buildWeb = async (c) => buildCoreWebpackProject(c);
12
11
 
13
12
  export const configureWebProject = async (c) => {
14
13
  logTask('configureWebProject');
@@ -22,7 +21,7 @@ export const configureWebProject = async (c) => {
22
21
  await copyAssetsFolder(c, platform);
23
22
  await configureCoreWebProject(c);
24
23
 
25
- return copyBuildsFolder(c, platform);
24
+ copyBuildsFolder(c, platform);
26
25
  };
27
26
 
28
27
  export const deployWeb = () => {