@24i/smartapps-bigscreen-rnv-build-engine 0.12.1-alpha.1671 → 0.12.1-alpha.1679
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/__tests__/engine.spec.js +3 -3
- package/dist/src/engine.js +8 -8
- package/dist/src/sdks/index.js +1 -3
- package/dist/src/sdks/sdk-tizen/sdkTizen.js +8 -8
- package/dist/src/sdks/sdk-webos/sdkWebos.js +8 -8
- package/dist/src/sdks/sdk-webpack/sdkWebpack.js +3 -3
- package/dist/src/tasks/task.rnv.build.js +1 -4
- package/dist/src/tasks/task.rnv.start.js +3 -3
- package/dist/templates/platforms/_shared/template.js +2 -2
- package/dist/templates/platforms/_shared/webpack.base.js +1 -0
- package/package.json +8 -17
- package/dist/src/sdks/sdk-xbox/index.js +0 -13
- package/dist/src/sdks/sdk-xbox/sdkXbox.js +0 -147
- package/fixDependency.js +0 -25
- package/force-resolutions.js +0 -62
|
@@ -31,9 +31,9 @@ describe('engine config', () => {
|
|
|
31
31
|
describe('platform properties', () => {
|
|
32
32
|
it('has defined platform specific file extensions for each platform', () => {
|
|
33
33
|
Object.values(constants_1.Platforms).forEach((platform) => {
|
|
34
|
-
const {
|
|
35
|
-
expect(
|
|
36
|
-
const customExtensions =
|
|
34
|
+
const { extensions } = engine_1.default.platforms[platform];
|
|
35
|
+
expect(extensions).toBeInstanceOf(Array);
|
|
36
|
+
const customExtensions = extensions
|
|
37
37
|
.filter((extension) => !configuredFileExtensions.includes(extension));
|
|
38
38
|
expect(customExtensions.length)
|
|
39
39
|
.toBeGreaterThanOrEqual(configuredFileExtensions.length);
|
package/dist/src/engine.js
CHANGED
|
@@ -48,42 +48,42 @@ exports.default = {
|
|
|
48
48
|
ejectPlatform: null,
|
|
49
49
|
platforms: {
|
|
50
50
|
[constants_1.Platforms.ENTONE]: {
|
|
51
|
-
|
|
51
|
+
extensions: generateEngineExtensions(['entone']),
|
|
52
52
|
defaultPort: 8094,
|
|
53
53
|
isWebHosted: true,
|
|
54
54
|
},
|
|
55
55
|
[constants_1.Platforms.HBBTV]: {
|
|
56
|
-
|
|
56
|
+
extensions: generateEngineExtensions(['hbbtv.tv']),
|
|
57
57
|
defaultPort: 8095,
|
|
58
58
|
isWebHosted: true,
|
|
59
59
|
},
|
|
60
60
|
[constants_1.Platforms.KREATV]: {
|
|
61
|
-
|
|
61
|
+
extensions: generateEngineExtensions(['kreatv']),
|
|
62
62
|
defaultPort: 8096,
|
|
63
63
|
isWebHosted: true,
|
|
64
64
|
},
|
|
65
65
|
[constants_1.Platforms.SAPHI]: {
|
|
66
|
-
|
|
66
|
+
extensions: generateEngineExtensions(['saphi.tv']),
|
|
67
67
|
defaultPort: 8097,
|
|
68
68
|
isWebHosted: true,
|
|
69
69
|
},
|
|
70
70
|
[constants_1.Platforms.TIZEN]: {
|
|
71
|
-
|
|
71
|
+
extensions: generateEngineExtensions(['tizen.tv']),
|
|
72
72
|
defaultPort: 8087,
|
|
73
73
|
isWebHosted: true,
|
|
74
74
|
},
|
|
75
75
|
[constants_1.Platforms.WEBOS]: {
|
|
76
|
-
|
|
76
|
+
extensions: generateEngineExtensions(['webos.tv']),
|
|
77
77
|
defaultPort: 8088,
|
|
78
78
|
isWebHosted: true,
|
|
79
79
|
},
|
|
80
80
|
[constants_1.Platforms.WEBTV]: {
|
|
81
|
-
|
|
81
|
+
extensions: generateEngineExtensions(['webtv']),
|
|
82
82
|
defaultPort: 8080,
|
|
83
83
|
isWebHosted: true,
|
|
84
84
|
},
|
|
85
85
|
[constants_1.Platforms.XBOX]: {
|
|
86
|
-
|
|
86
|
+
extensions: generateEngineExtensions(['xbox']),
|
|
87
87
|
defaultPort: 8098,
|
|
88
88
|
isWebHosted: true,
|
|
89
89
|
},
|
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:
|
|
@@ -26,6 +26,7 @@ const os = __importStar(require("os"));
|
|
|
26
26
|
const semver = __importStar(require("semver"));
|
|
27
27
|
const child_process_1 = require("child_process");
|
|
28
28
|
const rnv_1 = require("rnv");
|
|
29
|
+
const sdk_webpack_1 = require("@rnv/sdk-webpack");
|
|
29
30
|
const sdk_utils_1 = require("../sdk-utils");
|
|
30
31
|
const constants_1 = require("../../constants");
|
|
31
32
|
const { execCLI } = rnv_1.Exec;
|
|
@@ -34,7 +35,6 @@ const { getPlatformProjectDir, getAppVersion, getConfigProp, checkPortInUse, con
|
|
|
34
35
|
const { chalk, logTask, logDebug, logError, logSuccess, logWarning, logInfo, } = rnv_1.Logger;
|
|
35
36
|
const { isPlatformActive } = rnv_1.PlatformManager;
|
|
36
37
|
const { writeCleanFile, fsExistsSync, updateObjectSync } = rnv_1.FileUtils;
|
|
37
|
-
const { buildCoreWebpackProject, runWebpackServer, configureCoreWebProject, waitForWebpack, } = rnv_1.WebpackUtils;
|
|
38
38
|
const { copyAssetsFolder, copyBuildsFolder } = rnv_1.ProjectManager;
|
|
39
39
|
const { runTizenSimOrDevice, createDevelopTizenCertificate, DEFAULT_CERTIFICATE_NAME, DEFAULT_SECURITY_PROFILE_NAME, } = rnv_1.SDKManager.Tizen;
|
|
40
40
|
const DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION = `${DEFAULT_CERTIFICATE_NAME}.p12`;
|
|
@@ -79,7 +79,7 @@ const runTizen = async (c, target) => {
|
|
|
79
79
|
return;
|
|
80
80
|
const bundleAssets = getConfigProp(c, platform, 'bundleAssets') === true;
|
|
81
81
|
if (bundleAssets) {
|
|
82
|
-
await buildCoreWebpackProject(c);
|
|
82
|
+
await (0, sdk_webpack_1.buildCoreWebpackProject)(c);
|
|
83
83
|
await handleRunTizenSimOrDevice(c);
|
|
84
84
|
}
|
|
85
85
|
else {
|
|
@@ -88,18 +88,18 @@ const runTizen = async (c, target) => {
|
|
|
88
88
|
const isWeinreEnabled = isDebuggerEnabledForPlatform && !bundleAssets && !hosted;
|
|
89
89
|
if (!isPortActive) {
|
|
90
90
|
logInfo(`Your ${chalk().white(platform)} devServer at port ${chalk().white(c.runtime.port)} is not running. Starting it up for you...`);
|
|
91
|
-
waitForWebpack(c)
|
|
91
|
+
(0, sdk_webpack_1.waitForWebpack)(c)
|
|
92
92
|
.then(() => handleRunTizenSimOrDevice(c))
|
|
93
93
|
.catch(logError);
|
|
94
|
-
await runWebpackServer(c, isWeinreEnabled);
|
|
94
|
+
await (0, sdk_webpack_1.runWebpackServer)(c, isWeinreEnabled);
|
|
95
95
|
}
|
|
96
96
|
else {
|
|
97
97
|
const resetCompleted = await confirmActiveBundler(c);
|
|
98
98
|
if (resetCompleted) {
|
|
99
|
-
waitForWebpack(c)
|
|
99
|
+
(0, sdk_webpack_1.waitForWebpack)(c)
|
|
100
100
|
.then(() => handleRunTizenSimOrDevice(c))
|
|
101
101
|
.catch(logError);
|
|
102
|
-
await runWebpackServer(c, isWeinreEnabled);
|
|
102
|
+
await (0, sdk_webpack_1.runWebpackServer)(c, isWeinreEnabled);
|
|
103
103
|
}
|
|
104
104
|
else {
|
|
105
105
|
await handleRunTizenSimOrDevice(c);
|
|
@@ -110,7 +110,7 @@ const runTizen = async (c, target) => {
|
|
|
110
110
|
exports.runTizen = runTizen;
|
|
111
111
|
const buildTizenProject = async (c) => {
|
|
112
112
|
logTask('buildTizenProject');
|
|
113
|
-
await buildCoreWebpackProject(c);
|
|
113
|
+
await (0, sdk_webpack_1.buildCoreWebpackProject)(c);
|
|
114
114
|
if (!c.program.hosted) {
|
|
115
115
|
const { buildConfig } = c;
|
|
116
116
|
const platformConfig = buildConfig.platforms[constants_1.Platforms.TIZEN];
|
|
@@ -155,7 +155,7 @@ const configureTizenProject = async (c) => {
|
|
|
155
155
|
await configureTizenGlobal(c);
|
|
156
156
|
}
|
|
157
157
|
await copyAssetsFolder(c, platform);
|
|
158
|
-
await configureCoreWebProject(c);
|
|
158
|
+
await (0, sdk_webpack_1.configureCoreWebProject)(c);
|
|
159
159
|
await configureProject(c);
|
|
160
160
|
copyBuildsFolder(c, platform);
|
|
161
161
|
};
|
|
@@ -24,11 +24,11 @@ const fs = __importStar(require("fs"));
|
|
|
24
24
|
const path = __importStar(require("path"));
|
|
25
25
|
const os_1 = require("os");
|
|
26
26
|
const rnv_1 = require("rnv");
|
|
27
|
+
const sdk_webpack_1 = require("@rnv/sdk-webpack");
|
|
27
28
|
const sdk_utils_1 = require("../sdk-utils");
|
|
28
29
|
const { writeCleanFile } = rnv_1.FileUtils;
|
|
29
30
|
const { execCLI } = rnv_1.Exec;
|
|
30
31
|
const { getPlatformProjectDir, getTemplateProjectDir, getPlatformBuildDir, getConfigProp, checkPortInUse, confirmActiveBundler, } = rnv_1.Common;
|
|
31
|
-
const { buildCoreWebpackProject, runWebpackServer, configureCoreWebProject, waitForWebpack, } = rnv_1.WebpackUtils;
|
|
32
32
|
const { isPlatformActive } = rnv_1.PlatformManager;
|
|
33
33
|
const { chalk, logTask, logInfo, logSuccess, logError } = rnv_1.Logger;
|
|
34
34
|
const { copyBuildsFolder, copyAssetsFolder } = rnv_1.ProjectManager;
|
|
@@ -51,7 +51,7 @@ const runWebOS = async (c) => {
|
|
|
51
51
|
return;
|
|
52
52
|
const bundleAssets = getConfigProp(c, platform, 'bundleAssets') === true;
|
|
53
53
|
if (bundleAssets) {
|
|
54
|
-
await buildCoreWebpackProject(c);
|
|
54
|
+
await (0, sdk_webpack_1.buildCoreWebpackProject)(c);
|
|
55
55
|
await runWebosSimOrDevice(c);
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
@@ -60,18 +60,18 @@ const runWebOS = async (c) => {
|
|
|
60
60
|
const isWeinreEnabled = isDebuggerEnabledForPlatform && !bundleAssets && !hosted;
|
|
61
61
|
if (!isPortActive) {
|
|
62
62
|
logInfo(`Your ${chalk().white(platform)} devServer at port ${chalk().white(c.runtime.port)} is not running. Starting it up for you...`);
|
|
63
|
-
waitForWebpack(c)
|
|
63
|
+
(0, sdk_webpack_1.waitForWebpack)(c)
|
|
64
64
|
.then(() => runWebosSimOrDevice(c))
|
|
65
65
|
.catch(logError);
|
|
66
|
-
await runWebpackServer(c, isWeinreEnabled);
|
|
66
|
+
await (0, sdk_webpack_1.runWebpackServer)(c, isWeinreEnabled);
|
|
67
67
|
}
|
|
68
68
|
else {
|
|
69
69
|
const resetCompleted = await confirmActiveBundler(c);
|
|
70
70
|
if (resetCompleted) {
|
|
71
|
-
waitForWebpack(c)
|
|
71
|
+
(0, sdk_webpack_1.waitForWebpack)(c)
|
|
72
72
|
.then(() => runWebosSimOrDevice(c))
|
|
73
73
|
.catch(logError);
|
|
74
|
-
await runWebpackServer(c, isWeinreEnabled);
|
|
74
|
+
await (0, sdk_webpack_1.runWebpackServer)(c, isWeinreEnabled);
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
77
|
await runWebosSimOrDevice(c);
|
|
@@ -82,7 +82,7 @@ const runWebOS = async (c) => {
|
|
|
82
82
|
exports.runWebOS = runWebOS;
|
|
83
83
|
const buildWebOSProject = async (c) => {
|
|
84
84
|
logTask('buildWebOSProject');
|
|
85
|
-
await buildCoreWebpackProject(c);
|
|
85
|
+
await (0, sdk_webpack_1.buildCoreWebpackProject)(c);
|
|
86
86
|
if (!c.program.hosted) {
|
|
87
87
|
const tDir = getPlatformProjectDir(c);
|
|
88
88
|
const tOut = path.join(getPlatformBuildDir(c), 'output');
|
|
@@ -110,7 +110,7 @@ const configureWebOSProject = async (c) => {
|
|
|
110
110
|
if (!isPlatformActive(c, platform))
|
|
111
111
|
return;
|
|
112
112
|
await copyAssetsFolder(c, platform);
|
|
113
|
-
await configureCoreWebProject(c);
|
|
113
|
+
await (0, sdk_webpack_1.configureCoreWebProject)(c);
|
|
114
114
|
await configureProject(c);
|
|
115
115
|
await copyBuildsFolder(c, platform);
|
|
116
116
|
};
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.exportWeb = exports.deployWeb = exports.configureWebProject = exports.buildWeb = void 0;
|
|
4
4
|
const rnv_1 = require("rnv");
|
|
5
|
+
const sdk_webpack_1 = require("@rnv/sdk-webpack");
|
|
5
6
|
const { getPlatformProjectDir } = rnv_1.Common;
|
|
6
7
|
const { isPlatformActive } = rnv_1.PlatformManager;
|
|
7
8
|
const { logTask } = rnv_1.Logger;
|
|
8
9
|
const { copyBuildsFolder, copyAssetsFolder } = rnv_1.ProjectManager;
|
|
9
|
-
const
|
|
10
|
-
const buildWeb = async (c) => buildCoreWebpackProject(c);
|
|
10
|
+
const buildWeb = async (c) => (0, sdk_webpack_1.buildCoreWebpackProject)(c);
|
|
11
11
|
exports.buildWeb = buildWeb;
|
|
12
12
|
const configureWebProject = async (c) => {
|
|
13
13
|
logTask('configureWebProject');
|
|
@@ -16,7 +16,7 @@ const configureWebProject = async (c) => {
|
|
|
16
16
|
if (!isPlatformActive(c, platform))
|
|
17
17
|
return;
|
|
18
18
|
await copyAssetsFolder(c, platform);
|
|
19
|
-
await configureCoreWebProject(c);
|
|
19
|
+
await (0, sdk_webpack_1.configureCoreWebProject)(c);
|
|
20
20
|
copyBuildsFolder(c, platform);
|
|
21
21
|
};
|
|
22
22
|
exports.configureWebProject = configureWebProject;
|
|
@@ -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);
|
|
@@ -22,12 +22,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.customRnvStartTask = void 0;
|
|
23
23
|
const open = __importStar(require("better-opn"));
|
|
24
24
|
const rnv_1 = require("rnv");
|
|
25
|
+
const sdk_webpack_1 = require("@rnv/sdk-webpack");
|
|
25
26
|
const constants_1 = require("../constants");
|
|
26
27
|
const { getConfigProp } = rnv_1.Common;
|
|
27
28
|
const { logErrorPlatform } = rnv_1.PlatformManager;
|
|
28
29
|
const { logTask, logError } = rnv_1.Logger;
|
|
29
30
|
const { TASK_START, TASK_CONFIGURE, REMOTE_DEBUGGER_ENABLED_PLATFORMS, PARAMS } = rnv_1.Constants;
|
|
30
|
-
const { runWebpackServer, waitForWebpack } = rnv_1.WebpackUtils;
|
|
31
31
|
const { executeTask } = rnv_1.TaskManager;
|
|
32
32
|
const startFn = async (c, parentTask, originTask) => {
|
|
33
33
|
const { platform, runtime, program } = c;
|
|
@@ -38,7 +38,7 @@ const startFn = async (c, parentTask, originTask) => {
|
|
|
38
38
|
await executeTask(c, TASK_CONFIGURE, TASK_START, originTask);
|
|
39
39
|
}
|
|
40
40
|
if (hosted) {
|
|
41
|
-
waitForWebpack(c)
|
|
41
|
+
(0, sdk_webpack_1.waitForWebpack)(c)
|
|
42
42
|
.then(() => open(`http://${c.runtime.localhost}:${port}/`))
|
|
43
43
|
.catch(logError);
|
|
44
44
|
}
|
|
@@ -54,7 +54,7 @@ const startFn = async (c, parentTask, originTask) => {
|
|
|
54
54
|
case constants_1.Platforms.WEBOS:
|
|
55
55
|
case constants_1.Platforms.WEBTV:
|
|
56
56
|
case constants_1.Platforms.XBOX:
|
|
57
|
-
return runWebpackServer(c, isWeinreEnabled);
|
|
57
|
+
return (0, sdk_webpack_1.runWebpackServer)(c, isWeinreEnabled);
|
|
58
58
|
default:
|
|
59
59
|
if (hosted) {
|
|
60
60
|
return logError('This platform does not support hosted mode', true);
|
|
@@ -6,7 +6,7 @@ const DEFAULT_CONFIG = {
|
|
|
6
6
|
docType: '<!DOCTYPE html>',
|
|
7
7
|
htmlTag: '<html lang="en">',
|
|
8
8
|
contentType: '',
|
|
9
|
-
metaTags: '<meta name="viewport" content="width=1280"
|
|
9
|
+
metaTags: '<meta name="viewport" content="width=1280" />',
|
|
10
10
|
};
|
|
11
11
|
const removeBlankLines = (string) => string.replace(/^\s*\n/gm, '');
|
|
12
12
|
const constructCustomHtmlTemplate = (options) => {
|
|
@@ -14,7 +14,7 @@ const constructCustomHtmlTemplate = (options) => {
|
|
|
14
14
|
const { docType, htmlTag, metaTags, headPrepend, headAppend, bodyPrepend, bodyAppend, } = options;
|
|
15
15
|
options.docType = custom.docType || docType || '';
|
|
16
16
|
options.htmlTag = custom.htmlTag || htmlTag || '';
|
|
17
|
-
options.metaTags = (0, joinStrings_1.joinStrings)(metaTags, custom.metaTags);
|
|
17
|
+
options.metaTags = (0, joinStrings_1.joinStrings)(metaTags, custom.metaTags, '<meta charset="utf-8" />');
|
|
18
18
|
options.headPrepend = (0, joinStrings_1.joinStrings)(headPrepend, custom.headPrepend);
|
|
19
19
|
options.headAppend = (0, joinStrings_1.joinStrings)(headAppend, custom.headAppend);
|
|
20
20
|
options.bodyPrepend = (0, joinStrings_1.joinStrings)(bodyPrepend, custom.bodyPrepend);
|
|
@@ -120,6 +120,7 @@ function generateConfig(config) {
|
|
|
120
120
|
'@24i/smartapps-bigscreen-device': config.environment === 'production'
|
|
121
121
|
? '@24i/smartapps-bigscreen-device'
|
|
122
122
|
: '@24i/smartapps-bigscreen-device/resolver',
|
|
123
|
+
'@rnv/sdk-webpack': '@rnv/sdk-webpack/dist/index.js',
|
|
123
124
|
};
|
|
124
125
|
const { moduleAliases } = config;
|
|
125
126
|
if (moduleAliases) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@24i/smartapps-bigscreen-rnv-build-engine",
|
|
3
|
-
"version": "0.12.1-alpha.
|
|
3
|
+
"version": "0.12.1-alpha.1679+83849247",
|
|
4
4
|
"description": "Package with build engine for SmartApps BIGscreen projects...",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,31 +16,22 @@
|
|
|
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",
|
|
31
|
-
"@types/node": "
|
|
24
|
+
"@types/node": "17.0.7",
|
|
32
25
|
"@types/semver": "7.3.9",
|
|
33
|
-
"@types/ssh2": "0.5.
|
|
26
|
+
"@types/ssh2": "0.5.50",
|
|
34
27
|
"@types/tapable": "1.0.6",
|
|
35
28
|
"@types/webpack": "4.41.26",
|
|
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": "*",
|
|
34
|
+
"@rnv/sdk-webpack": "0.34.0-alpha.8",
|
|
44
35
|
"assign-deep": "^1.0.1",
|
|
45
36
|
"core-js": "3.15.2",
|
|
46
37
|
"coveralls": "3.1.1",
|
|
@@ -57,8 +48,8 @@
|
|
|
57
48
|
"ora": "5.4.1",
|
|
58
49
|
"raf": "3.4.1",
|
|
59
50
|
"regenerator-runtime": "0.13.7",
|
|
60
|
-
"renative-template-blank": "0.
|
|
61
|
-
"rnv": "0.
|
|
51
|
+
"renative-template-blank": "0.34.0-alpha.8",
|
|
52
|
+
"rnv": "0.34.0-alpha.8",
|
|
62
53
|
"sass": "1.37.0",
|
|
63
54
|
"sass-loader": "10.1.1",
|
|
64
55
|
"source-map-loader": "1.1.3",
|
|
@@ -72,5 +63,5 @@
|
|
|
72
63
|
"keywords": [],
|
|
73
64
|
"author": "24i",
|
|
74
65
|
"license": "ISC",
|
|
75
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "83849247a2ccb992e52a8a2822566ce990197718"
|
|
76
67
|
}
|
|
@@ -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,147 +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');
|
|
12
|
-
const hostedAppOutputPath = '/output/hosted';
|
|
13
|
-
const packagedAppOutputPath = '/output/packaged';
|
|
14
|
-
const packagedAppSrcDestination = '/output/packaged/windows10/source/src';
|
|
15
|
-
const appSourcePath = '/project/public';
|
|
16
|
-
const packagedAppEntryUrl = 'src/index.html';
|
|
17
|
-
const wrapperConfigPath = '/wrapperConfig.json';
|
|
18
|
-
const hostedSourceImages = '/output/hosted/windows10/source/images';
|
|
19
|
-
const packagedSourceImages = '/output/packaged/windows10/source/images';
|
|
20
|
-
const hostedManifestImages = '/output/hosted/windows10/manifest/images';
|
|
21
|
-
const packagedManifestImages = '/output/packaged/windows10/manifest/images';
|
|
22
|
-
const identityNamePlaceholder = 'INSERT-YOUR-PACKAGE-IDENTITY-NAME-HERE';
|
|
23
|
-
const identityPublisherPlaceholder = 'INSERT-YOUR-PACKAGE-IDENTITY-PUBLISHER-HERE';
|
|
24
|
-
const publisherDisplayNamePlaceholder = 'INSERT-YOUR-PACKAGE-PROPERTIES-PUBLISHERDISPLAYNAME-HERE';
|
|
25
|
-
class Manifest {
|
|
26
|
-
content = { start_url: '', short_name: '', theme_color: 'white' };
|
|
27
|
-
format = 'w3c';
|
|
28
|
-
}
|
|
29
|
-
const buildXboxProject = async (c) => {
|
|
30
|
-
logTask('buildXboxProject');
|
|
31
|
-
await buildCoreWebpackProject(c);
|
|
32
|
-
const outputDirectory = `${await getBuildFolder(c)}/output`;
|
|
33
|
-
(0, child_process_1.execSync)(`rm -rf ${outputDirectory}`);
|
|
34
|
-
await createHostedApplication(c);
|
|
35
|
-
await createPackagedApplication(c);
|
|
36
|
-
await replacePublisherId(c, `${await getBuildFolder(c)}${hostedAppOutputPath}`);
|
|
37
|
-
await replacePublisherId(c, `${await getBuildFolder(c)}${packagedAppOutputPath}`);
|
|
38
|
-
await replaceImages(c);
|
|
39
|
-
await zipOutput(c);
|
|
40
|
-
};
|
|
41
|
-
exports.buildXboxProject = buildXboxProject;
|
|
42
|
-
const getHostedAppEntryUrl = (c) => {
|
|
43
|
-
const deployLocations = (0, resolvers_1.resolveDeployLocations)(c);
|
|
44
|
-
const keys = Object.keys(deployLocations.versions);
|
|
45
|
-
let url;
|
|
46
|
-
if (keys !== null && keys.length > 0) {
|
|
47
|
-
const version = keys[0];
|
|
48
|
-
if (version !== null) {
|
|
49
|
-
url = deployLocations.versions[version].platforms.xbox?.animated_720?.indexUrl;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return url;
|
|
53
|
-
};
|
|
54
|
-
async function zipOutput(c) {
|
|
55
|
-
logTask('zipOutput');
|
|
56
|
-
const defaultZipFileName = `${c.platform}_${c.runtime.appId}.zip`;
|
|
57
|
-
const fileName = (0, resolvers_1.resolveBuildFileName)(c) || defaultZipFileName;
|
|
58
|
-
const outputDirectory = `${await getBuildFolder(c)}/output`;
|
|
59
|
-
const tmpOutputDirectory = `${await getBuildFolder(c)}/tmpOutput`;
|
|
60
|
-
(0, child_process_1.execSync)(`mkdir ${tmpOutputDirectory}`);
|
|
61
|
-
(0, child_process_1.execSync)(`cp -r ${outputDirectory} ${tmpOutputDirectory}`);
|
|
62
|
-
(0, child_process_1.execSync)(`rm -rf ${outputDirectory}`);
|
|
63
|
-
(0, child_process_1.execSync)(`mkdir ${outputDirectory}`);
|
|
64
|
-
(0, child_process_1.execSync)(`zip -r ${outputDirectory}/${fileName} *`, { cwd: `${tmpOutputDirectory}` });
|
|
65
|
-
(0, child_process_1.execSync)(`rm -rf ${tmpOutputDirectory}`);
|
|
66
|
-
}
|
|
67
|
-
const createVSSolution = async (c, outputPath, manifest) => {
|
|
68
|
-
logTask('createVSSolution');
|
|
69
|
-
try {
|
|
70
|
-
manifest.content.short_name = c.buildConfig.common.appName;
|
|
71
|
-
const platform = new projectBuilder.Platform('package', ['windows10']);
|
|
72
|
-
await platform.create(manifest, outputPath, ['windows10'], '');
|
|
73
|
-
}
|
|
74
|
-
catch { }
|
|
75
|
-
};
|
|
76
|
-
async function createHostedApplication(c) {
|
|
77
|
-
logTask('createHostedApplication');
|
|
78
|
-
const manifest = new Manifest();
|
|
79
|
-
manifest.content.start_url = getHostedAppEntryUrl(c);
|
|
80
|
-
await createVSSolution(c, `${await getBuildFolder(c)}${hostedAppOutputPath}`, manifest);
|
|
81
|
-
}
|
|
82
|
-
async function createPackagedApplication(c) {
|
|
83
|
-
logTask('createPackagedApplication');
|
|
84
|
-
const manifest = new Manifest();
|
|
85
|
-
manifest.content.start_url = packagedAppEntryUrl ?? '';
|
|
86
|
-
const sourceDir = `${await getBuildFolder(c)}${appSourcePath}`;
|
|
87
|
-
const destinationDirectory = `${await getBuildFolder(c)}${packagedAppSrcDestination}`;
|
|
88
|
-
await createVSSolution(c, `${await getBuildFolder(c)}${packagedAppOutputPath}`, manifest);
|
|
89
|
-
(0, child_process_1.execSync)(`cp -r ${sourceDir} ${destinationDirectory}`);
|
|
90
|
-
}
|
|
91
|
-
function getBuildFolder(c) {
|
|
92
|
-
const sourceDir = `${rnv_1.Common.getPlatformBuildDir(c)}`;
|
|
93
|
-
return sourceDir;
|
|
94
|
-
}
|
|
95
|
-
async function replacePublisherId(c, basePath) {
|
|
96
|
-
logTask('replacePublisherId');
|
|
97
|
-
const output = `${basePath}/windows10/manifest/appxmanifest.xml`;
|
|
98
|
-
const configPath = `${await getBuildFolder(c)}${wrapperConfigPath}`;
|
|
99
|
-
let appxmanifest = null;
|
|
100
|
-
let identityName = null;
|
|
101
|
-
let identityPublisher = null;
|
|
102
|
-
let publisherDisplayName = null;
|
|
103
|
-
return fs.readFile(configPath).then((data) => {
|
|
104
|
-
const config = JSON.parse(data.toString());
|
|
105
|
-
({ identityName } = config);
|
|
106
|
-
({ identityPublisher } = config);
|
|
107
|
-
({ publisherDisplayName } = config);
|
|
108
|
-
}).then(() => {
|
|
109
|
-
return fs.readFile(output).then((data) => {
|
|
110
|
-
appxmanifest = data.toString();
|
|
111
|
-
if (identityName !== null
|
|
112
|
-
&& identityPublisher !== null
|
|
113
|
-
&& publisherDisplayName !== null) {
|
|
114
|
-
appxmanifest = appxmanifest.replace(identityNamePlaceholder, identityName)
|
|
115
|
-
.replace(identityPublisherPlaceholder, identityPublisher)
|
|
116
|
-
.replace(publisherDisplayNamePlaceholder, publisherDisplayName);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}).then(() => {
|
|
120
|
-
return fs.writeFile(output, appxmanifest ?? '');
|
|
121
|
-
})
|
|
122
|
-
.catch(() => {
|
|
123
|
-
const errorMessage = 'Failed to modify the xbox appxmanifest.xml';
|
|
124
|
-
console.log(errorMessage);
|
|
125
|
-
return errorMessage;
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
async function replaceImages(c) {
|
|
129
|
-
logTask('replaceImages');
|
|
130
|
-
const hostedOutputDirectory = `${await getBuildFolder(c)}${hostedSourceImages}`;
|
|
131
|
-
const packagedOutputDirectory = `${await getBuildFolder(c)}${packagedSourceImages}`;
|
|
132
|
-
const hostedOutputManifestDirectory = `${await getBuildFolder(c)}${hostedManifestImages}`;
|
|
133
|
-
const packagedOutputManifestDirectory = `${await getBuildFolder(c)}${packagedManifestImages}`;
|
|
134
|
-
const appIconsDirectory = `${await getBuildFolder(c)}/project/appIcons`;
|
|
135
|
-
try {
|
|
136
|
-
(0, child_process_1.execSync)(`rm -rf ${hostedOutputDirectory}`);
|
|
137
|
-
(0, child_process_1.execSync)(`rm -rf ${packagedOutputDirectory}`);
|
|
138
|
-
(0, child_process_1.execSync)(`cp -r ${appIconsDirectory} ${hostedOutputDirectory}`);
|
|
139
|
-
(0, child_process_1.execSync)(`cp -r ${appIconsDirectory} ${packagedOutputDirectory}`);
|
|
140
|
-
(0, child_process_1.execSync)(`cp -r ${appIconsDirectory} ${hostedOutputManifestDirectory}`);
|
|
141
|
-
(0, child_process_1.execSync)(`cp -r ${appIconsDirectory} ${packagedOutputManifestDirectory}`);
|
|
142
|
-
(0, child_process_1.execSync)(`rm -rf ${appIconsDirectory}`);
|
|
143
|
-
}
|
|
144
|
-
catch {
|
|
145
|
-
console.log('Failed to replace the xbox icons');
|
|
146
|
-
}
|
|
147
|
-
}
|
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);
|