@24i/smartapps-bigscreen-rnv-build-engine 0.8.6 → 0.8.7-alpha.1415

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 (29) hide show
  1. package/dist/src/resolvers/index.js +9 -1
  2. package/dist/src/resolvers/resolveBaseUrl.js +3 -3
  3. package/dist/src/resolvers/resolveBuildFileExtension.js +12 -0
  4. package/dist/src/resolvers/resolveBuildFileName.js +35 -0
  5. package/dist/src/resolvers/resolveBuildVersion.js +2 -2
  6. package/dist/src/resolvers/resolveDeployLocations.js +29 -35
  7. package/dist/src/resolvers/resolveGenericRnvConfig.js +3 -24
  8. package/dist/src/resolvers/resolveSupportedPlatforms.js +5 -0
  9. package/dist/src/resolvers/resolveUsedFlavours.js +23 -0
  10. package/dist/src/scripts/generateDeployUrls/formatTableDataSpaces.js +30 -0
  11. package/dist/src/scripts/generateDeployUrls/index.js +88 -0
  12. package/dist/src/scripts/generateDeployUrls/makeTableDataByScheme.js +63 -0
  13. package/dist/src/scripts/release/deployToAppCenter.js +1 -2
  14. package/dist/src/scripts/release/githubRelease.js +1 -1
  15. package/dist/src/scripts/release/notifySlack/makePayload.js +9 -6
  16. package/dist/src/scripts/release/notifySlack/notifySlack.js +4 -3
  17. package/dist/src/scripts/release/sentryRelease.js +2 -1
  18. package/dist/src/scripts/releaseAllWithScheme.js +5 -4
  19. package/dist/src/scripts/utils/fsUtils.js +3 -1
  20. package/dist/src/sdks/sdk-tizen/index.js +4 -3
  21. package/dist/src/tasks/deploy/aswS3/aws.js +2 -22
  22. package/dist/src/tasks/deploy/aswS3/deployS3.js +2 -4
  23. package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +4 -12
  24. package/dist/src/tasks/task.rnv.build.js +3 -39
  25. package/dist/src/types/constants.js +2 -0
  26. package/dist/src/utils/forEachSupportedPlatformFlavour.js +4 -3
  27. package/dist/src/utils/mergeDeep.js +23 -0
  28. package/dist/src/utils/zipBuildsByPlatforms.js +3 -11
  29. package/package.json +2 -3
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveZippedPlatformBuildsRelativeFilePath = exports.getBaseConfig = exports.resolveHbbtvDeployConfig = exports.resolveHbbtvDeployUrl = exports.resolveHbbtvRemoteBuildDirRelativePath = exports.resolveDeployLocations = exports.resolveBuildVersionOffset = exports.resolveBuildVersion = exports.resolveBaseUrl = void 0;
3
+ exports.resolveZippedPlatformBuildsRelativeFilePath = exports.resolveBuildFileExtension = exports.resolveUsedFlavours = exports.resolveSupportedPlatforms = exports.getBaseConfig = exports.resolveBuildFileName = exports.resolveHbbtvDeployConfig = exports.resolveHbbtvDeployUrl = exports.resolveHbbtvRemoteBuildDirRelativePath = exports.resolveDeployLocations = exports.resolveBuildVersionOffset = exports.resolveBuildVersion = exports.resolveBaseUrl = void 0;
4
4
  var resolveBaseUrl_1 = require("./resolveBaseUrl");
5
5
  Object.defineProperty(exports, "resolveBaseUrl", { enumerable: true, get: function () { return resolveBaseUrl_1.resolveBaseUrl; } });
6
6
  var resolveBuildVersion_1 = require("./resolveBuildVersion");
@@ -15,7 +15,15 @@ var resolveHbbtvDeployUrl_1 = require("./resolveHbbtvDeployUrl");
15
15
  Object.defineProperty(exports, "resolveHbbtvDeployUrl", { enumerable: true, get: function () { return resolveHbbtvDeployUrl_1.resolveHbbtvDeployUrl; } });
16
16
  var resolveHbbtvDeployConfig_1 = require("./resolveHbbtvDeployConfig");
17
17
  Object.defineProperty(exports, "resolveHbbtvDeployConfig", { enumerable: true, get: function () { return resolveHbbtvDeployConfig_1.resolveHbbtvDeployConfig; } });
18
+ var resolveBuildFileName_1 = require("./resolveBuildFileName");
19
+ Object.defineProperty(exports, "resolveBuildFileName", { enumerable: true, get: function () { return resolveBuildFileName_1.resolveBuildFileName; } });
18
20
  var resolveGenericRnvConfig_1 = require("./resolveGenericRnvConfig");
19
21
  Object.defineProperty(exports, "getBaseConfig", { enumerable: true, get: function () { return resolveGenericRnvConfig_1.getBaseConfig; } });
22
+ var resolveSupportedPlatforms_1 = require("./resolveSupportedPlatforms");
23
+ Object.defineProperty(exports, "resolveSupportedPlatforms", { enumerable: true, get: function () { return resolveSupportedPlatforms_1.resolveSupportedPlatforms; } });
24
+ var resolveUsedFlavours_1 = require("./resolveUsedFlavours");
25
+ Object.defineProperty(exports, "resolveUsedFlavours", { enumerable: true, get: function () { return resolveUsedFlavours_1.resolveUsedFlavours; } });
26
+ var resolveBuildFileExtension_1 = require("./resolveBuildFileExtension");
27
+ Object.defineProperty(exports, "resolveBuildFileExtension", { enumerable: true, get: function () { return resolveBuildFileExtension_1.resolveBuildFileExtension; } });
20
28
  var resolveZippedPlatformBuildsRelativeFilePath_1 = require("./resolveZippedPlatformBuildsRelativeFilePath");
21
29
  Object.defineProperty(exports, "resolveZippedPlatformBuildsRelativeFilePath", { enumerable: true, get: function () { return resolveZippedPlatformBuildsRelativeFilePath_1.resolveZippedPlatformBuildsRelativeFilePath; } });
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveBaseUrl = void 0;
4
4
  const resolveGenericRnvConfig_1 = require("./resolveGenericRnvConfig");
5
5
  const constants_1 = require("../constants");
