@24i/smartapps-bigscreen-rnv-build-engine 0.0.2-alpha.1350 → 0.0.2-alpha.1351

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 (48) hide show
  1. package/dist/src/index.js +2 -5
  2. package/dist/src/resolvers/resolveDeployLocations.js +20 -4
  3. package/dist/src/resolvers/resolveGenericRnvConfig.js +5 -8
  4. package/dist/src/scripts/release/deployToAppCenter.js +21 -5
  5. package/dist/src/scripts/release/githubRelease.js +23 -7
  6. package/dist/src/scripts/release/sentryRelease.js +20 -4
  7. package/dist/src/scripts/utils/cmdUtils.js +5 -6
  8. package/dist/src/scripts/utils/fsUtils.js +25 -10
  9. package/dist/src/scripts/utils/gitUtils.js +35 -20
  10. package/dist/src/scripts/utils/stringUtils.js +3 -3
  11. package/dist/src/sdks/sdk-tizen/index.js +33 -17
  12. package/dist/src/sdks/sdk-webos/index.js +25 -9
  13. package/dist/src/tasks/deploy/aswS3/aws.js +20 -4
  14. package/dist/src/tasks/deploy/aswS3/deployS3.js +5 -8
  15. package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +5 -8
  16. package/dist/src/tasks/task.rnv.build.js +22 -6
  17. package/dist/src/tasks/task.rnv.hooks.run.js +20 -4
  18. package/dist/src/tasks/task.rnv.start.js +20 -4
  19. package/dist/src/utils/zipBuildsByPlatforms.js +20 -4
  20. package/dist/templates/platforms/_shared/template.js +2 -1
  21. package/dist/templates/platforms/_shared/webpack.base.js +56 -41
  22. package/dist/templates/platforms/entone/webpack.config.dev.js +24 -8
  23. package/dist/templates/platforms/entone/webpack.config.prod.js +24 -8
  24. package/dist/templates/platforms/hbbtv/webpack.config.dev.js +23 -7
  25. package/dist/templates/platforms/hbbtv/webpack.config.prod.js +23 -7
  26. package/dist/templates/platforms/tizen/webpack.config.dev.js +24 -8
  27. package/dist/templates/platforms/tizen/webpack.config.prod.js +24 -8
  28. package/dist/templates/platforms/webos/webpack.config.dev.js +24 -8
  29. package/dist/templates/platforms/webos/webpack.config.prod.js +24 -8
  30. package/dist/templates/platforms/webtv/webpack.config.dev.js +24 -8
  31. package/dist/templates/platforms/webtv/webpack.config.prod.js +24 -8
  32. package/dist/types/src/scripts/utils/cmdUtils.d.ts +4 -1
  33. package/dist/types/src/scripts/utils/fsUtils.d.ts +2 -1
  34. package/dist/types/src/scripts/utils/gitUtils.d.ts +14 -1
  35. package/dist/types/src/types/c.d.ts +4 -0
  36. package/dist/types/templates/platforms/_shared/template.d.ts +1 -1
  37. package/dist/types/templates/platforms/_shared/webpack.base.d.ts +80 -1
  38. package/dist/types/templates/platforms/entone/webpack.config.dev.d.ts +2 -1
  39. package/dist/types/templates/platforms/entone/webpack.config.prod.d.ts +2 -1
  40. package/dist/types/templates/platforms/hbbtv/webpack.config.dev.d.ts +2 -1
  41. package/dist/types/templates/platforms/hbbtv/webpack.config.prod.d.ts +2 -1
  42. package/dist/types/templates/platforms/tizen/webpack.config.dev.d.ts +2 -1
  43. package/dist/types/templates/platforms/tizen/webpack.config.prod.d.ts +2 -1
  44. package/dist/types/templates/platforms/webos/webpack.config.dev.d.ts +2 -1
  45. package/dist/types/templates/platforms/webos/webpack.config.prod.d.ts +2 -1
  46. package/dist/types/templates/platforms/webtv/webpack.config.dev.d.ts +2 -1
  47. package/dist/types/templates/platforms/webtv/webpack.config.prod.d.ts +2 -1
  48. package/package.json +5 -3
