@24i/smartapps-bigscreen-rnv-build-engine 0.13.1-alpha.1774 → 0.13.1-alpha.1780
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.
|
@@ -6,8 +6,8 @@ const sdk_webpack_1 = require("@rnv/sdk-webpack");
|
|
|
6
6
|
const child_process_1 = require("child_process");
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
8
|
const manifoldjs_windows10_1 = require("manifoldjs-windows10");
|
|
9
|
+
const xml2js_1 = require("xml2js");
|
|
9
10
|
const resolvers_1 = require("../../resolvers");
|
|
10
|
-
const xml2js = require('xml2js');
|
|
11
11
|
const fs = fs_1.promises;
|
|
12
12
|
const { logTask } = rnv_1.Logger;
|
|
13
13
|
const hostedAppOutputPath = '/output/hosted';
|
|
@@ -22,6 +22,7 @@ const hostedSourceImages = '/output/hosted/windows10/source/images';
|
|
|
22
22
|
const packagedSourceImages = '/output/packaged/windows10/source/images';
|
|
23
23
|
const hostedManifestImages = '/output/hosted/windows10/manifest/images';
|
|
24
24
|
const packagedManifestImages = '/output/packaged/windows10/manifest/images';
|
|
25
|
+
const directionalNavPath = '/node_modules/@24i/smartapps-bigscreen-driver-xbox/__external__/winjs/directionalnavigation-1.0.0.0.js';
|
|
25
26
|
const identityNamePlaceholder = 'INSERT-YOUR-PACKAGE-IDENTITY-NAME-HERE';
|
|
26
27
|
const identityPublisherPlaceholder = 'INSERT-YOUR-PACKAGE-IDENTITY-PUBLISHER-HERE';
|
|
27
28
|
const publisherDisplayNamePlaceholder = 'INSERT-YOUR-PACKAGE-PROPERTIES-PUBLISHERDISPLAYNAME-HERE';
|
|
@@ -82,27 +83,17 @@ const createHostedApplication = async (c) => {
|
|
|
82
83
|
manifest.content.start_url = getHostedAppEntryUrl(c);
|
|
83
84
|
await createVSSolution(c, `${getBuildFolder(c)}${hostedAppOutputPath}`, manifest);
|
|
84
85
|
};
|
|
85
|
-
const
|
|
86
|
-
logTask('createPackagedApplication');
|
|
87
|
-
const manifest = new Manifest();
|
|
88
|
-
manifest.content.start_url = packagedAppEntryUrl;
|
|
89
|
-
const sourceDir = `${getBuildFolder(c)}${appSourcePath}`;
|
|
90
|
-
const destinationDirectory = `${getBuildFolder(c)}${packagedAppSrcDestination}`;
|
|
91
|
-
await createVSSolution(c, `${getBuildFolder(c)}${packagedAppOutputPath}`, manifest);
|
|
92
|
-
(0, child_process_1.execSync)(`cp -r ${sourceDir} ${destinationDirectory}`);
|
|
93
|
-
await addPackagedFiles(c);
|
|
94
|
-
};
|
|
95
|
-
const readContent = async (c, path) => {
|
|
86
|
+
const readContent = (c, path) => {
|
|
96
87
|
logTask('readContent');
|
|
97
88
|
const srcDirectory = `${getBuildFolder(c)}${packagedAppSource}/${path}`;
|
|
98
89
|
let content = [];
|
|
99
90
|
try {
|
|
100
|
-
const res =
|
|
91
|
+
const res = (0, fs_1.readdirSync)(srcDirectory, { withFileTypes: true });
|
|
101
92
|
for (let i = 0; i < res.length; i++) {
|
|
102
93
|
const file = res[i];
|
|
103
94
|
const fileNameWithPath = `${path}/${file.name}`;
|
|
104
95
|
if (file.isDirectory()) {
|
|
105
|
-
const subdirectoryContent =
|
|
96
|
+
const subdirectoryContent = readContent(c, fileNameWithPath);
|
|
106
97
|
content = content.concat(subdirectoryContent);
|
|
107
98
|
}
|
|
108
99
|
else {
|
|
@@ -120,13 +111,13 @@ const addPackagedFiles = async (c) => {
|
|
|
120
111
|
const destinationDirectory = `${getBuildFolder(c)}${packagedAppSource}/App.jsproj`;
|
|
121
112
|
try {
|
|
122
113
|
let xmlString = await fs.readFile(destinationDirectory, 'utf-8');
|
|
123
|
-
const xmlObject = await
|
|
124
|
-
const srcDirectoryContent =
|
|
114
|
+
const xmlObject = await (0, xml2js_1.parseStringPromise)(xmlString);
|
|
115
|
+
const srcDirectoryContent = readContent(c, 'src');
|
|
125
116
|
srcDirectoryContent.forEach((element) => {
|
|
126
117
|
const contentElement = { $: { Include: element } };
|
|
127
118
|
xmlObject.Project.ItemGroup[1].Content.push(contentElement);
|
|
128
119
|
});
|
|
129
|
-
const builder = new
|
|
120
|
+
const builder = new xml2js_1.Builder();
|
|
130
121
|
xmlString = builder.buildObject(xmlObject);
|
|
131
122
|
await fs.writeFile(destinationDirectory, xmlString);
|
|
132
123
|
}
|
|
@@ -134,6 +125,16 @@ const addPackagedFiles = async (c) => {
|
|
|
134
125
|
throw new Error('Failed to parse update App.jsproj project file');
|
|
135
126
|
}
|
|
136
127
|
};
|
|
128
|
+
const createPackagedApplication = async (c) => {
|
|
129
|
+
logTask('createPackagedApplication');
|
|
130
|
+
const manifest = new Manifest();
|
|
131
|
+
manifest.content.start_url = packagedAppEntryUrl;
|
|
132
|
+
const sourceDir = `${getBuildFolder(c)}${appSourcePath}`;
|
|
133
|
+
const destinationDirectory = `${getBuildFolder(c)}${packagedAppSrcDestination}`;
|
|
134
|
+
await createVSSolution(c, `${getBuildFolder(c)}${packagedAppOutputPath}`, manifest);
|
|
135
|
+
(0, child_process_1.execSync)(`cp -r ${sourceDir} ${destinationDirectory}`);
|
|
136
|
+
await addPackagedFiles(c);
|
|
137
|
+
};
|
|
137
138
|
const replacePublisherId = async (c, basePath) => {
|
|
138
139
|
logTask('replacePublisherId');
|
|
139
140
|
const output = `${basePath}/windows10/manifest/appxmanifest.xml`;
|
|
@@ -191,7 +192,8 @@ const replaceImages = async (c) => {
|
|
|
191
192
|
}
|
|
192
193
|
};
|
|
193
194
|
const copyWinJS = async (c) => {
|
|
194
|
-
|
|
195
|
+
logTask('copyWinJS');
|
|
196
|
+
const source = `${process.cwd()}${directionalNavPath}`;
|
|
195
197
|
const packagedAppDestination = `${getBuildFolder(c)}${packagedAppSource}/lib/TVHelpers`;
|
|
196
198
|
const hostedAppDestination = `${getBuildFolder(c)}${hostedAppSource}/lib/TVHelpers`;
|
|
197
199
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@24i/smartapps-bigscreen-rnv-build-engine",
|
|
3
|
-
"version": "0.13.1-alpha.
|
|
3
|
+
"version": "0.13.1-alpha.1780+47f21524",
|
|
4
4
|
"description": "Package with build engine for SmartApps BIGscreen projects...",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"@types/ssh2": "0.5.51",
|
|
42
42
|
"@types/tapable": "1.0.6",
|
|
43
43
|
"@types/webpack": "4.41.26",
|
|
44
|
+
"@types/xml2js": "^0.4.9",
|
|
44
45
|
"nock": "13.2.2",
|
|
45
46
|
"svgo": "1.3.2"
|
|
46
47
|
},
|
|
@@ -79,5 +80,8 @@
|
|
|
79
80
|
"keywords": [],
|
|
80
81
|
"author": "24i",
|
|
81
82
|
"license": "ISC",
|
|
82
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "47f2152483ee87d3eff5dfb252b51ccd346cb3d9",
|
|
84
|
+
"dependencies": {
|
|
85
|
+
"xml2js": "^0.4.23"
|
|
86
|
+
}
|
|
83
87
|
}
|