6
- const resolveBaseUrl = ({ platform = '', scheme = '', appConfigId = '' }) => {
6
+ const resolveBaseUrl = ({ platform, scheme, flavour }) => {
7
7
  const c = resolveGenericRnvConfig_1.getBaseConfig();
8
8
  c.platform = platform;
9
9
  c.runtime.scheme = scheme;
10
- c.runtime.appId = appConfigId;
10
+ c.runtime.appId = flavour;
11
11
  const { packageVersion = '', deploy = {} } = c.buildConfig?.common || {};
12
12
  const bucketName = deploy.aws3?.bucketName || '';
13
13
  const bucketUrl = `http://${bucketName}.s3.amazonaws.com`;
14
- const appFolderUrl = `${bucketUrl}/builds/${platform}/${appConfigId}`;
14
+ const appFolderUrl = `${bucketUrl}/builds/${platform}/${flavour}`;
15
15
  if (!packageVersion) {
16
16
  return '';
17
17
  }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveBuildFileExtension = void 0;
4
+ const constants_1 = require("../constants");
5
+ const resolveBuildFileExtension = (platform) => {
6
+ switch (platform) {
7
+ case constants_1.Platforms.TIZEN: return 'wgt';
8
+ case constants_1.Platforms.WEBOS: return 'ipk';
9
+ default: return 'zip';
10
+ }
11
+ };
12
+ exports.resolveBuildFileExtension = resolveBuildFileExtension;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveBuildFileName = void 0;
4
+ const rnv_1 = require("rnv");
5
+ const resolveBuildVersion_1 = require("./resolveBuildVersion");
6
+ const constants_1 = require("../constants");
7
+ const resolveBuildFileExtension_1 = require("./resolveBuildFileExtension");
8
+ const { getConfigProp } = rnv_1.Common;
9
+ const getBuildVersionForFileName = (c) => {
10
+ const { platform, runtime } = c;
11
+ const { scheme, appId } = runtime;
12
+ switch (c.runtime.scheme) {
13
+ case constants_1.BuildSchemes.DEV_LATEST:
14
+ return 'latest.dev';
15
+ case constants_1.BuildSchemes.RC_LATEST:
16
+ return 'latest.rc';
17
+ case constants_1.BuildSchemes.RELEASE_LATEST:
18
+ return 'latest.release';
19
+ default:
20
+ return resolveBuildVersion_1.resolveBuildVersion({
21
+ platform,
22
+ scheme,
23
+ flavour: appId,
24
+ });
25
+ }
26
+ };
27
+ const resolveBuildFileName = (c) => {
28
+ const platformName = c.platform;
29
+ const appNameInFileName = getConfigProp(c, platformName, 'appNameInFileName', '');
30
+ const buildVersion = getBuildVersionForFileName(c);
31
+ const appConfigId = c.runtime.appId || '';
32
+ const extension = resolveBuildFileExtension_1.resolveBuildFileExtension(platformName);
33
+ return `${appNameInFileName}_${platformName}_${buildVersion}_${appConfigId}.${extension}`;
34
+ };
35
+ exports.resolveBuildFileName = resolveBuildFileName;
@@ -29,11 +29,11 @@ const resolveVersionOffset = (c) => {
29
29
  ? `-${versionOffsetString}`
30
30
  : '';
31
31
  };
32
- const resolveBuildVersion = ({ platform = '', scheme = '', appConfigId = '' }) => {
32
+ const resolveBuildVersion = ({ platform, scheme, flavour }) => {
33
33
  const c = resolveGenericRnvConfig_1.getBaseConfig();
34
34
  c.platform = platform;
35
35
  c.runtime.scheme = scheme;
36
- c.runtime.appId = appConfigId;
36
+ c.runtime.appId = flavour;
37
37
  const packageVersion = resolvePackageVersion(c);
38
38
  const buildType = resolveBuildType(c);
39
39
  const maybeGitCommitsOffset = resolveVersionOffset(c);
@@ -1,43 +1,21 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
22
3
  exports.resolveDeployLocations = void 0;
23
- const fs = __importStar(require("fs"));
24
4
  const resolveBuildVersion_1 = require("./resolveBuildVersion");
25
5
  const resolveBaseUrl_1 = require("./resolveBaseUrl");
26
6
  const resolveHbbtvDeployUrl_1 = require("./resolveHbbtvDeployUrl");
7
+ const resolveBuildFileName_1 = require("./resolveBuildFileName");
27
8
  const constants_1 = require("../constants");
9
+ const resolveSupportedPlatforms_1 = require("./resolveSupportedPlatforms");
28
10
  const getBuildVersion = (c) => {
29
11
  const { platform, runtime } = c;
30
12
  const { scheme, appId } = runtime;
31
13
  return resolveBuildVersion_1.resolveBuildVersion({
32
14
  platform,
33
15
  scheme,
34
- appConfigId: appId,
16
+ flavour: appId,
35
17
  });
36
18
  };
37
- const getSupportedPlatforms = (c) => {
38
- const { supportedPlatforms = [] } = c.buildConfig.defaults || {};
39
- return supportedPlatforms;
40
- };
41
19
  const getSupportedFlavoursForPlatform = (c, platformName) => {
42
20
  const { supportedFlavours = [] } = c.buildConfig.platforms[platformName]?.deploy || {};
43
21
  return supportedFlavours;
@@ -51,19 +29,18 @@ const makeOutputObject = (buildVersion = '') => ({
51
29
  });
52
30
  const makeUrls = (c, platformName, flavourName) => {
53
31
  const isHbbTVPlatform = platformName === constants_1.Platforms.HBBTV;
32
+ const { scheme } = c.runtime;
54
33
  const baseUrl = resolveBaseUrl_1.resolveBaseUrl({
55
34
  platform: platformName,
56
- scheme: c.runtime.scheme || '',
57
- appConfigId: flavourName,
35
+ scheme,
36
+ flavour: flavourName,
58
37
  });
59
38
  if (!baseUrl)
60
39
  return null;
61
- const packageOutputDirPath = `platformBuilds/${flavourName}_${platformName}/output`;
62
- const outputFilenameList = fs.readdirSync(packageOutputDirPath);
63
- const packageFileName = outputFilenameList[0];
40
+ const packageFileName = resolveBuildFileName_1.resolveBuildFileName(c);
64
41
  const packageUrl = packageFileName ? `${baseUrl}/build/${packageFileName}` : '';
65
42
  const indexUrl = isHbbTVPlatform
66
- ? resolveHbbtvDeployUrl_1.resolveHbbtvDeployUrl(c, c.runtime.scheme, flavourName)
43
+ ? resolveHbbtvDeployUrl_1.resolveHbbtvDeployUrl(c, scheme, flavourName)
67
44
  : `${baseUrl}/public/index.html`;
68
45
  return { packageUrl, indexUrl };
69
46
  };
@@ -72,14 +49,31 @@ const resolveDeployLocations = (c) => {
72
49
  const output = makeOutputObject(buildVersion);
73
50
  const outputPlatforms = output.versions[buildVersion].platforms;
74
51
  const processPlatform = (platformName) => {
75
- const processPlatformFlavour = (flavourName) => ({
76
- [flavourName]: makeUrls(c, platformName, flavourName),
77
- });
52
+ const originalPlatform = c.platform;
53
+ const isRequiredPlatformSet = originalPlatform === platformName;
54
+ if (!isRequiredPlatformSet) {
55
+ c.platform = platformName;
56
+ }
57
+ const processPlatformFlavour = (flavourName) => {
58
+ const originalFlavour = c.runtime.appId;
59
+ const isRequestedFlavourSet = originalFlavour === flavourName;
60
+ if (!isRequestedFlavourSet) {
61
+ c.runtime.appId = flavourName;
62
+ }
63
+ const outputFlavourData = { [flavourName]: makeUrls(c, platformName, flavourName) };
64
+ if (!isRequestedFlavourSet) {
65
+ c.runtime.appId = originalFlavour;
66
+ }
67
+ return outputFlavourData;
68
+ };
78
69
  const outputPlatformData = getSupportedFlavoursForPlatform(c, platformName)
79
70
  .map(processPlatformFlavour);
80
71
  outputPlatforms[platformName] = Object.assign({}, ...outputPlatformData);
72
+ if (!isRequiredPlatformSet) {
73
+ c.platform = originalPlatform;
74
+ }
81
75
  };
82
- getSupportedPlatforms(c).forEach(processPlatform);
76
+ resolveSupportedPlatforms_1.resolveSupportedPlatforms(c).forEach(processPlatform);
83
77
  return output;
84
78
  };
85
79
  exports.resolveDeployLocations = resolveDeployLocations;
@@ -19,37 +19,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.getBaseConfig = exports.isObject = void 0;
22
+ exports.getBaseConfig = void 0;
23
23
  const fs = __importStar(require("fs"));
24
24
  const path = __importStar(require("path"));
25
25
  const rnv_1 = require("rnv");
26
26
  const replaceRelevantStringsInConfig_1 = require("../utils/replaceRelevantStringsInConfig");
27
- function isObject(item) {
28
- return (item && typeof item === 'object' && !Array.isArray(item));
29
- }
30
- exports.isObject = isObject;
31
- const mergeDeep = (target, ...sources) => {
32
- if (!sources.length)
33
- return target;
34
- const source = sources.shift();
35
- if (isObject(target) && isObject(source)) {
36
- Object.keys(source).forEach((key) => {
37
- if (isObject(source[key])) {
38
- if (!target[key])
39
- Object.assign(target, { [key]: {} });
40
- mergeDeep(target[key], source[key]);
41
- }
42
- else {
43
- Object.assign(target, { [key]: source[key] });
44
- }
45
- });
46
- }
47
- return mergeDeep(target, ...sources);
48
- };
27
+ const mergeDeep_1 = require("../utils/mergeDeep");
49
28
  const mergeFileJsonIntoObject = (filePath = '', targetObject = {}) => {
50
29
  const fileContentAsString = fs.readFileSync(filePath).toString();
51
30
  const fileContentAsJSON = JSON.parse(fileContentAsString);
52
- mergeDeep(targetObject, fileContentAsJSON);
31
+ mergeDeep_1.mergeDeep(targetObject, fileContentAsJSON);
53
32
  };
54
33
  const getBaseConfig = () => {
55
34
  const c = rnv_1.ConfigManager.createRnvConfig({ ci: true }, process);
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveSupportedPlatforms = void 0;
4
+ const resolveSupportedPlatforms = (rnvC) => (rnvC.buildConfig.defaults.supportedPlatforms || []);
5
+ exports.resolveSupportedPlatforms = resolveSupportedPlatforms;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveUsedFlavours = void 0;
4
+ const resolveSupportedPlatforms_1 = require("./resolveSupportedPlatforms");
5
+ const resolveUsedFlavours = (rnvC) => {
6
+ const usedFlavours = [];
7
+ const supportedPlatforms = resolveSupportedPlatforms_1.resolveSupportedPlatforms(rnvC);
8
+ for (let i = 0; i < supportedPlatforms.length; i++) {
9
+ const iPlatform = supportedPlatforms[i];
10
+ const iPlatformDeployConfig = rnvC.buildConfig.platforms[iPlatform]?.deploy;
11
+ if (iPlatformDeployConfig) {
12
+ const configuredFlavoursForPlatform = iPlatformDeployConfig.supportedFlavours || [];
13
+ for (let j = 0; j < configuredFlavoursForPlatform.length; j++) {
14
+ const jPlatformFlavour = configuredFlavoursForPlatform[j];
15
+ if (!usedFlavours.includes(jPlatformFlavour)) {
16
+ usedFlavours.push(jPlatformFlavour);
17
+ }
18
+ }
19
+ }
20
+ }
21
+ return usedFlavours.sort();
22
+ };
23
+ exports.resolveUsedFlavours = resolveUsedFlavours;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatTableDataSpaces = void 0;
4
+ const getLengthOfLongestColumnCell = (tableData, tableColumnIndex) => {
5
+ const rowsAmount = tableData.length;
6
+ let maxColumnCellLength = 0;
7
+ for (let tableRowIndex = 0; tableRowIndex < rowsAmount; tableRowIndex++) {
8
+ const cellLength = tableData[tableRowIndex][tableColumnIndex].length;
9
+ if (cellLength > maxColumnCellLength) {
10
+ maxColumnCellLength = cellLength;
11
+ }
12
+ }
13
+ return maxColumnCellLength;
14
+ };
15
+ const formatTableColumnSpaces = (tableData, columnIndex) => {
16
+ const requestedColumnLength = getLengthOfLongestColumnCell(tableData, columnIndex);
17
+ const rowsAmount = tableData.length;
18
+ for (let tableRowIndex = 0; tableRowIndex < rowsAmount; tableRowIndex++) {
19
+ const rowData = tableData[tableRowIndex];
20
+ rowData[columnIndex] = rowData[columnIndex].padEnd(requestedColumnLength);
21
+ }
22
+ };
23
+ const formatTableDataSpaces = (tableData) => {
24
+ const columnsAmount = tableData[0].length;
25
+ for (let i = 0; i < columnsAmount; i++) {
26
+ formatTableColumnSpaces(tableData, i);
27
+ }
28
+ return tableData;
29
+ };
30
+ exports.formatTableDataSpaces = formatTableDataSpaces;
@@ -0,0 +1,88 @@
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
+ const fs = __importStar(require("fs"));
23
+ const path = __importStar(require("path"));
24
+ const resolvers_1 = require("../../resolvers");
25
+ const constants_1 = require("../../constants");
26
+ const fsUtils_1 = require("../utils/fsUtils");
27
+ const makeTableDataByScheme_1 = require("./makeTableDataByScheme");
28
+ const formatTableDataSpaces_1 = require("./formatTableDataSpaces");
29
+ const processOutput = (outputFilePath, fileContent) => {
30
+ if (!fsUtils_1.isDir(outputFilePath)) {
31
+ const dirname = path.dirname(outputFilePath);
32
+ fs.mkdirSync(dirname, { recursive: true });
33
+ }
34
+ fs.writeFileSync(outputFilePath, fileContent);
35
+ };
36
+ const tableDataToMarkdown = (tableData) => {
37
+ const tableRowDataToTableRowMarkdown = (tableRowData) => (`| ${tableRowData.join(' | ')} |`);
38
+ const tableRowsMarkdown = tableData.map(tableRowDataToTableRowMarkdown);
39
+ return tableRowsMarkdown.join('\n');
40
+ };
41
+ const makeTableMarkdownByScheme = (rnvC, scheme) => {
42
+ const tableData = makeTableDataByScheme_1.makeTableDataByScheme(rnvC, scheme);
43
+ const formattedTableData = formatTableDataSpaces_1.formatTableDataSpaces(tableData);
44
+ return tableDataToMarkdown(formattedTableData);
45
+ };
46
+ const makeMarkdownFileContentRows = (rnvC) => ([
47
+ `# ${rnvC.buildConfig.projectName}`,
48
+ '## Deploy URLs',
49
+ '',
50
+ '---',
51
+ '### Latest `development` builds',
52
+ '> Latest builds against the development git branch.',
53
+ '> Deployed each time into the same path.',
54
+ '',
55
+ makeTableMarkdownByScheme(rnvC, constants_1.BuildSchemes.DEV_LATEST),
56
+ '',
57
+ '---',
58
+ '### Latest `release candidate` builds',
59
+ '> Latest builds against the release candidate git branch.',
60
+ '> Deployed each time into the same path.',
61
+ '',
62
+ makeTableMarkdownByScheme(rnvC, constants_1.BuildSchemes.RC_LATEST),
63
+ '---',
64
+ '### Latest `release` builds',
65
+ '> Latest builds against the release git branch.',
66
+ '> Deployed each time into the same path.',
67
+ '',
68
+ makeTableMarkdownByScheme(rnvC, constants_1.BuildSchemes.RELEASE_LATEST),
69
+ '---',
70
+ '### Distribution `release` builds',
71
+ '> Builds against the release git branch.',
72
+ '> Each new release version is deployed into its own folder.',
73
+ '',
74
+ '*In opened URL, just replace `<VERSION>` placeholder with requested app version.*',
75
+ '',
76
+ makeTableMarkdownByScheme(rnvC, constants_1.BuildSchemes.RELEASE_DIST),
77
+ '---',
78
+ ]);
79
+ const main = () => {
80
+ const outputFilePath = process.argv[2];
81
+ if (!outputFilePath) {
82
+ throw new Error('You need to provide a path to output file as an argument!');
83
+ }
84
+ const rnvC = resolvers_1.getBaseConfig();
85
+ const markdownFileContentRows = makeMarkdownFileContentRows(rnvC);
86
+ processOutput(outputFilePath, markdownFileContentRows.join('\n'));
87
+ };
88
+ main();
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeTableDataByScheme = void 0;
4
+ const resolvers_1 = require("../../resolvers");
5
+ const constants_1 = require("../../constants");
6
+ const makePlatformRowData = (rnvC, deployLocations, tableFlavours, platform) => {
7
+ const data = [`**${platform}**`];
8
+ const flavourNotAvailableForPlatformText = '*N/A*';
9
+ const version = Object.keys(deployLocations.versions)[0];
10
+ const platformData = deployLocations.versions[version].platforms[platform];
11
+ for (let i = 0; i < tableFlavours.length; i++) {
12
+ const flavourUrls = platformData[tableFlavours[i]];
13
+ if (flavourUrls) {
14
+ let { packageUrl, indexUrl } = flavourUrls;
15
+ if (rnvC.runtime.scheme === constants_1.BuildSchemes.RELEASE_DIST) {
16
+ const versionRegex = /\d{1,4}\.\d{1,4}\.\d{1,4}/g;
17
+ const versionPlaceholder = '<VERSION>';
18
+ packageUrl = packageUrl.replace(versionRegex, versionPlaceholder);
19
+ indexUrl = packageUrl.replace(versionRegex, versionPlaceholder);
20
+ }
21
+ const tableCellContent = `[package](${packageUrl}) / [index.html](${indexUrl})`;
22
+ data.push(tableCellContent);
23
+ }
24
+ else {
25
+ data.push(flavourNotAvailableForPlatformText);
26
+ }
27
+ }
28
+ return data;
29
+ };
30
+ const makeTablePlatformsData = (rnvC, usedFlavours) => {
31
+ const supportedPlatforms = resolvers_1.resolveSupportedPlatforms(rnvC);
32
+ const deployLocations = resolvers_1.resolveDeployLocations(rnvC);
33
+ const data = [];
34
+ for (let i = 0; i < supportedPlatforms.length; i++) {
35
+ const platform = supportedPlatforms[i];
36
+ const rowData = makePlatformRowData(rnvC, deployLocations, usedFlavours, platform);
37
+ if (rowData) {
38
+ data.push(rowData);
39
+ }
40
+ }
41
+ return data;
42
+ };
43
+ const makeHeaderData = (tableFlavours) => {
44
+ const header = [''].concat(tableFlavours.map((flavour) => `*${flavour}*`));
45
+ const headerSeparator = header.map(() => ':---:');
46
+ return [
47
+ header,
48
+ headerSeparator,
49
+ ];
50
+ };
51
+ const makeTableDataByScheme = (rnvC, scheme) => {
52
+ const originalScheme = rnvC.runtime.scheme;
53
+ const tableData = [];
54
+ rnvC.runtime.scheme = scheme;
55
+ const usedFlavours = resolvers_1.resolveUsedFlavours(rnvC);
56
+ const headerData = makeHeaderData(usedFlavours);
57
+ tableData.push(...headerData);
58
+ const tablePlatformsData = makeTablePlatformsData(rnvC, usedFlavours);
59
+ tableData.push(...tablePlatformsData);
60
+ rnvC.runtime.scheme = originalScheme;
61
+ return tableData;
62
+ };
63
+ exports.makeTableDataByScheme = makeTableDataByScheme;
@@ -78,7 +78,6 @@ const processPlatform = (c, platformName) => {
78
78
  });
79
79
  };
80
80
  const deployToAppCenter = (c) => {
81
- const { supportedPlatforms = [] } = c.buildConfig.defaults || {};
82
- supportedPlatforms.forEach((platformName) => processPlatform(c, platformName));
81
+ resolvers_1.resolveSupportedPlatforms(c).forEach((platformName) => processPlatform(c, platformName));
83
82
  };
84
83
  exports.deployToAppCenter = deployToAppCenter;
@@ -120,7 +120,7 @@ const githubRelease = (c) => {
120
120
  const releaseResponse = createRelease(c) || {};
121
121
  const uploadUrl = releaseResponse.upload_url;
122
122
  assert_1.ok(uploadUrl, 'Missing "upload_url" in release response!');
123
- c.buildConfig.defaults.supportedPlatforms.forEach((platformName) => {
123
+ resolvers_1.resolveSupportedPlatforms(c).forEach((platformName) => {
124
124
  uploadZipWithPlatformBuilds(c, platformName, uploadUrl);
125
125
  });
126
126
  deleteFileIfExists(githubReleaseNotesPath);
@@ -26,12 +26,15 @@ const makeFlavoursMarkdown = (platformName, entries) => entries
26
26
  .join('\n');
27
27
  const makePackagePayload = (c, platformName) => {
28
28
  const platformData = getPlatformsObject(c)[platformName];
29
- const flavoursEntries = Object.entries(platformData);
30
- return [
31
- slackBlockKitBuilder_1.Divider.plain(),
32
- slackBlockKitBuilder_1.Context.mrkdwns([`Platform: *${platformName}*`]),
33
- slackBlockKitBuilder_1.Context.mrkdwns([makeFlavoursMarkdown(platformName, flavoursEntries)]),
34
- ];
29
+ if (platformData) {
30
+ const flavoursEntries = Object.entries(platformData);
31
+ return [
32
+ slackBlockKitBuilder_1.Divider.plain(),
33
+ slackBlockKitBuilder_1.Context.mrkdwns([`Platform: *${platformName}*`]),
34
+ slackBlockKitBuilder_1.Context.mrkdwns([makeFlavoursMarkdown(platformName, flavoursEntries)]),
35
+ ];
36
+ }
37
+ return [];
35
38
  };
36
39
  const makePackagesPayload = (c) => {
37
40
  const platformList = Object.keys(getPlatformsObject(c));
@@ -22,12 +22,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.notifySlack = void 0;
23
23
  const child_process_1 = require("child_process");
24
24
  const payload = __importStar(require("./makePayload"));
25
+ const constants_1 = require("../../../constants");
25
26
  const getPayload = (c) => {
26
27
  const releaseType = c.runtime.scheme;
27
28
  switch (releaseType) {
28
- case 'dev:latest': return payload.makeDevelopmentPayload(c);
29
- case 'rc:latest': return payload.makeReleaseCandidatePayload(c);
30
- case 'release:dist': return payload.makeDistributionPayload(c);
29
+ case constants_1.BuildSchemes.DEV_LATEST: return payload.makeDevelopmentPayload(c);
30
+ case constants_1.BuildSchemes.RC_LATEST: return payload.makeReleaseCandidatePayload(c);
31
+ case constants_1.BuildSchemes.RELEASE_DIST: return payload.makeDistributionPayload(c);
31
32
  default: throw new Error('Notify Slack: unsupported or undefined release type! Did you pass it as an argument?');
32
33
  }
33
34
  };
@@ -23,6 +23,7 @@ exports.sentryRelease = void 0;
23
23
  const child_process_1 = require("child_process");
24
24
  const fs = __importStar(require("fs"));
25
25
  const constants_1 = require("../../constants");
26
+ const resolvers_1 = require("../../resolvers");
26
27
  const UNSUPPORTED_PLATFORMS = [constants_1.Platforms.WEBTV];
27
28
  const executeSync = (cmd) => child_process_1.execSync(cmd, { stdio: 'inherit' });
28
29
  const createNewRelease = (version) => {
@@ -73,7 +74,7 @@ const sentryRelease = (c) => {
73
74
  const version = `v${c.buildConfig.common?.packageVersion}`;
74
75
  if (!version)
75
76
  return;
76
- const { supportedPlatforms = [] } = c.buildConfig.defaults || {};
77
+ const supportedPlatforms = resolvers_1.resolveSupportedPlatforms(c);
77
78
  const supportedPlatformsBySentry = supportedPlatforms.filter((platform) => !UNSUPPORTED_PLATFORMS.includes(platform));
78
79
  createNewRelease(version);
79
80
  supportedPlatformsBySentry.forEach((platform) => processPlatform(c, platform, version));
@@ -9,6 +9,7 @@ const deployToAppCenter_1 = require("./release/deployToAppCenter");
9
9
  const githubRelease_1 = require("./release/githubRelease");
10
10
  const notifySlack_1 = require("./release/notifySlack/notifySlack");
11
11
  const sentryRelease_1 = require("./release/sentryRelease");
12
+ const constants_1 = require("../constants");
12
13
  const deployTask = (options) => {
13
14
  const { scheme, platform, flavour } = options;
14
15
  const cmd = `npx rnv deploy -s ${scheme} -p ${platform} -c ${flavour} --ci --only`;
@@ -52,16 +53,16 @@ const releaseAllWithScheme = () => {
52
53
  const c = resolvers_1.getBaseConfig();
53
54
  c.runtime.scheme = scheme;
54
55
  switch (scheme) {
55
- case 'dev:latest':
56
+ case constants_1.BuildSchemes.DEV_LATEST:
56
57
  doLatestDevelopmentRelease(c);
57
58
  break;
58
- case 'rc:latest':
59
+ case constants_1.BuildSchemes.RC_LATEST:
59
60
  doLatestReleaseCandidateRelease(c);
60
61
  break;
61
- case 'release:latest':
62
+ case constants_1.BuildSchemes.RELEASE_LATEST:
62
63
  doLatestRelease(c);
63
64
  break;
64
- case 'release:dist':
65
+ case constants_1.BuildSchemes.RELEASE_DIST:
65
66
  doDistributionRelease(c);
66
67
  break;
67
68
  default:
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.assertPath = exports.getFileContentAsString = void 0;
22
+ exports.isDir = exports.assertPath = exports.getFileContentAsString = void 0;
23
23
  const fs = __importStar(require("fs"));
24
24
  const assert_1 = require("assert");
25
25
  const getFileContentAsString = (filePath) => fs.readFileSync(filePath).toString();
@@ -29,3 +29,5 @@ const assertPath = (path) => {
29
29
  assert_1.ok(fs.existsSync(path), errorMsg);
30
30
  };
31
31
  exports.assertPath = assertPath;
32
+ const isDir = (verifiedPath) => (fs.existsSync(verifiedPath) && fs.lstatSync(verifiedPath).isDirectory());
33
+ exports.isDir = isDir;
@@ -27,6 +27,7 @@ const semver = __importStar(require("semver"));
27
27
  const child_process_1 = require("child_process");
28
28
  const rnv_1 = require("rnv");
29
29
  const sdkUtils_1 = require("../sdkUtils");
30
+ const constants_1 = require("../../constants");
30
31
  const { execCLI } = rnv_1.Exec;
31
32
  const { CLI_TIZEN, REMOTE_DEBUGGER_ENABLED_PLATFORMS } = rnv_1.Constants;
32
33
  const { getPlatformProjectDir, getAppVersion, getConfigProp, checkPortInUse, confirmActiveBundler, addSystemInjects, } = rnv_1.Common;
@@ -111,8 +112,8 @@ const buildTizenProject = async (c) => {
111
112
  logTask('buildTizenProject');
112
113
  await buildCoreWebpackProject(c);
113
114
  if (!c.program.hosted) {
114
- const { buildConfig, platform } = c;
115
- const platformConfig = buildConfig.platforms[platform];
115
+ const { buildConfig } = c;
116
+ const platformConfig = buildConfig.platforms[constants_1.Platforms.TIZEN];
116
117
  const projectDir = getPlatformProjectDir(c);
117
118
  const projectParentDir = path.join(projectDir, '..');
118
119
  const tBuild = path.join(projectParentDir, 'build');
@@ -128,7 +129,7 @@ exports.buildTizenProject = buildTizenProject;
128
129
  let isGlobalConfigured = false;
129
130
  const configureProject = (c) => new Promise((resolve) => {
130
131
  logTask('configureProject');
131
- const { platform } = c;
132
+ const platform = constants_1.Platforms.TIZEN;
132
133
  const configFile = 'config.xml';
133
134
  const p = c.buildConfig.platforms[platform];
134
135
  const injects = [
@@ -1,32 +1,12 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
22
3
  exports.rm = exports.cp = void 0;
23
4
  const child_process_1 = require("child_process");
24
- const fs = __importStar(require("fs"));
5
+ const fsUtils_1 = require("../../../scripts/utils/fsUtils");
25
6
  const runCmdSync = (cmd) => child_process_1.execSync(cmd, { stdio: 'inherit' });
26
- const isDir = (path) => fs.existsSync(path) && fs.lstatSync(path).isDirectory();
27
7
  const cp = (source, destination) => {
28
8
  let cmd = `aws s3 cp ${source} s3://${destination} --acl public-read`;
29
- if (isDir(source)) {
9
+ if (fsUtils_1.isDir(source)) {
30
10
  cmd += ' --recursive';
31
11
  }
32
12
  runCmdSync(cmd);
@@ -21,7 +21,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.deployToS3 = void 0;
23
23
  const path = __importStar(require("path"));
24
- const fs = __importStar(require("fs"));
25
24
  const rnv_1 = require("rnv");
26
25
  const aws = __importStar(require("./aws"));
27
26
  const constants_1 = require("../../../constants");
@@ -29,8 +28,7 @@ const resolvers_1 = require("../../../resolvers");
29
28
  const { getConfigProp } = rnv_1.Common;
30
29
  const uploadPackage = (c, sourcePath, uploadPath) => {
31
30
  const packageOutputDirPath = `${sourcePath}/output`;
32
- const outputFilenameList = fs.readdirSync(packageOutputDirPath);
33
- const packageFileName = outputFilenameList[0];
31
+ const packageFileName = resolvers_1.resolveBuildFileName(c);
34
32
  const packageLocalPath = `"${packageOutputDirPath}/${packageFileName}"`;
35
33
  const packageRemotePath = `"${uploadPath}/build/${packageFileName}"`;
36
34
  aws.cp(packageLocalPath, packageRemotePath);
@@ -52,7 +50,7 @@ const deployToS3 = async (c) => {
52
50
  const baseUrl = resolvers_1.resolveBaseUrl({
53
51
  platform,
54
52
  scheme: runtime.scheme || '',
55
- appConfigId: runtime.appId,
53
+ flavour: runtime.appId,
56
54
  });
57
55
  if (!baseUrl) {
58
56
  return false;
@@ -21,7 +21,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.deployHbbTV = void 0;
23
23
  const path = __importStar(require("path"));
24
- const fs = __importStar(require("fs"));
25
24
  const nodessh = __importStar(require("node-ssh"));
26
25
  const constants_1 = require("../../../constants");
27
26
  const resolvers_1 = require("../../../resolvers");
@@ -41,15 +40,7 @@ const makeSshConnection = async (c) => {
41
40
  await ssh.connect({ host, username, privateKey, passphrase });
42
41
  return ssh;
43
42
  };
44
- const getBuildPackageFileName = (c) => {
45
- const packageOutputDirPath = `${c.runtime.appDir}/output`;
46
- const outputFilenameList = fs.readdirSync(packageOutputDirPath);
47
- return outputFilenameList[0];
48
- };
49
- const getLocalBuildPackagePath = (c) => {
50
- const fileName = getBuildPackageFileName(c);
51
- return path.join(c.runtime.appDir, 'output', fileName);
52
- };
43
+ const getLocalBuildPackagePath = (c) => (path.join(c.runtime.appDir, 'output', resolvers_1.resolveBuildFileName(c)));
53
44
  const resolveRemotePaths = (c) => {
54
45
  const remoteBuildDirRelativePath = resolvers_1.resolveHbbtvRemoteBuildDirRelativePath(c);
55
46
  const { hostHomeDir, dockerHtmlRootDir } = resolvers_1.resolveHbbtvDeployConfig();
@@ -67,7 +58,7 @@ const deployHbbTV = async (c) => {
67
58
  log('HbbTV deploy via SSH.\n\n');
68
59
  const remotePaths = resolveRemotePaths(c);
69
60
  const { dockerContainerName } = resolvers_1.resolveHbbtvDeployConfig();
70
- const remotePackagePath = `${remotePaths.serverTempDirPath}/${getBuildPackageFileName(c)}`;
61
+ const remotePackagePath = `${remotePaths.serverTempDirPath}/${resolvers_1.resolveBuildFileName(c)}`;
71
62
  const dockerExecPrefix = `docker exec -t ${dockerContainerName}`;
72
63
  const dockerAppDirPath = remotePaths.dockerProjectDirPath;
73
64
  log('Creating connection...\n');
@@ -95,7 +86,8 @@ const deployHbbTV = async (c) => {
95
86
  await ssh.execCommand(cmd);
96
87
  log('Clearing temporary dir on host side...\n');
97
88
  await ssh.execCommand(`rm -Rf ${remotePaths.serverTempDirPath}`);
98
- log(`\nThe build is deployed at ${resolvers_1.resolveHbbtvDeployUrl(c, scheme, appId)}\n`);
89
+ const deployedUrl = resolvers_1.resolveHbbtvDeployUrl(c, scheme, appId);
90
+ log(`\nThe build is deployed at ${deployedUrl}\n`);
99
91
  log('Deploy done.\n');
100
92
  };
101
93
  exports.deployHbbTV = deployHbbTV;
@@ -26,7 +26,7 @@ const rnv_1 = require("rnv");
26
26
  const constants_1 = require("../constants");
27
27
  const sdks_1 = require("../sdks");
28
28
  const resolvers_1 = require("../resolvers");
29
- const { getConfigProp, getPlatformBuildDir, getPlatformProjectDir } = rnv_1.Common;
29
+ const { getPlatformBuildDir, getPlatformProjectDir } = rnv_1.Common;
30
30
  const { logErrorPlatform } = rnv_1.PlatformManager;
31
31
  const { logTask } = rnv_1.Logger;
32
32
  const { buildWeb } = sdks_1.SDKWebpack;
@@ -34,47 +34,11 @@ const { buildTizenProject } = sdks_1.SDKTizen;
34
34
  const { buildWebOSProject } = sdks_1.SDKWebos;
35
35
  const { executeOrSkipTask } = rnv_1.TaskManager;
36
36
  const { TASK_BUILD, TASK_PACKAGE, PARAMS } = rnv_1.Constants;
37
- const getPackageExtensionByPlatform = (platform) => {
38
- switch (platform) {
39
- case constants_1.Platforms.TIZEN:
40
- return 'wgt';
41
- case constants_1.Platforms.WEBOS:
42
- return 'ipk';
43
- default:
44
- return 'zip';
45
- }
46
- };
47
- const getBuildVersionForFileName = (c) => {
48
- const { platform, runtime } = c;
49
- const { scheme, appId } = runtime;
50
- switch (c.runtime.scheme) {
51
- case 'dev:latest':
52
- return 'latest.dev';
53
- case 'rc:latest':
54
- return 'latest.rc';
55
- case 'release:latest':
56
- return 'latest.release';
57
- default:
58
- return resolvers_1.resolveBuildVersion({
59
- platform,
60
- scheme,
61
- appConfigId: appId,
62
- });
63
- }
64
- };
65
- const makeBuildName = (c) => {
66
- const platformName = c.platform;
67
- const appNameInFileName = getConfigProp(c, platformName, 'appNameInFileName', '');
68
- const buildVersion = getBuildVersionForFileName(c);
69
- const appConfigId = c.runtime.appId || '';
70
- const extension = getPackageExtensionByPlatform(platformName);
71
- return `${appNameInFileName}_${platformName}_${buildVersion}_${appConfigId}.${extension}`;
72
- };
73
37
  const makeZipOutput = (c) => {
74
38
  const platformBuildDir = getPlatformBuildDir(c);
75
39
  const copiedProjectBuildDir = `${platformBuildDir}/build`;
76
40
  const defaultZipFileName = `${c.platform}_${c.runtime.appId}.zip`;
77
- const fileName = makeBuildName(c) || defaultZipFileName;
41
+ const fileName = resolvers_1.resolveBuildFileName(c) || defaultZipFileName;
78
42
  child_process_1.execSync(`cp -r ${getPlatformProjectDir(c)}/public ${copiedProjectBuildDir}`);
79
43
  child_process_1.execSync(`rm -rf ${platformBuildDir}/output`);
80
44
  child_process_1.execSync(`mkdir ${platformBuildDir}/output`);
@@ -87,7 +51,7 @@ const renameOutput = (c) => {
87
51
  return;
88
52
  const outputFilenameList = fs.readdirSync(packageOutputDirPath);
89
53
  const packageFileName = outputFilenameList[0];
90
- const newFilename = makeBuildName(c);
54
+ const newFilename = resolvers_1.resolveBuildFileName(c);
91
55
  if (newFilename) {
92
56
  const oldPath = `${packageOutputDirPath}/${packageFileName}`;
93
57
  const newPath = `${packageOutputDirPath}/${newFilename}`;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.forEachSupportedPlatformFlavour = void 0;
4
+ const resolvers_1 = require("../resolvers");
4
5
  const getProgressMessage = (platforms, platformIndex, flavours, flavourIndex) => {
5
6
  let string = `\nProcessing "${platforms[platformIndex]}" platform`;
6
7
  string += ` (${platformIndex + 1}/${platforms.length})`;
@@ -12,12 +13,12 @@ const forEachSupportedPlatformFlavour = (c, cb) => {
12
13
  const processPlatformFlavours = (platform, platformIndex, platforms) => {
13
14
  const processFlavour = (flavour, flavourIndex, flavours) => {
14
15
  console.log(getProgressMessage(platforms, platformIndex, flavours, flavourIndex));
15
- return cb({ platform, flavour, scheme: c.runtime.scheme });
16
+ const scheme = c.runtime.scheme;
17
+ return cb({ platform, flavour, scheme });
16
18
  };
17
19
  const { supportedFlavours = [] } = c.buildConfig.platforms[platform]?.deploy || {};
18
20
  supportedFlavours.forEach(processFlavour);
19
21
  };
20
- const { supportedPlatforms = [] } = c.buildConfig.defaults || {};
21
- supportedPlatforms.forEach(processPlatformFlavours);
22
+ resolvers_1.resolveSupportedPlatforms(c).forEach(processPlatformFlavours);
22
23
  };
23
24
  exports.forEachSupportedPlatformFlavour = forEachSupportedPlatformFlavour;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mergeDeep = void 0;
4
+ const isObject = (item) => (item && typeof item === 'object' && !Array.isArray(item));
5
+ const mergeDeep = (target, ...sources) => {
6
+ if (!sources.length)
7
+ return target;
8
+ const source = sources.shift();
9
+ if (isObject(target) && isObject(source)) {
10
+ Object.keys(source).forEach((key) => {
11
+ if (isObject(source[key])) {
12
+ if (!target[key])
13
+ Object.assign(target, { [key]: {} });
14
+ mergeDeep(target[key], source[key]);
15
+ }
16
+ else {
17
+ Object.assign(target, { [key]: source[key] });
18
+ }
19
+ });
20
+ }
21
+ return mergeDeep(target, ...sources);
22
+ };
23
+ exports.mergeDeep = mergeDeep;
@@ -24,20 +24,12 @@ const fs_1 = require("fs");
24
24
  const path_1 = require("path");
25
25
  const child_process_1 = require("child_process");
26
26
  const glob = __importStar(require("glob"));
27
- const constants_1 = require("../constants");
28
27
  const resolvers_1 = require("../resolvers");
29
28
  const zipDir = (dir, outputFile) => child_process_1.execSync(`zip ${outputFile} -0 -j ${dir}/*`);
30
- const getPlatformBuildFileExtension = (platformName) => {
31
- switch (platformName) {
32
- case constants_1.Platforms.TIZEN: return 'wgt';
33
- case constants_1.Platforms.WEBOS: return 'ipk';
34
- default: return 'zip';
35
- }
36
- };
37
29
  const getPlatformBuildsPaths = (c, platformName) => {
38
30
  const { platformBuildsDir } = c.buildConfig.paths;
39
31
  const outputGlob = `${platformBuildsDir}/**/output`;
40
- const platformBuildsGlob = `${outputGlob}/*.${getPlatformBuildFileExtension(platformName)}`;
32
+ const platformBuildsGlob = `${outputGlob}/*.${resolvers_1.resolveBuildFileExtension(platformName)}`;
41
33
  const buildsPathsCandidates = glob.sync(platformBuildsGlob);
42
34
  return buildsPathsCandidates.filter((path) => path.includes(platformName));
43
35
  };
@@ -58,7 +50,7 @@ const processPlatform = (c, platformName) => {
58
50
  fs_1.rmdirSync(tempPlatformDir, { recursive: true });
59
51
  };
60
52
  const zipBuildsByPlatforms = (c) => {
61
- const { supportedPlatforms = [] } = c.buildConfig.defaults || {};
62
- supportedPlatforms.forEach((platformName) => processPlatform(c, platformName));
53
+ resolvers_1.resolveSupportedPlatforms(c)
54
+ .forEach((platformName) => processPlatform(c, platformName));
63
55
  };
64
56
  exports.zipBuildsByPlatforms = zipBuildsByPlatforms;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@24i/smartapps-bigscreen-rnv-build-engine",
3
- "version": "0.8.6",
3
+ "version": "0.8.7-alpha.1415+70a1137b",
4
4
  "description": "Package with build engine for SmartApps BIGscreen projects...",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {
@@ -34,7 +34,6 @@
34
34
  "node-ssh": "11.1.1",
35
35
  "raf": "3.4.1",
36
36
  "regenerator-runtime": "0.13.7",
37
- "renative": "0.32.0-alpha.43",
38
37
  "renative-template-blank": "0.32.0-alpha.43",
39
38
  "rnv": "0.32.0-alpha.43",
40
39
  "sass": "1.37.0",
@@ -61,5 +60,5 @@
61
60
  "keywords": [],
62
61
  "author": "24i",
63
62
  "license": "ISC",
64
- "gitHead": "4f5f9dd9c67fdb6c5be89b039b9de9d2595c588a"
63
+ "gitHead": "70a1137bcbfb944dc9ab4053d00c3f47ba061b6e"
65
64
  }