package/dist/src/index.js CHANGED
@@ -18,9 +18,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
18
18
  __setModuleDefault(result, mod);
19
19
  return result;
20
20
  };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
21
  Object.defineProperty(exports, "__esModule", { value: true });
25
22
  exports.Resolvers = exports.Constants = void 0;
26
23
  const rnv_1 = require("rnv");
@@ -28,7 +25,7 @@ const Constants = __importStar(require("./constants"));
28
25
  exports.Constants = Constants;
29
26
  const Resolvers = __importStar(require("./resolvers"));
30
27
  exports.Resolvers = Resolvers;
31
- const renative_engine_json_1 = __importDefault(require("../../renative.engine.json"));
28
+ const CNF = __importStar(require("../../renative.engine.json"));
32
29
  const constants_1 = require("./constants");
33
30
  const engineTasks_1 = require("./tasks/engineTasks");
34
31
  const { generateEngineTasks } = rnv_1.EngineManager;
@@ -46,7 +43,7 @@ const generateEngineExtensions = (platformExtensions = []) => {
46
43
  exports.default = {
47
44
  initializeRuntimeConfig: (c) => rnv_1.Config.initializeConfig(c),
48
45
  tasks: generateEngineTasks(engineTasks_1.engineTaskList),
49
- config: renative_engine_json_1.default,
46
+ config: CNF,
50
47
  projectDirName: 'project',
51
48
  serverDirName: 'server',
52
49
  ejectPlatform: null,
@@ -1,10 +1,26 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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;
4
20
  };
5
21
  Object.defineProperty(exports, "__esModule", { value: true });
6
22
  exports.resolveDeployLocations = void 0;
7
- const fs_1 = __importDefault(require("fs"));
23
+ const fs = __importStar(require("fs"));
8
24
  const resolveBuildVersion_1 = require("./resolveBuildVersion");
9
25
  const resolveBaseUrl_1 = require("./resolveBaseUrl");
10
26
  const resolveHbbtvDeployUrl_1 = require("./resolveHbbtvDeployUrl");
@@ -44,7 +60,7 @@ const makeUrls = (c, platformName, flavourName) => {
44
60
  if (!baseUrl)
45
61
  return null;
46
62
  const packageOutputDirPath = `platformBuilds/${flavourName}_${platformName}/output`;
47
- const outputFilenameList = fs_1.default.readdirSync(packageOutputDirPath);
63
+ const outputFilenameList = fs.readdirSync(packageOutputDirPath);
48
64
  const packageFileName = outputFilenameList[0];
49
65
  const packageUrl = packageFileName ? `${baseUrl}/build/${packageFileName}` : '';
50
66
  const indexUrl = isHbbTVPlatform
@@ -18,13 +18,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
18
18
  __setModuleDefault(result, mod);
19
19
  return result;
20
20
  };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
21
  Object.defineProperty(exports, "__esModule", { value: true });
25
22
  exports.getBaseConfig = exports.isObject = void 0;
26
- const fs_1 = __importDefault(require("fs"));
27
- const path_1 = __importDefault(require("path"));
23
+ const fs = __importStar(require("fs"));
24
+ const path = __importStar(require("path"));
28
25
  const ConfigManager = __importStar(require("rnv/dist/core/configManager"));
29
26
  const replaceRelevantStringsInConfig_1 = require("../utils/replaceRelevantStringsInConfig");
30
27
  function isObject(item) {
@@ -50,17 +47,17 @@ const mergeDeep = (target, ...sources) => {
50
47
  return mergeDeep(target, ...sources);
51
48
  };
52
49
  const mergeFileJsonIntoObject = (filePath = '', targetObject = {}) => {
53
- const fileContentAsString = fs_1.default.readFileSync(filePath).toString();
50
+ const fileContentAsString = fs.readFileSync(filePath).toString();
54
51
  const fileContentAsJSON = JSON.parse(fileContentAsString);
55
52
  mergeDeep(targetObject, fileContentAsJSON);
56
53
  };
57
54
  const getBaseConfig = () => {
58
55
  const c = ConfigManager.createRnvConfig({ ci: true }, process);
59
56
  c.buildConfig = {};
60
- const packageJsonfileContent = fs_1.default.readFileSync('package.json').toString();
57
+ const packageJsonfileContent = fs.readFileSync('package.json').toString();
61
58
  c.files.project.package = JSON.parse(packageJsonfileContent);
62
59
  mergeFileJsonIntoObject(c.paths.project.config, c.buildConfig);
63
- const baseConfigPath = path_1.default.join(c.paths.project.appConfigBase.dir, 'renative.json');
60
+ const baseConfigPath = path.join(c.paths.project.appConfigBase.dir, 'renative.json');
64
61
  mergeFileJsonIntoObject(baseConfigPath, c.buildConfig);
65
62
  replaceRelevantStringsInConfig_1.replaceRelevantStringsInConfig(c);
66
63
  return c;
@@ -1,11 +1,27 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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;
4
20
  };
5
21
  Object.defineProperty(exports, "__esModule", { value: true });
6
22
  exports.deployToAppCenter = void 0;
7
23
  const child_process_1 = require("child_process");
8
- const fs_1 = __importDefault(require("fs"));
24
+ const fs = __importStar(require("fs"));
9
25
  const common_1 = require("rnv/dist/core/common");
10
26
  const resolvers_1 = require("../../resolvers");
11
27
  const urlsMarkdown_1 = require("./urlsMarkdown");
@@ -45,8 +61,8 @@ const processPlatform = (c, platformName) => {
45
61
  if (!appName || !token || !releaseNotesPath || !zipPath || !buildVersion)
46
62
  return;
47
63
  const tempReleaseNotesPath = `RELEASE_NOTES_APPCENTER_${platformName.toUpperCase()}.md`;
48
- if (fs_1.default.existsSync(tempReleaseNotesPath)) {
49
- fs_1.default.unlinkSync(tempReleaseNotesPath);
64
+ if (fs.existsSync(tempReleaseNotesPath)) {
65
+ fs.unlinkSync(tempReleaseNotesPath);
50
66
  }
51
67
  child_process_1.execSync(`cat ${releaseNotesPath} >> ${tempReleaseNotesPath}`);
52
68
  const urlsMarkdown = urlsMarkdown_1.getUrlsMarkdown(c, [platformName]);
@@ -1,11 +1,27 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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;
4
20
  };
5
21
  Object.defineProperty(exports, "__esModule", { value: true });
6
22
  exports.githubRelease = void 0;
7
23
  const child_process_1 = require("child_process");
8
- const fs_1 = __importDefault(require("fs"));
24
+ const fs = __importStar(require("fs"));
9
25
  const assert_1 = require("assert");
10
26
  const path_1 = require("path");
11
27
  const resolvers_1 = require("../../resolvers");
@@ -37,8 +53,8 @@ const getReleaseNotesPath = (c) => {
37
53
  }
38
54
  };
39
55
  const deleteFileIfExists = (filePath) => {
40
- if (fs_1.default.existsSync(filePath)) {
41
- fs_1.default.unlinkSync(filePath);
56
+ if (fs.existsSync(filePath)) {
57
+ fs.unlinkSync(filePath);
42
58
  }
43
59
  };
44
60
  const makeGitHubReleaseNotes = (c) => {
@@ -58,7 +74,7 @@ const createRelease = (c) => {
58
74
  ok(git.repo, 'Missing value for rnv config prop: common.git.repo');
59
75
  ok(packageVersion);
60
76
  makeGitHubReleaseNotes(c);
61
- const releaseNotesContent = fs_1.default.readFileSync(githubReleaseNotesPath).toString();
77
+ const releaseNotesContent = fs.readFileSync(githubReleaseNotesPath).toString();
62
78
  const data = {
63
79
  tag_name: versionLabel,
64
80
  target_commitish: targetCommit,
@@ -88,7 +104,7 @@ const uploadAsset = (uploadUrl = '', filePath) => {
88
104
  if (!uploadUrl)
89
105
  return null;
90
106
  const url = `${uploadUrl.replace('{?name,label}', '')}`;
91
- const headers = `-H "Accept: ${githubContentType}" -H "Authorization: token ${token}" -H "content-type: ${getFileMimeType(filePath)}" -H "content-length: ${fs_1.default.statSync(filePath).size}"`;
107
+ const headers = `-H "Accept: ${githubContentType}" -H "Authorization: token ${token}" -H "content-type: ${getFileMimeType(filePath)}" -H "content-length: ${fs.statSync(filePath).size}"`;
92
108
  const cmd = `curl --data-binary @"${filePath}" ${headers} ${url}?name=${path_1.basename(filePath)}`;
93
109
  console.log(`Uploading ${filePath} asset to created GitHub Release...`);
94
110
  const responseString = child_process_1.execSync(cmd, { stdio: 'pipe' }).toString();
@@ -1,11 +1,27 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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;
4
20
  };
5
21
  Object.defineProperty(exports, "__esModule", { value: true });
6
22
  exports.sentryRelease = void 0;
7
23
  const child_process_1 = require("child_process");
8
- const fs_1 = __importDefault(require("fs"));
24
+ const fs = __importStar(require("fs"));
9
25
  const constants_1 = require("../../constants");
10
26
  const UNSUPPORTED_PLATFORMS = [constants_1.Platforms.WEBTV];
11
27
  const executeSync = (cmd) => child_process_1.execSync(cmd, { stdio: 'inherit' });
@@ -37,7 +53,7 @@ const processPlatform = (c, platform, version) => {
37
53
  const { platformBuildsDir } = c.buildConfig.paths;
38
54
  const mapsPath = `${platformBuildsDir}/${flavour}_${platform}-public/public/content/js`;
39
55
  const urlPrefix = `builds/${platform}/${flavour}/dist/${version}/public/content/js/`;
40
- if (!fs_1.default.existsSync(mapsPath))
56
+ if (!fs.existsSync(mapsPath))
41
57
  return;
42
58
  console.log(`Uploading ${flavour}_${platform} sourcemaps to Sentry...`);
43
59
  uploadSourceMaps({ version, sourceMapsPath: mapsPath, urlPrefix });
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cmdSyncTrimOut = exports.cmdSyncPipeOut = exports.cmdSyncInheritOut = exports.cmdSync = void 0;
3
4
  const child_process_1 = require("child_process");
4
5
  const cmdSync = (command, options) => child_process_1.execSync(command, options);
6
+ exports.cmdSync = cmdSync;
5
7
  const cmdSyncInheritOut = (command) => cmdSync(command, { stdio: 'inherit' });
8
+ exports.cmdSyncInheritOut = cmdSyncInheritOut;
6
9
  const cmdSyncPipeOut = (command) => cmdSync(command, { stdio: 'pipe' });
10
+ exports.cmdSyncPipeOut = cmdSyncPipeOut;
7
11
  const cmdSyncTrimOut = (command) => cmdSync(command).toString().trim();
8
- module.exports = {
9
- cmdSync,
10
- cmdSyncInheritOut,
11
- cmdSyncPipeOut,
12
- cmdSyncTrimOut,
13
- };
12
+ exports.cmdSyncTrimOut = cmdSyncTrimOut;
@@ -1,16 +1,31 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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;
4
20
  };
5
21
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const fs_1 = __importDefault(require("fs"));
7
- const assert_1 = __importDefault(require("assert"));
8
- const getFileContentAsString = (filePath) => fs_1.default.readFileSync(filePath).toString();
22
+ exports.assertPath = exports.getFileContentAsString = void 0;
23
+ const fs = __importStar(require("fs"));
24
+ const assert = __importStar(require("assert"));
25
+ const getFileContentAsString = (filePath) => fs.readFileSync(filePath).toString();
26
+ exports.getFileContentAsString = getFileContentAsString;
9
27
  const assertPath = (path) => {
10
28
  const errorMsg = `File or path ${path} does not exist!`;
11
- assert_1.default.strict.ok(fs_1.default.existsSync(path), errorMsg);
12
- };
13
- module.exports = {
14
- getFileContentAsString,
15
- assertPath,
29
+ assert.strict.ok(fs.existsSync(path), errorMsg);
16
30
  };
31
+ exports.assertPath = assertPath;
@@ -1,12 +1,29 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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;
4
20
  };
5
21
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const assert_1 = __importDefault(require("assert"));
22
+ exports.assertRemoteBranch = exports.assertCurrentBranch = exports.assertEmptyStatusList = exports.push = exports.commit = exports.createBranch = exports.checkout = exports.add = exports.addAll = exports.pull = exports.remoteBranchExists = exports.pullRequest = exports.getCurrentBranchName = exports.statusList = void 0;
23
+ const assert = __importStar(require("assert"));
7
24
  const cmdUtils_1 = require("./cmdUtils");
8
25
  const stringUtils_1 = require("./stringUtils");
9
- const { ok } = assert_1.default.strict;
26
+ const { ok } = assert.strict;
10
27
  const statusList = () => {
11
28
  const gitCmd = 'git status --porcelain';
12
29
  const outputString = cmdUtils_1.cmdSyncTrimOut(gitCmd);
@@ -19,7 +36,9 @@ const statusList = () => {
19
36
  };
20
37
  return stringUtils_1.splitByNewLine(outputString).map(handleMultipleWhitespaces);
21
38
  };
39
+ exports.statusList = statusList;
22
40
  const getCurrentBranchName = () => cmdUtils_1.cmdSyncTrimOut('git branch --show-current');
41
+ exports.getCurrentBranchName = getCurrentBranchName;
23
42
  const pullRequest = (fromBranch, toBranch, prTitle) => {
24
43
  const cmdTool = 'hub';
25
44
  const installDocUrl = 'https://github.com/github/hub#installation';
@@ -34,50 +53,46 @@ const pullRequest = (fromBranch, toBranch, prTitle) => {
34
53
  const cmd = `${cmdTool} pull-request -m "${prTitle}" --head ${fromBranch} --base ${toBranch}`;
35
54
  cmdUtils_1.cmdSyncInheritOut(cmd);
36
55
  };
56
+ exports.pullRequest = pullRequest;
37
57
  const remoteBranchExists = (expectedBranchName) => {
38
58
  const gitCmd = `git ls-remote --heads origin ${expectedBranchName}`;
39
59
  const output = cmdUtils_1.cmdSyncTrimOut(gitCmd);
40
60
  return Boolean(output);
41
61
  };
62
+ exports.remoteBranchExists = remoteBranchExists;
42
63
  const pull = () => cmdUtils_1.cmdSyncPipeOut('git remote update -p && git merge --ff-only @{u}');
64
+ exports.pull = pull;
43
65
  const addAll = () => cmdUtils_1.cmdSyncPipeOut('git add --all');
66
+ exports.addAll = addAll;
44
67
  const add = (fileList) => cmdUtils_1.cmdSyncPipeOut(`git add ${fileList.join(' ')}`);
68
+ exports.add = add;
45
69
  const checkout = (branchName) => cmdUtils_1.cmdSyncPipeOut(`git checkout ${branchName}`);
70
+ exports.checkout = checkout;
46
71
  const createBranch = (branchName) => cmdUtils_1.cmdSyncPipeOut(`git branch ${branchName}`);
72
+ exports.createBranch = createBranch;
47
73
  const commit = (commitMessage, noVerify) => {
48
74
  const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
49
75
  return cmdUtils_1.cmdSyncPipeOut(`git commit -m "${commitMessage}" ${maybeNoVerifyParam}`.trimEnd());
50
76
  };
77
+ exports.commit = commit;
51
78
  const push = (branchName, noVerify) => {
52
79
  const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
53
80
  const cmd = `git push --set-upstream origin ${branchName} ${maybeNoVerifyParam}`.trimEnd();
54
81
  return cmdUtils_1.cmdSyncPipeOut(cmd);
55
82
  };
83
+ exports.push = push;
56
84
  const assertEmptyStatusList = () => {
57
85
  ok(statusList().length === 0, 'An empty GIT stage is expected!');
58
86
  };
87
+ exports.assertEmptyStatusList = assertEmptyStatusList;
59
88
  const assertCurrentBranch = (expectedBranchName) => {
60
89
  const currentGitBranchName = getCurrentBranchName();
61
90
  const errorMsg = `The ${expectedBranchName} branch is expected to be active, not "${currentGitBranchName}"`;
62
91
  ok(currentGitBranchName === expectedBranchName, errorMsg);
63
92
  };
93
+ exports.assertCurrentBranch = assertCurrentBranch;
64
94
  const assertRemoteBranch = (expectedBranchName) => {
65
95
  const errorMsg = `Remote branch ${expectedBranchName} does not exist!`;
66
96
  ok(remoteBranchExists(expectedBranchName), errorMsg);
67
97
  };
68
- module.exports = {
69
- statusList,
70
- getCurrentBranchName,
71
- pullRequest,
72
- remoteBranchExists,
73
- pull,
74
- addAll,
75
- add,
76
- checkout,
77
- createBranch,
78
- commit,
79
- push,
80
- assertEmptyStatusList,
81
- assertCurrentBranch,
82
- assertRemoteBranch,
83
- };
98
+ exports.assertRemoteBranch = assertRemoteBranch;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.splitByNewLine = void 0;
2
4
  const splitByNewLine = (string = '') => string.split(/\r?\n/);
3
- module.exports = {
4
- splitByNewLine,
5
- };
5
+ exports.splitByNewLine = splitByNewLine;
@@ -1,13 +1,29 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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;
4
20
  };
5
21
  Object.defineProperty(exports, "__esModule", { value: true });
6
22
  exports.runTizen = exports.handleTizenSdk = exports.configureTizenProject = exports.configureTizenGlobal = exports.buildTizenProject = void 0;
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- const os_1 = __importDefault(require("os"));
10
- const semver_1 = __importDefault(require("semver"));
23
+ const fs = __importStar(require("fs"));
24
+ const path = __importStar(require("path"));
25
+ const os = __importStar(require("os"));
26
+ const semver = __importStar(require("semver"));
11
27
  const rnv_1 = require("rnv");
12
28
  const child_process_1 = require("child_process");
13
29
  const installer_1 = require("rnv/dist/core/sdkManager/installer");
@@ -24,7 +40,7 @@ const { runTizenSimOrDevice, createDevelopTizenCertificate, DEFAULT_CERTIFICATE_
24
40
  const DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION = `${DEFAULT_CERTIFICATE_NAME}.p12`;
25
41
  const configureTizenGlobal = (c) => new Promise((resolve, reject) => {
26
42
  logTask('configureTizenGlobal');
27
- const authorCert = path_1.default.join(c.paths.workspace.dir, DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION);
43
+ const authorCert = path.join(c.paths.workspace.dir, DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION);
28
44
  if (fsExistsSync(authorCert)) {
29
45
  logDebug(`${DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION} file exists!`);
30
46
  resolve();
@@ -100,9 +116,9 @@ const buildTizenProject = async (c) => {
100
116
  const { buildConfig, platform } = c;
101
117
  const platformConfig = buildConfig.platforms[platform];
102
118
  const projectDir = getPlatformProjectDir(c);
103
- const projectParentDir = path_1.default.join(projectDir, '..');
104
- const tBuild = path_1.default.join(projectParentDir, 'build');
105
- const tOut = path_1.default.join(projectParentDir, 'output');
119
+ const projectParentDir = path.join(projectDir, '..');
120
+ const tBuild = path.join(projectParentDir, 'build');
121
+ const tOut = path.join(projectParentDir, 'output');
106
122
  const certProfile = (_a = platformConfig.certificateProfile) !== null && _a !== void 0 ? _a : DEFAULT_SECURITY_PROFILE_NAME;
107
123
  await execCLI(c, CLI_TIZEN, `build-web -- ${projectDir} -out ${tBuild}`);
108
124
  await execCLI(c, CLI_TIZEN, `package -- ${tBuild} -s ${certProfile} -t wgt -o ${tOut}`);
@@ -121,10 +137,10 @@ const configureProject = (c) => new Promise((resolve) => {
121
137
  { pattern: '{{PACKAGE}}', override: p.package },
122
138
  { pattern: '{{ID}}', override: p.id },
123
139
  { pattern: '{{APP_NAME}}', override: p.appName },
124
- { pattern: '{{APP_VERSION}}', override: semver_1.default.coerce(getAppVersion(c, platform)) },
140
+ { pattern: '{{APP_VERSION}}', override: semver.coerce(getAppVersion(c, platform)) },
125
141
  ];
126
142
  addSystemInjects(c, injects);
127
- const file = path_1.default.join(getPlatformProjectDir(c), configFile);
143
+ const file = path.join(getPlatformProjectDir(c), configFile);
128
144
  writeCleanFile(file, file, injects, null, c);
129
145
  resolve();
130
146
  });
@@ -146,7 +162,7 @@ const configureTizenProject = async (c) => {
146
162
  };
147
163
  exports.configureTizenProject = configureTizenProject;
148
164
  const handleLinuxKeyring = () => {
149
- if (process.env.CI && os_1.default.platform() === 'linux') {
165
+ if (process.env.CI && os.platform() === 'linux') {
150
166
  const options = { stdio: 'inherit' };
151
167
  child_process_1.execSync('eval $(dbus-launch --sh-syntax)', options);
152
168
  child_process_1.execSync('mkdir -p ~/.cache', options);
@@ -158,7 +174,7 @@ const handleLinuxKeyring = () => {
158
174
  const setTizenCertificate = (c) => {
159
175
  const { TIZEN_SECURITY_PROFILE_NAME = '24i-SmartApps-BigScreen', TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH = 'certificates/24i_smartapps_bigscreen_author.p12', TIZEN_AUTHOR_CERTIFICATE_PASSWORD, } = process.env;
160
176
  const tizenCliPath = c.cli.tizen;
161
- if (!fs_1.default.existsSync(TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH)) {
177
+ if (!fs.existsSync(TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH)) {
162
178
  console.log(`'process.env.TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH' points to not existing location: ${TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH}`);
163
179
  return false;
164
180
  }
@@ -193,7 +209,7 @@ const setTizenCertificate = (c) => {
193
209
  return true;
194
210
  };
195
211
  const getSdkInstallerUrl = () => {
196
- switch (os_1.default.platform()) {
212
+ switch (os.platform()) {
197
213
  case 'darwin':
198
214
  return 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/tizen/tizen_builder_v3.7_mac.zip';
199
215
  case 'linux':
@@ -206,11 +222,11 @@ const handleTizenSdk = async (c) => {
206
222
  var _a;
207
223
  const { TIZEN_SDK_INSTALLER_URL = getSdkInstallerUrl() } = process.env;
208
224
  const { TIZEN_SDK } = ((_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.sdks) || {};
209
- const installPath = `${os_1.default.homedir()}/tizen-studio`;
225
+ const installPath = `${os.homedir()}/tizen-studio`;
210
226
  const rnvSdkKey = 'TIZEN_SDK';
211
227
  if (!TIZEN_SDK) {
212
228
  handleLinuxKeyring();
213
- if (fs_1.default.existsSync(installPath)) {
229
+ if (fs.existsSync(installPath)) {
214
230
  await sdkUtils_1.registerSdkPath(c, rnvSdkKey, installPath);
215
231
  }
216
232
  else {
@@ -1,12 +1,28 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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;
4
20
  };
5
21
  Object.defineProperty(exports, "__esModule", { value: true });
6
22
  exports.handleWebosSdk = exports.configureWebOSProject = exports.buildWebOSProject = exports.runWebOS = void 0;
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- const semver_1 = __importDefault(require("semver"));
23
+ const fs = __importStar(require("fs"));
24
+ const path = __importStar(require("path"));
25
+ const semver = __importStar(require("semver"));
10
26
  const os_1 = require("os");
11
27
  const rnv_1 = require("rnv");
12
28
  const installer_1 = require("rnv/dist/core/sdkManager/installer");
@@ -71,7 +87,7 @@ const buildWebOSProject = async (c) => {
71
87
  await buildCoreWebpackProject(c);
72
88
  if (!c.program.hosted) {
73
89
  const tDir = getPlatformProjectDir(c);
74
- const tOut = path_1.default.join(getPlatformBuildDir(c), 'output');
90
+ const tOut = path.join(getPlatformBuildDir(c), 'output');
75
91
  await execCLI(c, CLI_WEBOS_ARES_PACKAGE, `-o ${tOut} ${tDir} -n`);
76
92
  logSuccess(`Your IPK package is located in ${chalk().cyan(tOut)} .`);
77
93
  }
@@ -92,7 +108,7 @@ const configureProject = async (c) => {
92
108
  },
93
109
  {
94
110
  pattern: '{{APP_VERSION}}',
95
- override: semver_1.default.coerce(getAppVersion(c, platform)),
111
+ override: semver.coerce(getAppVersion(c, platform)),
96
112
  },
97
113
  {
98
114
  pattern: '{{APP_DESCRIPTION}}',
@@ -112,7 +128,7 @@ const configureProject = async (c) => {
112
128
  },
113
129
  ];
114
130
  addSystemInjects(c, injects);
115
- writeCleanFile(path_1.default.join(getTemplateProjectDir(c), configFile), path_1.default.join(getPlatformProjectDir(c), configFile), injects, null, c);
131
+ writeCleanFile(path.join(getTemplateProjectDir(c), configFile), path.join(getPlatformProjectDir(c), configFile), injects, null, c);
116
132
  return true;
117
133
  };
118
134
  const configureWebOSProject = async (c) => {
@@ -135,7 +151,7 @@ const handleWebosSdk = async (c) => {
135
151
  const installPath = `${os_1.homedir()}/webOS_TV_SDK`;
136
152
  const rnvSdkKey = 'WEBOS_SDK';
137
153
  if (!WEBOS_SDK) {
138
- if (fs_1.default.existsSync(installPath)) {
154
+ if (fs.existsSync(installPath)) {
139
155
  await sdkUtils_1.registerSdkPath(c, rnvSdkKey, installPath);
140
156
  }
141
157
  const sdkInstalledToPath = await sdkUtils_1.installSdk(WEBOS_SDK_INSTALLER_URL, installPath);
@@ -1,13 +1,29 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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;
4
20
  };
5
21
  Object.defineProperty(exports, "__esModule", { value: true });
6
22
  exports.rm = exports.cp = void 0;
7
23
  const child_process_1 = require("child_process");
8
- const fs_1 = __importDefault(require("fs"));
24
+ const fs = __importStar(require("fs"));
9
25
  const runCmdSync = (cmd) => child_process_1.execSync(cmd, { stdio: 'inherit' });
10
- const isDir = (path) => fs_1.default.existsSync(path) && fs_1.default.lstatSync(path).isDirectory();
26
+ const isDir = (path) => fs.existsSync(path) && fs.lstatSync(path).isDirectory();
11
27
  const cp = (source, destination) => {
12
28
  let cmd = `aws s3 cp ${source} s3://${destination} --acl public-read`;
13
29
  if (isDir(source)) {