@24i/smartapps-bigscreen-rnv-build-engine 0.12.1-alpha.1716 → 0.12.1

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.
@@ -13,7 +13,7 @@ const c = {
13
13
  appId: 'flavour1',
14
14
  },
15
15
  buildConfig: {
16
- defaults: { supportedPlatforms: [constants_1.Platforms.TIZEN, constants_1.Platforms.WEBTV, constants_1.Platforms.HBBTV, constants_1.Platforms.XBOX] },
16
+ defaults: { supportedPlatforms: [constants_1.Platforms.TIZEN, constants_1.Platforms.WEBTV, constants_1.Platforms.HBBTV] },
17
17
  common: {
18
18
  appNameInFileName: 'appName',
19
19
  packageVersion: '1.0.0',
@@ -39,11 +39,6 @@ const c = {
39
39
  supportedFlavours: ['flavour3'],
40
40
  },
41
41
  },
42
- xbox: {
43
- deploy: {
44
- supportedFlavours: ['flavour1'],
45
- },
46
- },
47
42
  },
48
43
  },
49
44
  };
@@ -84,12 +79,6 @@ describe('resolveDeployLocations', () => {
84
79
  packageUrl: `${bucketBaseUrl}/builds/webtv/flavour1/latest/release/build/appName_webtv_latest.release_flavour1.zip`,
85
80
  },
86
81
  },
87
- xbox: {
88
- flavour1: {
89
- indexUrl: `${bucketBaseUrl}/builds/xbox/flavour1/latest/release/public/index.html`,
90
- packageUrl: `${bucketBaseUrl}/builds/xbox/flavour1/latest/release/build/appName_xbox_latest.release_flavour1.zip`,
91
- },
92
- },
93
82
  },
94
83
  },
95
84
  },
