@24i/smartapps-bigscreen-rnv-build-engine 0.0.2-alpha.1355 → 0.0.2-alpha.1357
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.
- package/dist/src/constants/buildSchemes.js +1 -1
- package/dist/src/constants/platforms.js +1 -1
- package/dist/src/index.js +21 -23
- package/dist/src/resolvers/resolveBaseUrl.js +12 -14
- package/dist/src/resolvers/resolveBuildVersion.js +15 -16
- package/dist/src/resolvers/resolveBuildVersionOffset.js +11 -12
- package/dist/src/resolvers/resolveDeployLocations.js +41 -54
- package/dist/src/resolvers/resolveGenericRnvConfig.js +17 -29
- package/dist/src/resolvers/resolveHbbtvDeployConfig.js +2 -2
- package/dist/src/resolvers/resolveHbbtvDeployUrl.js +6 -6
- package/dist/src/resolvers/resolveHbbtvRemoteBuildDirRelativePath.js +11 -11
- package/dist/src/resolvers/resolveZippedPlatformBuildsRelativeFilePath.js +10 -10
- package/dist/src/scripts/buildAllWithScheme.js +13 -13
- package/dist/src/scripts/gitReleaser/afterVersionBump.js +9 -10
- package/dist/src/scripts/gitReleaser/beforeVersionBump.js +6 -7
- package/dist/src/scripts/gitReleaser/checkReleaseNotes.js +8 -9
- package/dist/src/scripts/gitReleaser/pushRelease.js +16 -17
- package/dist/src/scripts/gitReleaser/pushReleaseCandidate.js +3 -3
- package/dist/src/scripts/gitReleaser/pushReleaseNotes.js +15 -16
- package/dist/src/scripts/release/deleteSourceMaps.js +5 -5
- package/dist/src/scripts/release/deployToAppCenter.js +34 -35
- package/dist/src/scripts/release/githubRelease.js +56 -60
- package/dist/src/scripts/release/notifySlack/makePayload.js +43 -47
- package/dist/src/scripts/release/notifySlack/notifySlack.js +9 -10
- package/dist/src/scripts/release/notifySlack/slackBlockKitBuilder.js +20 -23
- package/dist/src/scripts/release/sentryRelease.js +33 -36
- package/dist/src/scripts/release/urlsMarkdown.js +22 -24
- package/dist/src/scripts/releaseAllWithScheme.js +25 -25
- package/dist/src/scripts/utils/cmdUtils.js +5 -5
- package/dist/src/scripts/utils/fsUtils.js +5 -5
- package/dist/src/scripts/utils/gitUtils.js +37 -37
- package/dist/src/scripts/utils/stringUtils.js +1 -4
- package/dist/src/sdks/index.js +14 -53
- package/dist/src/sdks/sdk-tizen/index.js +145 -250
- package/dist/src/sdks/sdk-webos/index.js +133 -231
- package/dist/src/sdks/sdk-webpack/index.js +19 -68
- package/dist/src/sdks/sdkUtils.js +13 -58
- package/dist/src/tasks/deploy/aswS3/aws.js +8 -8
- package/dist/src/tasks/deploy/aswS3/deployS3.js +43 -82
- package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +67 -136
- package/dist/src/tasks/engineTasks.js +9 -9
- package/dist/src/tasks/task.rnv.build.js +70 -127
- package/dist/src/tasks/task.rnv.configure.js +37 -87
- package/dist/src/tasks/task.rnv.configureSoft.js +20 -73
- package/dist/src/tasks/task.rnv.deploy.js +27 -77
- package/dist/src/tasks/task.rnv.hooks.run.js +40 -91
- package/dist/src/tasks/task.rnv.package.js +16 -59
- package/dist/src/tasks/task.rnv.project.configure.js +78 -181
- package/dist/src/tasks/task.rnv.start.js +39 -85
- package/dist/src/utils/forEachSupportedPlatformFlavour.js +11 -12
- package/dist/src/utils/replaceRelevantStringsInConfig/replaceRelevantStringsInConfig.js +9 -10
- package/dist/src/utils/replaceRelevantStringsInConfig/replaceTemplateString.js +22 -28
- package/dist/src/utils/zipBuildsByPlatforms.js +24 -24
- package/dist/templates/platforms/_shared/template.js +53 -38
- package/dist/templates/platforms/_shared/webpack.base.js +86 -106
- package/dist/templates/platforms/entone/webpack.config.dev.js +43 -22
- package/dist/templates/platforms/entone/webpack.config.prod.js +38 -21
- package/dist/templates/platforms/hbbtv/webpack.config.dev.js +57 -23
- package/dist/templates/platforms/hbbtv/webpack.config.prod.js +52 -22
- package/dist/templates/platforms/tizen/webpack.config.dev.js +44 -22
- package/dist/templates/platforms/tizen/webpack.config.prod.js +38 -21
- package/dist/templates/platforms/webos/webpack.config.dev.js +47 -24
- package/dist/templates/platforms/webos/webpack.config.prod.js +40 -23
- package/dist/templates/platforms/webtv/webpack.config.dev.js +43 -22
- package/dist/templates/platforms/webtv/webpack.config.prod.js +38 -21
- package/package.json +2 -2
package/dist/src/index.js
CHANGED
|
@@ -18,57 +18,55 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
-
var _a;
|
|
22
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
22
|
exports.Resolvers = exports.Constants = void 0;
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const rnv_1 = require("rnv");
|
|
24
|
+
const Constants = __importStar(require("./constants"));
|
|
26
25
|
exports.Constants = Constants;
|
|
27
|
-
|
|
26
|
+
const Resolvers = __importStar(require("./resolvers"));
|
|
28
27
|
exports.Resolvers = Resolvers;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
fileExtensions.forEach(function (fileExtension) {
|
|
28
|
+
const CNF = __importStar(require("../../renative.engine.json"));
|
|
29
|
+
const constants_1 = require("./constants");
|
|
30
|
+
const engineTasks_1 = require("./tasks/engineTasks");
|
|
31
|
+
const { generateEngineTasks } = rnv_1.EngineManager;
|
|
32
|
+
const generateEngineExtensions = (platformExtensions = []) => {
|
|
33
|
+
const fileExtensions = ['js', 'jsx', 'ts', 'tsx', 'json'];
|
|
34
|
+
const output = [];
|
|
35
|
+
fileExtensions.forEach((fileExtension) => {
|
|
38
36
|
output.push(fileExtension);
|
|
39
|
-
platformExtensions.forEach(
|
|
40
|
-
output.push(platformExtension
|
|
37
|
+
platformExtensions.forEach((platformExtension) => {
|
|
38
|
+
output.push(`${platformExtension}.${fileExtension}`);
|
|
41
39
|
});
|
|
42
40
|
});
|
|
43
41
|
return output;
|
|
44
42
|
};
|
|
45
43
|
exports.default = {
|
|
46
|
-
initializeRuntimeConfig:
|
|
44
|
+
initializeRuntimeConfig: (c) => rnv_1.Config.initializeConfig(c),
|
|
47
45
|
tasks: generateEngineTasks(engineTasks_1.engineTaskList),
|
|
48
46
|
config: CNF,
|
|
49
47
|
projectDirName: 'project',
|
|
50
48
|
serverDirName: 'server',
|
|
51
49
|
ejectPlatform: null,
|
|
52
|
-
platforms:
|
|
53
|
-
|
|
50
|
+
platforms: {
|
|
51
|
+
[constants_1.Platforms.ENTONE]: {
|
|
54
52
|
extenstions: generateEngineExtensions(['entone']),
|
|
55
53
|
defaultPort: 8095,
|
|
56
54
|
},
|
|
57
|
-
|
|
55
|
+
[constants_1.Platforms.HBBTV]: {
|
|
58
56
|
extenstions: generateEngineExtensions(['hbbtv.tv']),
|
|
59
57
|
defaultPort: 8096,
|
|
60
58
|
},
|
|
61
|
-
|
|
59
|
+
[constants_1.Platforms.TIZEN]: {
|
|
62
60
|
extenstions: generateEngineExtensions(['tizen.tv']),
|
|
63
61
|
defaultPort: 8087,
|
|
64
62
|
},
|
|
65
|
-
|
|
63
|
+
[constants_1.Platforms.WEBOS]: {
|
|
66
64
|
extenstions: generateEngineExtensions(['webos.tv']),
|
|
67
65
|
defaultPort: 8088,
|
|
68
66
|
},
|
|
69
|
-
|
|
67
|
+
[constants_1.Platforms.WEBTV]: {
|
|
70
68
|
extenstions: generateEngineExtensions(['webtv']),
|
|
71
69
|
defaultPort: 8080,
|
|
72
70
|
},
|
|
73
|
-
|
|
71
|
+
},
|
|
74
72
|
};
|
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveBaseUrl = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _d = _a.platform, platform = _d === void 0 ? '' : _d, _e = _a.scheme, scheme = _e === void 0 ? '' : _e, _f = _a.appConfigId, appConfigId = _f === void 0 ? '' : _f;
|
|
9
|
-
var c = resolveGenericRnvConfig_1.getBaseConfig();
|
|
4
|
+
const resolveGenericRnvConfig_1 = require("./resolveGenericRnvConfig");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const resolveBaseUrl = ({ platform = '', scheme = '', appConfigId = '' }) => {
|
|
7
|
+
const c = resolveGenericRnvConfig_1.getBaseConfig();
|
|
10
8
|
c.platform = platform;
|
|
11
9
|
c.runtime.scheme = scheme;
|
|
12
10
|
c.runtime.appId = appConfigId;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const { packageVersion = '', deploy = {} } = c.buildConfig?.common || {};
|
|
12
|
+
const bucketName = deploy.aws3?.bucketName || '';
|
|
13
|
+
const bucketUrl = `http://${bucketName}.s3.amazonaws.com`;
|
|
14
|
+
const appFolderUrl = `${bucketUrl}/builds/${platform}/${appConfigId}`;
|
|
17
15
|
if (!packageVersion) {
|
|
18
16
|
return '';
|
|
19
17
|
}
|
|
20
18
|
switch (scheme) {
|
|
21
19
|
case constants_1.BuildSchemes.DEV_LATEST:
|
|
22
|
-
return appFolderUrl
|
|
20
|
+
return `${appFolderUrl}/latest/dev`;
|
|
23
21
|
case constants_1.BuildSchemes.RC_LATEST:
|
|
24
|
-
return appFolderUrl
|
|
22
|
+
return `${appFolderUrl}/latest/rc`;
|
|
25
23
|
case constants_1.BuildSchemes.RELEASE_LATEST:
|
|
26
|
-
return appFolderUrl
|
|
24
|
+
return `${appFolderUrl}/latest/release`;
|
|
27
25
|
case constants_1.BuildSchemes.RELEASE_DIST:
|
|
28
|
-
return appFolderUrl
|
|
26
|
+
return `${appFolderUrl}/dist/v${packageVersion}`;
|
|
29
27
|
default:
|
|
30
28
|
return '';
|
|
31
29
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveBuildVersion = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const resolveGenericRnvConfig_1 = require("./resolveGenericRnvConfig");
|
|
5
|
+
const resolveBuildVersionOffset_1 = require("./resolveBuildVersionOffset");
|
|
6
|
+
const constants_1 = require("../constants");
|
|
7
|
+
const resolvePackageVersion = (c) => c.buildConfig.common.packageVersion || '';
|
|
8
|
+
const resolveBuildType = (c) => {
|
|
9
9
|
switch (c.runtime.scheme) {
|
|
10
10
|
case constants_1.BuildSchemes.DEBUG:
|
|
11
11
|
return '.debug';
|
|
@@ -20,24 +20,23 @@ var resolveBuildType = function (c) {
|
|
|
20
20
|
case constants_1.BuildSchemes.RELEASE_DIST:
|
|
21
21
|
return '';
|
|
22
22
|
default:
|
|
23
|
-
throw new Error(
|
|
23
|
+
throw new Error(`resolveBuildType: scheme "${c.runtime.scheme}" is not defined!`);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
const resolveVersionOffset = (c) => {
|
|
27
|
+
const versionOffsetString = resolveBuildVersionOffset_1.resolveBuildVersionOffset(c);
|
|
28
28
|
return versionOffsetString
|
|
29
|
-
?
|
|
29
|
+
? `-${versionOffsetString}`
|
|
30
30
|
: '';
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var c = resolveGenericRnvConfig_1.getBaseConfig();
|
|
32
|
+
const resolveBuildVersion = ({ platform = '', scheme = '', appConfigId = '' }) => {
|
|
33
|
+
const c = resolveGenericRnvConfig_1.getBaseConfig();
|
|
35
34
|
c.platform = platform;
|
|
36
35
|
c.runtime.scheme = scheme;
|
|
37
36
|
c.runtime.appId = appConfigId;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return
|
|
37
|
+
const packageVersion = resolvePackageVersion(c);
|
|
38
|
+
const buildType = resolveBuildType(c);
|
|
39
|
+
const maybeGitCommitsOffset = resolveVersionOffset(c);
|
|
40
|
+
return `v${packageVersion}${buildType}${maybeGitCommitsOffset}`;
|
|
42
41
|
};
|
|
43
42
|
exports.resolveBuildVersion = resolveBuildVersion;
|
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveBuildVersionOffset = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const getCurrentGitBranchName = () => {
|
|
6
6
|
if (process.env.BRANCH)
|
|
7
7
|
return process.env.BRANCH;
|
|
8
|
-
|
|
8
|
+
const gitCommand = 'git branch --show-current';
|
|
9
9
|
return child_process_1.execSync(gitCommand, { stdio: 'pipe' }).toString().trim();
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const getMergedPullRequestsOffsetFromBranch = (branch) => {
|
|
12
|
+
const defaultValue = '';
|
|
13
|
+
const mergeTitleRegex = '^Merge pull request #';
|
|
14
|
+
const cmd = `git rev-list --count --merges --grep="${mergeTitleRegex}" HEAD ^origin/${branch}`;
|
|
15
15
|
try {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const diffCount = child_process_1.execSync(cmd, { stdio: 'pipe' }).toString().trim();
|
|
17
|
+
const diffCountNumeric = parseInt(diffCount, 10);
|
|
18
18
|
return diffCountNumeric > 0 ? String(diffCountNumeric) : defaultValue;
|
|
19
19
|
}
|
|
20
20
|
catch (error) {
|
|
21
21
|
return defaultValue;
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var branchNames = ((_b = (_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.git).branchNames;
|
|
24
|
+
const resolveBuildVersionOffset = (c) => {
|
|
25
|
+
const { branchNames } = c.buildConfig?.common?.git;
|
|
27
26
|
switch (getCurrentGitBranchName()) {
|
|
28
27
|
case branchNames.dev:
|
|
29
28
|
return getMergedPullRequestsOffsetFromBranch(branchNames.dist);
|
|
@@ -18,79 +18,66 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
22
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
23
|
-
to[j] = from[i];
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
22
|
exports.resolveDeployLocations = void 0;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
const fs = __importStar(require("fs"));
|
|
24
|
+
const resolveBuildVersion_1 = require("./resolveBuildVersion");
|
|
25
|
+
const resolveBaseUrl_1 = require("./resolveBaseUrl");
|
|
26
|
+
const resolveHbbtvDeployUrl_1 = require("./resolveHbbtvDeployUrl");
|
|
27
|
+
const constants_1 = require("../constants");
|
|
28
|
+
const getBuildVersion = (c) => {
|
|
29
|
+
const { platform, runtime } = c;
|
|
30
|
+
const { scheme, appId } = runtime;
|
|
36
31
|
return resolveBuildVersion_1.resolveBuildVersion({
|
|
37
|
-
platform
|
|
38
|
-
scheme
|
|
32
|
+
platform,
|
|
33
|
+
scheme,
|
|
39
34
|
appConfigId: appId,
|
|
40
35
|
});
|
|
41
36
|
};
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
const getSupportedPlatforms = (c) => {
|
|
38
|
+
const { supportedPlatforms = [] } = c.buildConfig.defaults || {};
|
|
44
39
|
return supportedPlatforms;
|
|
45
40
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var _b = (((_a = c.buildConfig.platforms[platformName]) === null || _a === void 0 ? void 0 : _a.deploy) || {}).supportedFlavours, supportedFlavours = _b === void 0 ? [] : _b;
|
|
41
|
+
const getSupportedFlavoursForPlatform = (c, platformName) => {
|
|
42
|
+
const { supportedFlavours = [] } = c.buildConfig.platforms[platformName]?.deploy || {};
|
|
49
43
|
return supportedFlavours;
|
|
50
44
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
var makeUrls = function (c, platformName, flavourName) {
|
|
63
|
-
var isHbbTVPlatform = platformName === constants_1.Platforms.HBBTV;
|
|
64
|
-
var baseUrl = resolveBaseUrl_1.resolveBaseUrl({
|
|
45
|
+
const makeOutputObject = (buildVersion = '') => ({
|
|
46
|
+
versions: {
|
|
47
|
+
[buildVersion]: {
|
|
48
|
+
platforms: {},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
const makeUrls = (c, platformName, flavourName) => {
|
|
53
|
+
const isHbbTVPlatform = platformName === constants_1.Platforms.HBBTV;
|
|
54
|
+
const baseUrl = resolveBaseUrl_1.resolveBaseUrl({
|
|
65
55
|
platform: platformName,
|
|
66
56
|
scheme: c.runtime.scheme || '',
|
|
67
57
|
appConfigId: flavourName,
|
|
68
58
|
});
|
|
69
59
|
if (!baseUrl)
|
|
70
60
|
return null;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
const packageOutputDirPath = `platformBuilds/${flavourName}_${platformName}/output`;
|
|
62
|
+
const outputFilenameList = fs.readdirSync(packageOutputDirPath);
|
|
63
|
+
const packageFileName = outputFilenameList[0];
|
|
64
|
+
const packageUrl = packageFileName ? `${baseUrl}/build/${packageFileName}` : '';
|
|
65
|
+
const indexUrl = isHbbTVPlatform
|
|
76
66
|
? resolveHbbtvDeployUrl_1.resolveHbbtvDeployUrl(c, c.runtime.scheme, flavourName)
|
|
77
|
-
: baseUrl
|
|
78
|
-
return { packageUrl
|
|
67
|
+
: `${baseUrl}/public/index.html`;
|
|
68
|
+
return { packageUrl, indexUrl };
|
|
79
69
|
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
_a);
|
|
90
|
-
};
|
|
91
|
-
var outputPlatformData = getSupportedFlavoursForPlatform(c, platformName)
|
|
70
|
+
const resolveDeployLocations = (c) => {
|
|
71
|
+
const buildVersion = getBuildVersion(c);
|
|
72
|
+
const output = makeOutputObject(buildVersion);
|
|
73
|
+
const outputPlatforms = output.versions[buildVersion].platforms;
|
|
74
|
+
const processPlatform = (platformName) => {
|
|
75
|
+
const processPlatformFlavour = (flavourName) => ({
|
|
76
|
+
[flavourName]: makeUrls(c, platformName, flavourName),
|
|
77
|
+
});
|
|
78
|
+
const outputPlatformData = getSupportedFlavoursForPlatform(c, platformName)
|
|
92
79
|
.map(processPlatformFlavour);
|
|
93
|
-
outputPlatforms[platformName] = Object.assign
|
|
80
|
+
outputPlatforms[platformName] = Object.assign({}, ...outputPlatformData);
|
|
94
81
|
};
|
|
95
82
|
getSupportedPlatforms(c).forEach(processPlatform);
|
|
96
83
|
return output;
|
|
@@ -18,58 +18,46 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
22
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
23
|
-
to[j] = from[i];
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
22
|
exports.getBaseConfig = exports.isObject = void 0;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
const fs = __importStar(require("fs"));
|
|
24
|
+
const path = __importStar(require("path"));
|
|
25
|
+
const ConfigManager = __importStar(require("rnv/dist/core/configManager"));
|
|
26
|
+
const replaceRelevantStringsInConfig_1 = require("../utils/replaceRelevantStringsInConfig");
|
|
32
27
|
function isObject(item) {
|
|
33
28
|
return (item && typeof item === 'object' && !Array.isArray(item));
|
|
34
29
|
}
|
|
35
30
|
exports.isObject = isObject;
|
|
36
|
-
|
|
37
|
-
var sources = [];
|
|
38
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
39
|
-
sources[_i - 1] = arguments[_i];
|
|
40
|
-
}
|
|
31
|
+
const mergeDeep = (target, ...sources) => {
|
|
41
32
|
if (!sources.length)
|
|
42
33
|
return target;
|
|
43
|
-
|
|
34
|
+
const source = sources.shift();
|
|
44
35
|
if (isObject(target) && isObject(source)) {
|
|
45
|
-
Object.keys(source).forEach(
|
|
46
|
-
var _a, _b;
|
|
36
|
+
Object.keys(source).forEach((key) => {
|
|
47
37
|
if (isObject(source[key])) {
|
|
48
38
|
if (!target[key])
|
|
49
|
-
Object.assign(target,
|
|
39
|
+
Object.assign(target, { [key]: {} });
|
|
50
40
|
mergeDeep(target[key], source[key]);
|
|
51
41
|
}
|
|
52
42
|
else {
|
|
53
|
-
Object.assign(target,
|
|
43
|
+
Object.assign(target, { [key]: source[key] });
|
|
54
44
|
}
|
|
55
45
|
});
|
|
56
46
|
}
|
|
57
|
-
return mergeDeep
|
|
47
|
+
return mergeDeep(target, ...sources);
|
|
58
48
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var fileContentAsString = fs.readFileSync(filePath).toString();
|
|
63
|
-
var fileContentAsJSON = JSON.parse(fileContentAsString);
|
|
49
|
+
const mergeFileJsonIntoObject = (filePath = '', targetObject = {}) => {
|
|
50
|
+
const fileContentAsString = fs.readFileSync(filePath).toString();
|
|
51
|
+
const fileContentAsJSON = JSON.parse(fileContentAsString);
|
|
64
52
|
mergeDeep(targetObject, fileContentAsJSON);
|
|
65
53
|
};
|
|
66
|
-
|
|
67
|
-
|
|
54
|
+
const getBaseConfig = () => {
|
|
55
|
+
const c = ConfigManager.createRnvConfig({ ci: true }, process);
|
|
68
56
|
c.buildConfig = {};
|
|
69
|
-
|
|
57
|
+
const packageJsonfileContent = fs.readFileSync('package.json').toString();
|
|
70
58
|
c.files.project.package = JSON.parse(packageJsonfileContent);
|
|
71
59
|
mergeFileJsonIntoObject(c.paths.project.config, c.buildConfig);
|
|
72
|
-
|
|
60
|
+
const baseConfigPath = path.join(c.paths.project.appConfigBase.dir, 'renative.json');
|
|
73
61
|
mergeFileJsonIntoObject(baseConfigPath, c.buildConfig);
|
|
74
62
|
replaceRelevantStringsInConfig_1.replaceRelevantStringsInConfig(c);
|
|
75
63
|
return c;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveHbbtvDeployConfig = void 0;
|
|
4
|
-
|
|
4
|
+
const resolveHbbtvDeployConfig = () => ({
|
|
5
5
|
host: 'nxg-bigscreen-test.24imedia.tv',
|
|
6
6
|
username: 'admin',
|
|
7
7
|
privateKeyRelativePath: 'certificates/id_rsa_24i_smartapps_bigscreen',
|
|
@@ -9,5 +9,5 @@ var resolveHbbtvDeployConfig = function () { return ({
|
|
|
9
9
|
hostHomeDir: '/home/admin',
|
|
10
10
|
dockerHtmlRootDir: '/usr/share/nginx/html',
|
|
11
11
|
dockerContainerName: '24inginx',
|
|
12
|
-
});
|
|
12
|
+
});
|
|
13
13
|
exports.resolveHbbtvDeployConfig = resolveHbbtvDeployConfig;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveHbbtvDeployUrl = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return
|
|
4
|
+
const resolveHbbtvRemoteBuildDirRelativePath_1 = require("./resolveHbbtvRemoteBuildDirRelativePath");
|
|
5
|
+
const resolveHbbtvDeployConfig_1 = require("./resolveHbbtvDeployConfig");
|
|
6
|
+
const resolveHbbtvDeployUrl = (c, scheme, appConfigId) => {
|
|
7
|
+
const { host } = resolveHbbtvDeployConfig_1.resolveHbbtvDeployConfig();
|
|
8
|
+
const remoteDirRelativePath = resolveHbbtvRemoteBuildDirRelativePath_1.resolveHbbtvRemoteBuildDirRelativePath(c, scheme, appConfigId);
|
|
9
|
+
return `http://${host}/${remoteDirRelativePath}/public/index.html`;
|
|
10
10
|
};
|
|
11
11
|
exports.resolveHbbtvDeployUrl = resolveHbbtvDeployUrl;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveHbbtvRemoteBuildDirRelativePath = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const rnv_1 = require("rnv");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const { getConfigProp } = rnv_1.Common;
|
|
7
|
+
const resolveHbbtvRemoteBuildDirRelativePath = (c, scheme, appConfigId) => {
|
|
8
|
+
const { projectDirName } = getConfigProp(c, constants_1.Platforms.HBBTV, 'deploy', {});
|
|
9
|
+
const version = getConfigProp(c, constants_1.Platforms.HBBTV, 'packageVersion', '');
|
|
10
|
+
const appId = c.runtime.appId || appConfigId;
|
|
11
11
|
if (!projectDirName || !appId) {
|
|
12
12
|
return '';
|
|
13
13
|
}
|
|
14
14
|
switch (c.runtime.scheme || scheme) {
|
|
15
15
|
case constants_1.BuildSchemes.DEV_LATEST:
|
|
16
|
-
return projectDirName
|
|
16
|
+
return `${projectDirName}/${appId}/latest/dev`;
|
|
17
17
|
case constants_1.BuildSchemes.RC_LATEST:
|
|
18
|
-
return projectDirName
|
|
18
|
+
return `${projectDirName}/${appId}/latest/rc`;
|
|
19
19
|
case constants_1.BuildSchemes.RELEASE_LATEST:
|
|
20
|
-
return projectDirName
|
|
20
|
+
return `${projectDirName}/${appId}/latest/release`;
|
|
21
21
|
case constants_1.BuildSchemes.RELEASE_DIST:
|
|
22
|
-
return projectDirName
|
|
22
|
+
return `${projectDirName}/${appId}/dist/v${version}`;
|
|
23
23
|
default:
|
|
24
24
|
return '';
|
|
25
25
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveZippedPlatformBuildsRelativeFilePath = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return relativePathToDir
|
|
4
|
+
const common_1 = require("rnv/dist/core/common");
|
|
5
|
+
const resolveZippedPlatformBuildsRelativeFilePath = (c, platformName) => {
|
|
6
|
+
const { platformBuildsDir } = c.buildConfig.paths;
|
|
7
|
+
const appNameInFileName = common_1.getConfigProp(c, platformName, 'appNameInFileName', '');
|
|
8
|
+
const buildVersion = common_1.getConfigProp(c, platformName, 'packageVersion', '');
|
|
9
|
+
const zippedFilesParentDir = 'zipped_by_platform';
|
|
10
|
+
const fileExtension = 'zip';
|
|
11
|
+
const relativePathToDir = `${platformBuildsDir}/${zippedFilesParentDir}`;
|
|
12
|
+
const zipFileName = `${appNameInFileName}_${platformName}_${buildVersion}.${fileExtension}`;
|
|
13
|
+
return `${relativePathToDir}/${zipFileName}`;
|
|
14
14
|
};
|
|
15
15
|
exports.resolveZippedPlatformBuildsRelativeFilePath = resolveZippedPlatformBuildsRelativeFilePath;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
const child_process_1 = require("child_process");
|
|
4
|
+
const forEachSupportedPlatformFlavour_1 = require("../utils/forEachSupportedPlatformFlavour");
|
|
5
|
+
const resolvers_1 = require("../resolvers");
|
|
6
|
+
const buildTask = (options) => {
|
|
7
|
+
const { scheme, platform, flavour } = options;
|
|
8
|
+
const cmd = `npx rnv build -s ${scheme} -p ${platform} -c ${flavour} --ci`;
|
|
9
9
|
child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const buildAllWithScheme = () => {
|
|
12
|
+
const scheme = process.argv[2];
|
|
13
13
|
if (!scheme) {
|
|
14
14
|
throw new Error('No scheme name to use found! Please use rnv scheme name as a param.');
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
const c = resolvers_1.getBaseConfig();
|
|
17
17
|
c.runtime.scheme = scheme;
|
|
18
18
|
forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour(c, buildTask);
|
|
19
19
|
return true;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
const startTimestamp = Date.now();
|
|
22
22
|
buildAllWithScheme();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
console.log(
|
|
23
|
+
const msPerSecond = 1000;
|
|
24
|
+
const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
|
|
25
|
+
console.log(`buildAllWithScheme: done in ${scriptTotalTimeInSeconds} second(s)!`);
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _a, _b, _c;
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
const resolvers_1 = require("../../resolvers");
|
|
4
|
+
const gitUtils_1 = require("../utils/gitUtils");
|
|
5
|
+
const c = resolvers_1.getBaseConfig();
|
|
6
|
+
const { branchNames = {}, commitTitles = {} } = c.buildConfig?.common?.git || {};
|
|
7
|
+
const { packageVersion = '' } = c.buildConfig?.common || {};
|
|
8
|
+
const newReleaseBranchName = branchNames.rc;
|
|
10
9
|
gitUtils_1.createBranch(newReleaseBranchName);
|
|
11
10
|
gitUtils_1.checkout(newReleaseBranchName);
|
|
12
11
|
gitUtils_1.addAll();
|
|
13
|
-
|
|
12
|
+
const withNoVerifyFlag = true;
|
|
14
13
|
console.log('Creating commit with changed version...');
|
|
15
14
|
gitUtils_1.commit(commitTitles.versionBump, withNoVerifyFlag);
|
|
16
|
-
console.log(
|
|
15
|
+
console.log(`Pushing ${newReleaseBranchName} branch...`);
|
|
17
16
|
gitUtils_1.push(newReleaseBranchName, withNoVerifyFlag);
|
|
18
|
-
console.log(
|
|
17
|
+
console.log(`\nDone! The version has been bumped to ${packageVersion} and ${newReleaseBranchName} branch pushed into the remote repository.`);
|
|
19
18
|
console.log('Note: Do not forget to update release notes for upcoming release!');
|