@24i/smartapps-bigscreen-rnv-build-engine 0.17.5-alpha.1 → 0.17.5-alpha.2284
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/delopyLivePlatforms.js +13 -0
- package/dist/src/scripts/deployLiveAll.js +27 -0
- package/dist/src/scripts/deployLivePlatform.js +40 -0
- package/dist/src/tasks/deploy/aswS3/aws.js +21 -3
- package/dist/src/tasks/deploy/aswS3/deployS3.js +2 -1
- package/dist/src/tasks/deploy/aswS3/distToLiveS3.js +76 -0
- package/dist/src/utils/forEachSupportedPlatformFlavour.js +7 -2
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/model/MediaEventType.kt +3 -1
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NO_CONTENT_FOLDER_PLATFORMS = exports.UNSUPPORTED_PLATFORMS = void 0;
|
|
4
|
+
const platforms_1 = require("./platforms");
|
|
5
|
+
const UNSUPPORTED_PLATFORMS = [
|
|
6
|
+
platforms_1.Platforms.WEBTV,
|
|
7
|
+
];
|
|
8
|
+
exports.UNSUPPORTED_PLATFORMS = UNSUPPORTED_PLATFORMS;
|
|
9
|
+
const NO_CONTENT_FOLDER_PLATFORMS = [
|
|
10
|
+
platforms_1.Platforms.VIDAA,
|
|
11
|
+
platforms_1.Platforms.ANDROIDTV,
|
|
12
|
+
];
|
|
13
|
+
exports.NO_CONTENT_FOLDER_PLATFORMS = NO_CONTENT_FOLDER_PLATFORMS;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const forEachSupportedPlatformFlavour_1 = require("../utils/forEachSupportedPlatformFlavour");
|
|
4
|
+
const resolvers_1 = require("../resolvers");
|
|
5
|
+
const delopyLivePlatforms_1 = require("../constants/delopyLivePlatforms");
|
|
6
|
+
const distToLiveS3_1 = require("../tasks/deploy/aswS3/distToLiveS3");
|
|
7
|
+
const buildSchemes_1 = require("../constants/buildSchemes");
|
|
8
|
+
const deployLiveAll = () => {
|
|
9
|
+
const version = process.argv[2];
|
|
10
|
+
if (!version) {
|
|
11
|
+
throw new Error('No version supplied! Please provide distribution version to publish live.');
|
|
12
|
+
}
|
|
13
|
+
const c = (0, resolvers_1.getBaseConfig)();
|
|
14
|
+
c.runtime.scheme = buildSchemes_1.BuildSchemes.RELEASE_DIST;
|
|
15
|
+
(0, forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour)(c, (o) => {
|
|
16
|
+
(0, distToLiveS3_1.checkDistVersionAvailability)(o, version);
|
|
17
|
+
}, delopyLivePlatforms_1.UNSUPPORTED_PLATFORMS);
|
|
18
|
+
(0, forEachSupportedPlatformFlavour_1.forEachSupportedPlatformFlavour)(c, (o) => {
|
|
19
|
+
(0, distToLiveS3_1.distToLiveS3)(o, version, delopyLivePlatforms_1.NO_CONTENT_FOLDER_PLATFORMS.includes(o.platform));
|
|
20
|
+
}, delopyLivePlatforms_1.UNSUPPORTED_PLATFORMS);
|
|
21
|
+
return true;
|
|
22
|
+
};
|
|
23
|
+
const startTimestamp = Date.now();
|
|
24
|
+
deployLiveAll();
|
|
25
|
+
const msPerSecond = 1000;
|
|
26
|
+
const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
|
|
27
|
+
console.log(`deployLiveAll: done in ${scriptTotalTimeInSeconds} second(s)!`);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const forEachSupportedPlatformFlavour_1 = require("../utils/forEachSupportedPlatformFlavour");
|
|
4
|
+
const resolvers_1 = require("../resolvers");
|
|
5
|
+
const delopyLivePlatforms_1 = require("../constants/delopyLivePlatforms");
|
|
6
|
+
const distToLiveS3_1 = require("../tasks/deploy/aswS3/distToLiveS3");
|
|
7
|
+
const buildSchemes_1 = require("../constants/buildSchemes");
|
|
8
|
+
const deployLivePlatform = () => {
|
|
9
|
+
const version = process.argv[2];
|
|
10
|
+
const platform = process.argv[3];
|
|
11
|
+
if (!version) {
|
|
12
|
+
throw new Error('No version supplied! Please provide distribution version to publish live.');
|
|
13
|
+
}
|
|
14
|
+
if (!platform) {
|
|
15
|
+
throw new Error('No platform name to use found! Please use rnv platform name as a param.');
|
|
16
|
+
}
|
|
17
|
+
if (delopyLivePlatforms_1.UNSUPPORTED_PLATFORMS.includes(platform)) {
|
|
18
|
+
throw new Error(`Platform "${platform}" not supported!`);
|
|
19
|
+
}
|
|
20
|
+
const c = (0, resolvers_1.getBaseConfig)();
|
|
21
|
+
c.platform = platform;
|
|
22
|
+
c.runtime.scheme = buildSchemes_1.BuildSchemes.RELEASE_DIST;
|
|
23
|
+
const { scheme } = c.runtime;
|
|
24
|
+
const { supportedFlavours = [] } = c.buildConfig.platforms[platform]?.deploy || {};
|
|
25
|
+
const o = { scheme, platform };
|
|
26
|
+
supportedFlavours.forEach((flavour, i) => {
|
|
27
|
+
console.log((0, forEachSupportedPlatformFlavour_1.getProgressMessage)([platform], 0, supportedFlavours, i));
|
|
28
|
+
(0, distToLiveS3_1.checkDistVersionAvailability)({ ...o, flavour }, version);
|
|
29
|
+
});
|
|
30
|
+
supportedFlavours.forEach((flavour, i) => {
|
|
31
|
+
console.log((0, forEachSupportedPlatformFlavour_1.getProgressMessage)([platform], 0, supportedFlavours, i));
|
|
32
|
+
(0, distToLiveS3_1.distToLiveS3)({ ...o, flavour }, version, delopyLivePlatforms_1.NO_CONTENT_FOLDER_PLATFORMS.includes(o.platform));
|
|
33
|
+
});
|
|
34
|
+
return true;
|
|
35
|
+
};
|
|
36
|
+
const startTimestamp = Date.now();
|
|
37
|
+
deployLivePlatform();
|
|
38
|
+
const msPerSecond = 1000;
|
|
39
|
+
const scriptTotalTimeInSeconds = Math.ceil((Date.now() - startTimestamp) / msPerSecond);
|
|
40
|
+
console.log(`deployLivePlatform: done in ${scriptTotalTimeInSeconds} second(s)!`);
|
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rm = exports.cp = void 0;
|
|
3
|
+
exports.getIdentity = exports.ls = exports.rm = exports.cpRemote = exports.cp = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const fsUtils_1 = require("../../../scripts/utils/fsUtils");
|
|
6
|
+
const RECURSIVE_FLAG = ' --recursive';
|
|
6
7
|
const runCmdSync = (cmd) => (0, child_process_1.execSync)(cmd, { stdio: 'inherit' });
|
|
8
|
+
const runCmdSyncSilent = (cmd) => (0, child_process_1.execSync)(cmd, { stdio: 'pipe' });
|
|
9
|
+
const getIdentity = () => {
|
|
10
|
+
runCmdSyncSilent('aws sts get-caller-identity');
|
|
11
|
+
};
|
|
12
|
+
exports.getIdentity = getIdentity;
|
|
13
|
+
const ls = (remotePath) => {
|
|
14
|
+
runCmdSyncSilent(`aws s3 ls s3://${remotePath}`);
|
|
15
|
+
};
|
|
16
|
+
exports.ls = ls;
|
|
7
17
|
const cp = (source, destination) => {
|
|
8
18
|
let cmd = `aws s3 cp ${source} s3://${destination} --acl public-read`;
|
|
9
19
|
if ((0, fsUtils_1.isDir)(source)) {
|
|
10
|
-
cmd +=
|
|
20
|
+
cmd += RECURSIVE_FLAG;
|
|
11
21
|
}
|
|
12
22
|
runCmdSync(cmd);
|
|
13
23
|
};
|
|
14
24
|
exports.cp = cp;
|
|
25
|
+
const cpRemote = (source, destination) => {
|
|
26
|
+
let cmd = `aws s3 cp s3://${source} s3://${destination} --acl public-read`;
|
|
27
|
+
if (source.endsWith('/')) {
|
|
28
|
+
cmd += RECURSIVE_FLAG;
|
|
29
|
+
}
|
|
30
|
+
runCmdSync(cmd);
|
|
31
|
+
};
|
|
32
|
+
exports.cpRemote = cpRemote;
|
|
15
33
|
const rm = (remoteDirPath) => {
|
|
16
34
|
let cmd = `aws s3 rm s3://${remoteDirPath}`;
|
|
17
35
|
if (remoteDirPath.endsWith('/')) {
|
|
18
|
-
cmd +=
|
|
36
|
+
cmd += RECURSIVE_FLAG;
|
|
19
37
|
}
|
|
20
38
|
runCmdSync(cmd);
|
|
21
39
|
};
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.deployToS3 = void 0;
|
|
26
|
+
exports.deployToS3 = exports.urlToS3Protocol = void 0;
|
|
27
27
|
const path = __importStar(require("path"));
|
|
28
28
|
const rnv_1 = require("rnv");
|
|
29
29
|
const aws = __importStar(require("./aws"));
|
|
@@ -47,6 +47,7 @@ const urlToS3Protocol = (url) => {
|
|
|
47
47
|
const bucketHostnameAwsPostfix = '.s3.amazonaws.com';
|
|
48
48
|
return hostWithPath.replace(bucketHostnameAwsPostfix, '');
|
|
49
49
|
};
|
|
50
|
+
exports.urlToS3Protocol = urlToS3Protocol;
|
|
50
51
|
const deployToS3 = async (c) => {
|
|
51
52
|
const { platform, runtime } = c;
|
|
52
53
|
const sourcePath = runtime.appDir;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.checkAWSAuth = exports.checkDistVersionAvailability = exports.distToLiveS3 = void 0;
|
|
27
|
+
const resolveBaseUrl_1 = require("../../../resolvers/resolveBaseUrl");
|
|
28
|
+
const resolveGenericRnvConfig_1 = require("../../../resolvers/resolveGenericRnvConfig");
|
|
29
|
+
const deployS3_1 = require("./deployS3");
|
|
30
|
+
const aws = __importStar(require("./aws"));
|
|
31
|
+
const getUploadPath = (options, version) => {
|
|
32
|
+
const { packageVersion } = (0, resolveGenericRnvConfig_1.getBaseConfig)().buildConfig?.common;
|
|
33
|
+
const baseUrl = (0, resolveBaseUrl_1.resolveBaseUrl)(options);
|
|
34
|
+
if (!baseUrl) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
return (0, deployS3_1.urlToS3Protocol)(baseUrl).replace(packageVersion, version);
|
|
38
|
+
};
|
|
39
|
+
const checkAWSAuth = () => {
|
|
40
|
+
try {
|
|
41
|
+
aws.getIdentity();
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
throw new Error('Failed to get AWS user identity, are your credentials configured correctly?\n');
|
|
45
|
+
}
|
|
46
|
+
return true;
|
|
47
|
+
};
|
|
48
|
+
exports.checkAWSAuth = checkAWSAuth;
|
|
49
|
+
const checkDistVersionAvailability = (options, version) => {
|
|
50
|
+
const uploadPath = getUploadPath(options, version);
|
|
51
|
+
if (!uploadPath)
|
|
52
|
+
return false;
|
|
53
|
+
try {
|
|
54
|
+
process.stdout.write(`Verifying distribution v${version} availability for flavour ${options.flavour}.\n`);
|
|
55
|
+
aws.ls(uploadPath);
|
|
56
|
+
process.stdout.write('OK.\n');
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
throw new Error(`Failed to locate distribution version ${version} for platform "${options.platform}" flavour ${options.flavour}.
|
|
60
|
+
attempted to look at: ${uploadPath}.\n`);
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
};
|
|
64
|
+
exports.checkDistVersionAvailability = checkDistVersionAvailability;
|
|
65
|
+
const distToLiveS3 = (options, version, copyIndexOnly) => {
|
|
66
|
+
const uploadPath = getUploadPath(options, version);
|
|
67
|
+
if (!uploadPath)
|
|
68
|
+
return false;
|
|
69
|
+
const indexPath = copyIndexOnly ? 'index.html' : '';
|
|
70
|
+
const copyFrom = `${uploadPath}/public/${indexPath}`;
|
|
71
|
+
const copyTo = `${uploadPath.replace(/dist\/v.*/, 'live')}/public/${indexPath}`;
|
|
72
|
+
aws.cpRemote(copyFrom, copyTo);
|
|
73
|
+
process.stdout.write('Publish done.\n');
|
|
74
|
+
return true;
|
|
75
|
+
};
|
|
76
|
+
exports.distToLiveS3 = distToLiveS3;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.forEachSupportedPlatformFlavour = void 0;
|
|
3
|
+
exports.forEachSupportedPlatformFlavour = exports.getProgressMessage = void 0;
|
|
4
4
|
const resolvers_1 = require("../resolvers");
|
|
5
5
|
const getProgressMessage = (platforms, platformIndex, flavours, flavourIndex) => {
|
|
6
6
|
let string = `\nProcessing "${platforms[platformIndex]}" platform`;
|
|
@@ -9,8 +9,13 @@ const getProgressMessage = (platforms, platformIndex, flavours, flavourIndex) =>
|
|
|
9
9
|
string += ` (${flavourIndex + 1}/${flavours.length})...`;
|
|
10
10
|
return string;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
exports.getProgressMessage = getProgressMessage;
|
|
13
|
+
const forEachSupportedPlatformFlavour = (c, cb, ignoredPlatforms = []) => {
|
|
13
14
|
const processPlatformFlavours = (platform, platformIndex, platforms) => {
|
|
15
|
+
if (ignoredPlatforms.includes(platform)) {
|
|
16
|
+
console.log(`\nSkipping "${platforms[platformIndex]}" platform (${platformIndex + 1}/${platforms.length}).`);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
14
19
|
const processFlavour = (flavour, flavourIndex, flavours) => {
|
|
15
20
|
console.log(getProgressMessage(platforms, platformIndex, flavours, flavourIndex));
|
|
16
21
|
const { scheme } = c.runtime;
|
|
@@ -8,8 +8,10 @@ object MediaEventType {
|
|
|
8
8
|
const val ERROR = "error"
|
|
9
9
|
const val PLAYING = "playing"
|
|
10
10
|
const val PAUSE = "pause"
|
|
11
|
-
const val PLAY = "
|
|
11
|
+
const val PLAY = "play"
|
|
12
12
|
const val ENDED = "ended"
|
|
13
|
+
const val CANPLAY = "canplay"
|
|
14
|
+
const val LOADEDMETADATA = "loadedmetadata"
|
|
13
15
|
const val WAITING = "waiting"
|
|
14
16
|
const val SEEKING = "seeking"
|
|
15
17
|
const val SEEKED = "seeked"
|
package/package.json
CHANGED