@24i/smartapps-bigscreen-rnv-build-engine 0.11.3-alpha.1660 → 0.12.1-alpha.1652
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/sdks/index.js
CHANGED
|
@@ -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.handlePlatformSdk = exports.
|
|
22
|
+
exports.handlePlatformSdk = exports.SDKWebpack = exports.SDKTizen = exports.SDKWebos = void 0;
|
|
23
23
|
const constants_1 = require("../constants");
|
|
24
24
|
const SDKWebos = __importStar(require("./sdk-webos"));
|
|
25
25
|
exports.SDKWebos = SDKWebos;
|
|
@@ -27,8 +27,6 @@ const SDKTizen = __importStar(require("./sdk-tizen"));
|
|
|
27
27
|
exports.SDKTizen = SDKTizen;
|
|
28
28
|
const SDKWebpack = __importStar(require("./sdk-webpack"));
|
|
29
29
|
exports.SDKWebpack = SDKWebpack;
|
|
30
|
-
const SDKXbox = __importStar(require("./sdk-xbox"));
|
|
31
|
-
exports.SDKXbox = SDKXbox;
|
|
32
30
|
const handlePlatformSdk = async (c) => {
|
|
33
31
|
switch (c.platform) {
|
|
34
32
|
case constants_1.Platforms.TIZEN:
|
|
@@ -32,7 +32,6 @@ const { logTask } = rnv_1.Logger;
|
|
|
32
32
|
const { buildWeb } = sdks_1.SDKWebpack;
|
|
33
33
|
const { buildTizenProject } = sdks_1.SDKTizen;
|
|
34
34
|
const { buildWebOSProject } = sdks_1.SDKWebos;
|
|
35
|
-
const { buildXboxProject } = sdks_1.SDKXbox;
|
|
36
35
|
const { executeOrSkipTask } = rnv_1.TaskManager;
|
|
37
36
|
const { TASK_BUILD, TASK_PACKAGE, PARAMS } = rnv_1.Constants;
|
|
38
37
|
const makeZipOutput = (c) => {
|
|
@@ -71,12 +70,10 @@ const buildFn = async (c, parentTask, originTask) => {
|
|
|
71
70
|
case constants_1.Platforms.KREATV:
|
|
72
71
|
case constants_1.Platforms.SAPHI:
|
|
73
72
|
case constants_1.Platforms.WEBTV:
|
|
73
|
+
case constants_1.Platforms.XBOX:
|
|
74
74
|
await buildWeb(c);
|
|
75
75
|
makeZipOutput(c);
|
|
76
76
|
return;
|
|
77
|
-
case constants_1.Platforms.XBOX:
|
|
78
|
-
await buildXboxProject(c);
|
|
79
|
-
return;
|
|
80
77
|
case constants_1.Platforms.TIZEN:
|
|
81
78
|
await buildTizenProject(c);
|
|
82
79
|
renameOutput(c);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@24i/smartapps-bigscreen-rnv-build-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1-alpha.1652+1a66e622",
|
|
4
4
|
"description": "Package with build engine for SmartApps BIGscreen projects...",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,15 +16,8 @@
|
|
|
16
16
|
"lintcheck:cached": "npm run eslint -- --cache && npm run stylelint -- --cache",
|
|
17
17
|
"typecheck:cached": "tsc --noEmit --incremental",
|
|
18
18
|
"test": "jest --passWithNoTests",
|
|
19
|
-
"prepublishOnly": "npm run build"
|
|
20
|
-
"postinstall": "node fixDependency.js"
|
|
19
|
+
"prepublishOnly": "npm run build"
|
|
21
20
|
},
|
|
22
|
-
"deleteDependencies": [
|
|
23
|
-
{
|
|
24
|
-
"path": "../../unzip2/node_modules/graceful-fs/",
|
|
25
|
-
"version": "^4.2.8"
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
21
|
"devDependencies": {
|
|
29
22
|
"@types/inquirer": "8.1.3",
|
|
30
23
|
"@types/mini-css-extract-plugin": "1.2.2",
|
|
@@ -36,9 +29,6 @@
|
|
|
36
29
|
"nock": "13.2.1",
|
|
37
30
|
"svgo": "1.3.2"
|
|
38
31
|
},
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"manifoldjs": "*"
|
|
41
|
-
},
|
|
42
32
|
"peerDependencies": {
|
|
43
33
|
"@24i/smartapps-bigscreen-device": "*",
|
|
44
34
|
"assign-deep": "^1.0.1",
|
|
@@ -72,5 +62,5 @@
|
|
|
72
62
|
"keywords": [],
|
|
73
63
|
"author": "24i",
|
|
74
64
|
"license": "ISC",
|
|
75
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "1a66e62215fb1ec0848d91218a706254aedaf340"
|
|
76
66
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./sdkXbox"), exports);
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildXboxProject = void 0;
|
|
4
|
-
const rnv_1 = require("rnv");
|
|
5
|
-
const child_process_1 = require("child_process");
|
|
6
|
-
const fs_1 = require("fs");
|
|
7
|
-
const resolvers_1 = require("../../resolvers");
|
|
8
|
-
const fs = fs_1.promises;
|
|
9
|
-
const { logTask } = rnv_1.Logger;
|
|
10
|
-
const { buildCoreWebpackProject } = rnv_1.WebpackUtils;
|
|
11
|
-
const projectBuilder = require('manifoldjs-windows10/index');
|
|
12
|
-
const { manifestTools } = require('manifoldjs/index');
|
|
13
|
-
const hostedAppOutputPath = '/output/hosted';
|
|
14
|
-
const packagedAppOutputPath = '/output/packaged';
|
|
15
|
-
const packagedAppSrcDestination = '/output/packaged/windows10/source/src';
|
|
16
|
-
const appSourcePath = '/project/public';
|
|
17
|
-
const packagedAppEntryUrl = 'src/index.html';
|
|
18
|
-
const wrapperConfigPath = '/wrapperConfig.json';
|
|
19
|
-
const hostedSourceImages = '/output/hosted/windows10/source/images';
|
|
20
|
-
const packagedSourceImages = '/output/packaged/windows10/source/images';
|
|
21
|
-
const hostedManifestImages = '/output/hosted/windows10/manifest/images';
|
|
22
|
-
const packagedManifestImages = '/output/packaged/windows10/manifest/images';
|
|
23
|
-
const identityNamePlaceholder = 'INSERT-YOUR-PACKAGE-IDENTITY-NAME-HERE';
|
|
24
|
-
const identityPublisherPlaceholder = 'INSERT-YOUR-PACKAGE-IDENTITY-PUBLISHER-HERE';
|
|
25
|
-
const publisherDisplayNamePlaceholder = 'INSERT-YOUR-PACKAGE-PROPERTIES-PUBLISHERDISPLAYNAME-HERE';
|
|
26
|
-
class Manifest {
|
|
27
|
-
content = { start_url: '', short_name: '', theme_color: 'white' };
|
|
28
|
-
format = 'w3c';
|
|
29
|
-
}
|
|
30
|
-
const buildXboxProject = async (c) => {
|
|
31
|
-
logTask('buildXboxProject');
|
|
32
|
-
await buildCoreWebpackProject(c);
|
|
33
|
-
const outputDirectory = `${await getBuildFolder(c)}/output`;
|
|
34
|
-
(0, child_process_1.execSync)(`rm -rf ${outputDirectory}`);
|
|
35
|
-
await createHostedApplication(c);
|
|
36
|
-
await createPackagedApplication(c);
|
|
37
|
-
await replacePublisherId(c, `${await getBuildFolder(c)}${hostedAppOutputPath}`);
|
|
38
|
-
await replacePublisherId(c, `${await getBuildFolder(c)}${packagedAppOutputPath}`);
|
|
39
|
-
await replaceImages(c);
|
|
40
|
-
await zipOutput(c);
|
|
41
|
-
};
|
|
42
|
-
exports.buildXboxProject = buildXboxProject;
|
|
43
|
-
const getHostedAppEntryUrl = (c) => {
|
|
44
|
-
const deployLocations = (0, resolvers_1.resolveDeployLocations)(c);
|
|
45
|
-
const keys = Object.keys(deployLocations.versions);
|
|
46
|
-
let url;
|
|
47
|
-
if (keys !== null && keys.length > 0) {
|
|
48
|
-
const version = keys[0];
|
|
49
|
-
if (version !== null) {
|
|
50
|
-
url = deployLocations.versions[version].platforms.xbox?.animated_720?.indexUrl;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return url;
|
|
54
|
-
};
|
|
55
|
-
async function zipOutput(c) {
|
|
56
|
-
logTask('zipOutput');
|
|
57
|
-
const defaultZipFileName = `${c.platform}_${c.runtime.appId}.zip`;
|
|
58
|
-
const fileName = (0, resolvers_1.resolveBuildFileName)(c) || defaultZipFileName;
|
|
59
|
-
const outputDirectory = `${await getBuildFolder(c)}/output`;
|
|
60
|
-
const tmpOutputDirectory = `${await getBuildFolder(c)}/tmpOutput`;
|
|
61
|
-
(0, child_process_1.execSync)(`mkdir ${tmpOutputDirectory}`);
|
|
62
|
-
(0, child_process_1.execSync)(`cp -r ${outputDirectory} ${tmpOutputDirectory}`);
|
|
63
|
-
(0, child_process_1.execSync)(`rm -rf ${outputDirectory}`);
|
|
64
|
-
(0, child_process_1.execSync)(`mkdir ${outputDirectory}`);
|
|
65
|
-
(0, child_process_1.execSync)(`zip -r ${outputDirectory}/${fileName} *`, { cwd: `${tmpOutputDirectory}` });
|
|
66
|
-
(0, child_process_1.execSync)(`rm -rf ${tmpOutputDirectory}`);
|
|
67
|
-
}
|
|
68
|
-
const createVSSolution = async (c, outputPath, manifest) => {
|
|
69
|
-
logTask('createVSSolution');
|
|
70
|
-
try {
|
|
71
|
-
manifest.content.short_name = c.buildConfig.common.appName;
|
|
72
|
-
const platform = new projectBuilder.Platform('package', ['windows10']);
|
|
73
|
-
await platform.create(manifest, outputPath, ['windows10'], '');
|
|
74
|
-
}
|
|
75
|
-
catch { }
|
|
76
|
-
};
|
|
77
|
-
async function loadManifestFromFile(path) {
|
|
78
|
-
const result = await manifestTools.getManifestFromFile(path, 'w3c');
|
|
79
|
-
return result;
|
|
80
|
-
}
|
|
81
|
-
async function createHostedApplication(c) {
|
|
82
|
-
logTask('createHostedApplication');
|
|
83
|
-
const manifest = new Manifest();
|
|
84
|
-
manifest.content.start_url = getHostedAppEntryUrl(c);
|
|
85
|
-
await createVSSolution(c, `${await getBuildFolder(c)}${hostedAppOutputPath}`, manifest);
|
|
86
|
-
}
|
|
87
|
-
async function createPackagedApplication(c) {
|
|
88
|
-
logTask('createPackagedApplication');
|
|
89
|
-
const manifest = new Manifest();
|
|
90
|
-
manifest.content.start_url = packagedAppEntryUrl ?? '';
|
|
91
|
-
const sourceDir = `${await getBuildFolder(c)}${appSourcePath}`;
|
|
92
|
-
const destinationDirectory = `${await getBuildFolder(c)}${packagedAppSrcDestination}`;
|
|
93
|
-
await createVSSolution(c, `${await getBuildFolder(c)}${packagedAppOutputPath}`, manifest);
|
|
94
|
-
(0, child_process_1.execSync)(`cp -r ${sourceDir} ${destinationDirectory}`);
|
|
95
|
-
}
|
|
96
|
-
function getBuildFolder(c) {
|
|
97
|
-
const sourceDir = `${rnv_1.Common.getPlatformBuildDir(c)}`;
|
|
98
|
-
return sourceDir;
|
|
99
|
-
}
|
|
100
|
-
async function replacePublisherId(c, basePath) {
|
|
101
|
-
logTask('replacePublisherId');
|
|
102
|
-
const output = `${basePath}/windows10/manifest/appxmanifest.xml`;
|
|
103
|
-
const configPath = `${await getBuildFolder(c)}${wrapperConfigPath}`;
|
|
104
|
-
let appxmanifest = null;
|
|
105
|
-
let org;
|
|
106
|
-
let identityName = null;
|
|
107
|
-
let identityPublisher = null;
|
|
108
|
-
let publisherDisplayName = null;
|
|
109
|
-
return fs.readFile(configPath).then((data) => {
|
|
110
|
-
const config = JSON.parse(data.toString());
|
|
111
|
-
({ identityName } = config);
|
|
112
|
-
({ identityPublisher } = config);
|
|
113
|
-
({ publisherDisplayName } = config);
|
|
114
|
-
}).then(() => {
|
|
115
|
-
return fs.readFile(output).then((data) => {
|
|
116
|
-
appxmanifest = data.toString();
|
|
117
|
-
if (identityName !== null
|
|
118
|
-
&& identityPublisher !== null
|
|
119
|
-
&& publisherDisplayName !== null) {
|
|
120
|
-
appxmanifest = appxmanifest.replace(identityNamePlaceholder, identityName)
|
|
121
|
-
.replace(identityPublisherPlaceholder, identityPublisher)
|
|
122
|
-
.replace(publisherDisplayNamePlaceholder, publisherDisplayName);
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
}).then(() => {
|
|
126
|
-
return fs.writeFile(output, appxmanifest ?? '');
|
|
127
|
-
}).catch((err) => {
|
|
128
|
-
const errorMessage = 'Failed to modify the xbox appxmanifest.xml';
|
|
129
|
-
console.log(errorMessage);
|
|
130
|
-
return errorMessage;
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
async function replaceImages(c) {
|
|
134
|
-
logTask('replaceImages');
|
|
135
|
-
const hostedOutputDirectory = `${await getBuildFolder(c)}${hostedSourceImages}`;
|
|
136
|
-
const packagedOutputDirectory = `${await getBuildFolder(c)}${packagedSourceImages}`;
|
|
137
|
-
const hostedOutputManifestDirectory = `${await getBuildFolder(c)}${hostedManifestImages}`;
|
|
138
|
-
const packagedOutputManifestDirectory = `${await getBuildFolder(c)}${packagedManifestImages}`;
|
|
139
|
-
const appIconsDirectory = `${await getBuildFolder(c)}/project/appIcons`;
|
|
140
|
-
try {
|
|
141
|
-
(0, child_process_1.execSync)(`rm -rf ${hostedOutputDirectory}`);
|
|
142
|
-
(0, child_process_1.execSync)(`rm -rf ${packagedOutputDirectory}`);
|
|
143
|
-
(0, child_process_1.execSync)(`cp -r ${appIconsDirectory} ${hostedOutputDirectory}`);
|
|
144
|
-
(0, child_process_1.execSync)(`cp -r ${appIconsDirectory} ${packagedOutputDirectory}`);
|
|
145
|
-
(0, child_process_1.execSync)(`cp -r ${appIconsDirectory} ${hostedOutputManifestDirectory}`);
|
|
146
|
-
(0, child_process_1.execSync)(`cp -r ${appIconsDirectory} ${packagedOutputManifestDirectory}`);
|
|
147
|
-
(0, child_process_1.execSync)(`rm -rf ${appIconsDirectory}`);
|
|
148
|
-
}
|
|
149
|
-
catch {
|
|
150
|
-
console.log('Failed to replace the xbox icons');
|
|
151
|
-
}
|
|
152
|
-
}
|
package/fixDependency.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
|
|
3
|
-
const process = require('process');
|
|
4
|
-
const fs = require('fs').promises;
|
|
5
|
-
|
|
6
|
-
const main = async (deleteDependencies) => {
|
|
7
|
-
|
|
8
|
-
console.log("Fix dependencies")
|
|
9
|
-
|
|
10
|
-
if (deleteDependencies === undefined) return;
|
|
11
|
-
|
|
12
|
-
for (dependency of deleteDependencies) {
|
|
13
|
-
|
|
14
|
-
const packageLockFilePath = `${dependency.path}`;
|
|
15
|
-
|
|
16
|
-
console.log(packageLockFilePath);
|
|
17
|
-
try {
|
|
18
|
-
await fs.rm(packageLockFilePath, { recursive: true, force: true });
|
|
19
|
-
} catch {
|
|
20
|
-
console.log("error")
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
main(require('./package.json').deleteDependencies);
|
package/force-resolutions.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
|
|
3
|
-
const fs = require('fs').promises;
|
|
4
|
-
const path = require('path');
|
|
5
|
-
|
|
6
|
-
const main = async (resolutions) => {
|
|
7
|
-
|
|
8
|
-
if (resolutions === undefined) return;
|
|
9
|
-
|
|
10
|
-
const packageLockFilePath = path.resolve(__dirname, './package-lock.json');
|
|
11
|
-
|
|
12
|
-
for (const [name, version] of Object.entries(resolutions)) {
|
|
13
|
-
|
|
14
|
-
console.log(resolutions);
|
|
15
|
-
|
|
16
|
-
const packageLock = JSON.parse(await fs.readFile(packageLockFilePath));
|
|
17
|
-
const packagePaths = Object.keys(packageLock.packages);
|
|
18
|
-
const deletePaths = [];
|
|
19
|
-
|
|
20
|
-
for (const packagePath of packagePaths) {
|
|
21
|
-
if (packagePath.endsWith('/' + name)) {
|
|
22
|
-
if (packageLock.packages[packagePath].version !== version) {
|
|
23
|
-
//deletePaths.push(packagePath);
|
|
24
|
-
packageLock.packages[packagePath].version = version;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (packageLock.packages[packagePath].dependencies !== undefined) {
|
|
29
|
-
|
|
30
|
-
const dependencies = packageLock.packages[packagePath].dependencies;
|
|
31
|
-
const keys = Object.keys(dependencies);
|
|
32
|
-
console.log(dependencies)
|
|
33
|
-
for (const key of keys) {
|
|
34
|
-
const dependency = dependencies[key];
|
|
35
|
-
console.log(dependency)
|
|
36
|
-
if (key === name) {
|
|
37
|
-
let dependency = dependencies[key];
|
|
38
|
-
if (dependency !== version) {
|
|
39
|
-
delete dependencies[key];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
for (const packagePath of deletePaths) {
|
|
47
|
-
for (const deletePath of deletePaths) {
|
|
48
|
-
if (packagePath === deletePath || packagePath.startsWith(deletePath + '/')) {
|
|
49
|
-
// eslint-disable-next-line fp/no-delete
|
|
50
|
-
delete packageLock.packages[packagePath];
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
await fs.writeFile(
|
|
56
|
-
packageLockFilePath,
|
|
57
|
-
JSON.stringify(packageLock, null, ' '),
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
main(require('../../package.json').resolutions);
|