@@ -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.SDKXbox = exports.SDKWebpack = exports.SDKTizen = exports.SDKWebos = void 0;
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/jest.config.js CHANGED
@@ -2,7 +2,6 @@ module.exports = {
2
2
  ...require('../../jest.config.base'),
3
3
  transformIgnorePatterns: [
4
4
  '/node_modules/ansi-color/', // compiler error: Octal literal in strict mode
5
- '/node_modules/fstream', // compiler error: Octal literal in strict mode
6
5
  ],
7
6
  testEnvironment: 'node',
8
7
  };
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.1716+db06644f",
3
+ "version": "0.12.1",
4
4
  "description": "Package with build engine for SmartApps BIGscreen projects...",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {
@@ -16,23 +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
- "path": "./node_modules/fstream/node_modules/graceful-fs/",
29
- "version": "^4.2.8"
30
- },
31
- {
32
- "path": "../../fstream/node_modules/graceful-fs/",
33
- "version": "^4.2.8"
34
- }
35
- ],
36
21
  "devDependencies": {
37
22
  "@types/inquirer": "8.1.3",
38
23
  "@types/mini-css-extract-plugin": "1.2.2",
@@ -57,7 +42,6 @@
57
42
  "glob": "7.1.7",
58
43
  "html-webpack-harddisk-plugin": "1.0.2",
59
44
  "html-webpack-plugin": "4.5.2",
60
- "manifoldjs-windows10": "^0.1.8",
61
45
  "mini-css-extract-plugin": "1.6.2",
62
46
  "node-ssh": "11.1.1",
63
47
  "ora": "5.4.1",
@@ -78,5 +62,5 @@
78
62
  "keywords": [],
79
63
  "author": "24i",
80
64
  "license": "ISC",
81
- "gitHead": "db06644f7751af2c65dbb4644c7526b2ff2ed005"
65
+ "gitHead": "bdf7f5083ff9e951b11a427bad0b49bf6d6e7504"
82
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,158 +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 manifoldjs_windows10_1 = require("manifoldjs-windows10");
8
- const resolvers_1 = require("../../resolvers");
9
- const fs = fs_1.promises;
10
- const { logTask } = rnv_1.Logger;
11
- const { buildCoreWebpackProject } = rnv_1.WebpackUtils;
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 getHostedAppEntryUrl = (c) => {
30
- const deployLocations = (0, resolvers_1.resolveDeployLocations)(c);
31
- const keys = Object.keys(deployLocations.versions);
32
- let url = '';
33
- if (keys !== null && keys.length > 0) {
34
- const version = keys[0];
35
- if (version !== null) {
36
- const flavour = c.runtime.appId;
37
- url = deployLocations.versions[version].platforms.xbox?.[flavour].indexUrl ?? '';
38
- }
39
- }
40
- return url;
41
- };
42
- const getBuildFolder = (c) => {
43
- const sourceDir = `${rnv_1.Common.getPlatformBuildDir(c)}`;
44
- return sourceDir;
45
- };
46
- const zipOutput = async (c) => {
47
- logTask('zipOutput');
48
- const defaultZipFileName = `${c.platform}_${c.runtime.appId}.zip`;
49
- const fileName = (0, resolvers_1.resolveBuildFileName)(c) || defaultZipFileName;
50
- const outputDirectory = `${getBuildFolder(c)}/output`;
51
- const tmpOutputDirectory = `${getBuildFolder(c)}/tmpOutput`;
52
- try {
53
- await fs.mkdir(tmpOutputDirectory);
54
- (0, child_process_1.execSync)(`cp -r ${outputDirectory} ${tmpOutputDirectory}`);
55
- await fs.rm(outputDirectory, { recursive: true, force: true });
56
- await fs.mkdir(outputDirectory);
57
- (0, child_process_1.execSync)(`zip -r ${outputDirectory}/${fileName} *`, { cwd: `${tmpOutputDirectory}` });
58
- await fs.rm(tmpOutputDirectory, { recursive: true, force: true });
59
- }
60
- catch {
61
- throw new Error('Unable to zip the output folder');
62
- }
63
- };
64
- const createVSSolution = async (c, outputPath, manifest) => {
65
- logTask('createVSSolution');
66
- try {
67
- manifest.content.short_name = c.buildConfig.common.appName;
68
- const platform = new manifoldjs_windows10_1.Platform('package', ['windows10']);
69
- await platform.create(manifest, outputPath, ['windows10'], '');
70
- }
71
- catch (e) {
72
- if (e instanceof Error) {
73
- if (!e.message.includes('Error retrieving information for module')) {
74
- console.error(e.message);
75
- throw new Error('Failed to create VSSolution');
76
- }
77
- }
78
- }
79
- };
80
- const createHostedApplication = async (c) => {
81
- logTask('createHostedApplication');
82
- const manifest = new Manifest();
83
- manifest.content.start_url = getHostedAppEntryUrl(c);
84
- await createVSSolution(c, `${getBuildFolder(c)}${hostedAppOutputPath}`, manifest);
85
- };
86
- const createPackagedApplication = async (c) => {
87
- logTask('createPackagedApplication');
88
- const manifest = new Manifest();
89
- manifest.content.start_url = packagedAppEntryUrl;
90
- const sourceDir = `${getBuildFolder(c)}${appSourcePath}`;
91
- const destinationDirectory = `${getBuildFolder(c)}${packagedAppSrcDestination}`;
92
- await createVSSolution(c, `${getBuildFolder(c)}${packagedAppOutputPath}`, manifest);
93
- (0, child_process_1.execSync)(`cp -r ${sourceDir} ${destinationDirectory}`);
94
- };
95
- const replacePublisherId = async (c, basePath) => {
96
- logTask('replacePublisherId');
97
- const output = `${basePath}/windows10/manifest/appxmanifest.xml`;
98
- const configPath = `${getBuildFolder(c)}${wrapperConfigPath}`;
99
- let appxmanifest = null;
100
- let identityName = null;
101
- let identityPublisher = null;
102
- let publisherDisplayName = null;
103
- try {
104
- const data = await fs.readFile(configPath, 'utf-8');
105
- const config = JSON.parse(data);
106
- ({
107
- identityName = null,
108
- identityPublisher = null,
109
- publisherDisplayName = null,
110
- } = config);
111
- const appxmanifestData = await fs.readFile(output, 'utf-8');
112
- appxmanifest = appxmanifestData;
113
- if (identityName !== null
114
- && identityPublisher !== null
115
- && publisherDisplayName !== null) {
116
- appxmanifest = appxmanifest.replace(identityNamePlaceholder, identityName.toString())
117
- .replace(identityPublisherPlaceholder, identityPublisher.toString())
118
- .replace(publisherDisplayNamePlaceholder, publisherDisplayName.toString());
119
- }
120
- await fs.writeFile(output, appxmanifest ?? '');
121
- }
122
- catch {
123
- throw new Error('Failed to modify the xbox appxmanifest.xml');
124
- }
125
- };
126
- const replaceImages = async (c) => {
127
- logTask('replaceImages');
128
- const hostedOutputDirectory = `${getBuildFolder(c)}${hostedSourceImages}`;
129
- const packagedOutputDirectory = `${getBuildFolder(c)}${packagedSourceImages}`;
130
- const hostedOutputManifestDirectory = `${getBuildFolder(c)}${hostedManifestImages}`;
131
- const packagedOutputManifestDirectory = `${getBuildFolder(c)}${packagedManifestImages}`;
132
- const appIconsDirectory = `${getBuildFolder(c)}/project/appIcons`;
133
- try {
134
- await fs.rm(hostedOutputDirectory, { recursive: true, force: true });
135
- await fs.rm(packagedOutputDirectory, { recursive: true, force: true });
136
- (0, child_process_1.execSync)(`cp -r ${appIconsDirectory} ${hostedOutputDirectory}`);
137
- (0, child_process_1.execSync)(`cp -r ${appIconsDirectory} ${packagedOutputDirectory}`);
138
- (0, child_process_1.execSync)(`cp -r ${appIconsDirectory} ${hostedOutputManifestDirectory}`);
139
- (0, child_process_1.execSync)(`cp -r ${appIconsDirectory} ${packagedOutputManifestDirectory}`);
140
- await fs.rm(appIconsDirectory, { recursive: true, force: true });
141
- }
142
- catch {
143
- throw new Error('Failed to replace the xbox icons');
144
- }
145
- };
146
- const buildXboxProject = async (c) => {
147
- logTask('buildXboxProject');
148
- const outputDirectory = `${getBuildFolder(c)}/output`;
149
- await buildCoreWebpackProject(c);
150
- await fs.rm(outputDirectory, { recursive: true, force: true });
151
- await createHostedApplication(c);
152
- await createPackagedApplication(c);
153
- await replacePublisherId(c, `${getBuildFolder(c)}${hostedAppOutputPath}`);
154
- await replacePublisherId(c, `${getBuildFolder(c)}${packagedAppOutputPath}`);
155
- await replaceImages(c);
156
- await zipOutput(c);
157
- };
158
- exports.buildXboxProject = buildXboxProject;
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);
@@ -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);