@24i/smartapps-bigscreen-rnv-build-engine 0.8.5 → 0.8.6-alpha.1402

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/README.md CHANGED
@@ -18,6 +18,7 @@ sidebar_label: Rnv Build Engine
18
18
  - [Available Webpack Injections](#available-webpack-injections)
19
19
  - [Package content](#package-content)
20
20
  - [How to set up new project with SmartApps BIGscreen build engine](#how-to-set-up-new-project-with-smartapps-bigscreen-build-engine)
21
+ - [How to add new platform](#how-to-add-new-platform)
21
22
 
22
23
  ---
23
24
  ## About the package
@@ -46,7 +47,7 @@ it
46
47
  | **webOS** | LG | `webos` | `.ipk` | `*.webos.tv.{js,jsx,ts,tsx,json}` | |
47
48
  | **WebTV** | N/A | `webtv` | `.zip` | `*.webtv.{js,jsx,ts,tsx,json}` | for previewing builds in browser |
48
49
 
49
- When building the application with ReNative, if file with ***registered platform extensinon*** is found,
50
+ When building the application with ReNative, if file with ***registered platform extension*** is found,
50
51
  it takes precedence and is bundled instead of file without registered file extension (such as `index.ts`).
51
52
  For instance, this approach is useful (and is used) for platform drivers - only concrete driver can be bundled into the final package for selected platform:
52
53
 
@@ -107,11 +108,12 @@ Currently, following variable names are configured for replacing:
107
108
  | :-------------------------------------------- | :----: | ------------------------------------------------------- | :-----------------------------------------: |
108
109
  | **WEBPACK_INJECTION_APP_CONFIG_ID** | string | flavour id *(value of rnv CLI `-c` param value)* | `'animated_1080'`, `'basic_720'` |
109
110
  | **WEBPACK_INJECTION_APP_CREATED** | string | build time in ISO 8601 format | `'2021-07-30T09:18:26.014Z'` |
111
+ | **WEBPACK_INJECTION_APP_SCHEME** | string | scheme used during the build | `'debug'`, `'rc:latest'`, `'release:dist'` |
110
112
  | **WEBPACK_INJECTION_APP_RESOLUTION** | string | app resolution in `<WIDTH>x<HEIGHT>` format (in pixels) | `'1920x1080'`, `'1280x720'` |
111
113
  | **WEBPACK_INJECTION_APP_VERSION** | string | app version | `'v0.0.1.dev'`, `'v0.0.1.rc-1'`, `'v0.0.1'` |
112
114
  | **WEBPACK_INJECTION_APP_ENVIRONMENT** | string | environment used during the build | `'development'`, `'production'` |
113
115
  | **WEBPACK_INJECTION_APP_PLATFORM** | string | platform id *(value of rnv CLI `-p` param value)* | `'webtv'`, `'webos'`, `'tizen'`, `'entone'` |
114
- | **WEBPACK_INJECTION_APP_RUNTIME_CONFIG_PATH** | string | path to JSON app config, imported when app is starting | `'./public/content/conf/config.json'` |
116
+ | **WEBPACK_INJECTION_APP_CONTENT_PATH** | string | path to content directory | `'./public/content'` |
115
117
 
116
118
  An example:
117
119
  ```typescript
@@ -210,3 +212,7 @@ and `.travis.yml`config file (related to Travis CI).
210
212
  > To **start a new project** with usage of our build process,
211
213
  > please use [SmartApps BIGscreen Template repository](https://github.com/24i/smartapps-bigscreen-template),
212
214
  > it uses this package and contains other required configuration files as well.
215
+
216
+ ---
217
+ ## How to add new platform
218
+ To see how to add new platform, click [here](docs/PLATFORM_ADD.md).
package/dist/src/index.js CHANGED
@@ -51,26 +51,32 @@ exports.default = {
51
51
  [constants_1.Platforms.ENTONE]: {
52
52
  extenstions: generateEngineExtensions(['entone']),
53
53
  defaultPort: 8094,
54
+ isWebHosted: true,
54
55
  },
55
56
  [constants_1.Platforms.HBBTV]: {
56
57
  extenstions: generateEngineExtensions(['hbbtv.tv']),
57
58
  defaultPort: 8095,
59
+ isWebHosted: true,
58
60
  },
59
61
  [constants_1.Platforms.SAPHI]: {
60
62
  extenstions: generateEngineExtensions(['saphi.tv']),
61
63
  defaultPort: 8096,
64
+ isWebHosted: true,
62
65
  },
63
66
  [constants_1.Platforms.TIZEN]: {
64
67
  extenstions: generateEngineExtensions(['tizen.tv']),
65
68
  defaultPort: 8087,
69
+ isWebHosted: true,
66
70
  },
67
71
  [constants_1.Platforms.WEBOS]: {
68
72
  extenstions: generateEngineExtensions(['webos.tv']),
69
73
  defaultPort: 8088,
74
+ isWebHosted: true,
70
75
  },
71
76
  [constants_1.Platforms.WEBTV]: {
72
77
  extenstions: generateEngineExtensions(['webtv']),
73
78
  defaultPort: 8080,
79
+ isWebHosted: true,
74
80
  },
75
81
  },
76
82
  };
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const strict_1 = require("assert/strict");
3
+ const assert_1 = require("assert");
4
4
  const resolvers_1 = require("../../resolvers");
5
5
  const gitUtils_1 = require("../utils/gitUtils");
6
6
  const c = resolvers_1.getBaseConfig();
7
7
  const { branchNames, commitTitles } = c.buildConfig.common.git;
8
- strict_1.ok(branchNames.dev);
9
- strict_1.ok(branchNames.rc);
10
- strict_1.ok(commitTitles.versionBump);
8
+ assert_1.ok(branchNames.dev);
9
+ assert_1.ok(branchNames.rc);
10
+ assert_1.ok(commitTitles.versionBump);
11
11
  gitUtils_1.assertCurrentBranch(branchNames.dev);
12
12
  gitUtils_1.assertEmptyStatusList();
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.checkReleaseNotes = void 0;
4
- const strict_1 = require("assert/strict");
4
+ const assert_1 = require("assert");
5
5
  const utils_1 = require("../utils");
6
6
  const checkReleaseNotes = (c) => {
7
7
  const { relativePath, requiredRows = [] } = c.buildConfig.common.releaseNotes;
@@ -9,7 +9,7 @@ const checkReleaseNotes = (c) => {
9
9
  const fileContent = utils_1.fsUtils.getFileContentAsString(relativePath);
10
10
  const assertFileContentRow = (expectedRowContent) => {
11
11
  const errorMsg = `${relativePath} should contain following row: "${expectedRowContent}"`;
12
- strict_1.ok(fileContent.includes(expectedRowContent), errorMsg);
12
+ assert_1.ok(fileContent.includes(expectedRowContent), errorMsg);
13
13
  };
14
14
  requiredRows.forEach(assertFileContentRow);
15
15
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const strict_1 = require("assert/strict");
3
+ const assert_1 = require("assert");
4
4
  const resolvers_1 = require("../../resolvers");
5
5
  const utils_1 = require("../utils");
6
6
  const checkReleaseNotes_1 = require("./checkReleaseNotes");
@@ -9,17 +9,17 @@ const { branchNames, pullRequestTitles } = c.buildConfig.common.git || {};
9
9
  const rcBranchName = branchNames.rc;
10
10
  const distBranchName = branchNames.dist;
11
11
  const devBranchName = branchNames.dev;
12
- strict_1.ok(rcBranchName);
13
- strict_1.ok(distBranchName);
14
- strict_1.ok(devBranchName);
12
+ assert_1.ok(rcBranchName);
13
+ assert_1.ok(distBranchName);
14
+ assert_1.ok(devBranchName);
15
15
  utils_1.gitUtils.assertCurrentBranch(rcBranchName);
16
16
  utils_1.gitUtils.assertEmptyStatusList();
17
17
  utils_1.gitUtils.assertRemoteBranch(rcBranchName);
18
18
  utils_1.gitUtils.assertRemoteBranch(distBranchName);
19
19
  const distributionPrTitle = pullRequestTitles.rcToDist;
20
20
  const developmentPrTitle = pullRequestTitles.rcToDev;
21
- strict_1.ok(distributionPrTitle);
22
- strict_1.ok(developmentPrTitle);
21
+ assert_1.ok(distributionPrTitle);
22
+ assert_1.ok(developmentPrTitle);
23
23
  utils_1.gitUtils.pull();
24
24
  checkReleaseNotes_1.checkReleaseNotes(c);
25
25
  console.log(`Creating Pull Request from ${rcBranchName} branch to ${distBranchName} branch...`);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const strict_1 = require("assert/strict");
3
+ const assert_1 = require("assert");
4
4
  const resolvers_1 = require("../../resolvers");
5
5
  const utils_1 = require("../utils");
6
6
  const checkReleaseNotes_1 = require("./checkReleaseNotes");
@@ -11,10 +11,10 @@ const rcBranchName = branchNames.rc;
11
11
  const releaseNotesBranchName = branchNames.rcReleaseNotes;
12
12
  const commitTitle = commitTitles.rcReleaseNotes;
13
13
  const prTitle = pullRequestTitles.releaseNotesToRc;
14
- strict_1.ok(relativePath);
15
- strict_1.ok(releaseNotesBranchName);
16
- strict_1.ok(commitTitle);
17
- strict_1.ok(prTitle);
14
+ assert_1.ok(relativePath);
15
+ assert_1.ok(releaseNotesBranchName);
16
+ assert_1.ok(commitTitle);
17
+ assert_1.ok(prTitle);
18
18
  utils_1.gitUtils.assertCurrentBranch(rcBranchName);
19
19
  utils_1.gitUtils.assertRemoteBranch(rcBranchName);
20
20
  checkReleaseNotes_1.checkReleaseNotes(c);
@@ -25,7 +25,7 @@ if (changedFilesCount === 0) {
25
25
  console.log('Skipping making a commit, if needed, please continue on your own (manually).');
26
26
  }
27
27
  else {
28
- strict_1.ok(changedFilesCount === 1, `Only ${relativePath} should contain changes!`);
28
+ assert_1.ok(changedFilesCount === 1, `Only ${relativePath} should contain changes!`);
29
29
  utils_1.gitUtils.createBranch(releaseNotesBranchName);
30
30
  utils_1.gitUtils.checkout(releaseNotesBranchName);
31
31
  utils_1.gitUtils.add([relativePath]);
@@ -22,7 +22,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.githubRelease = void 0;
23
23
  const child_process_1 = require("child_process");
24
24
  const fs = __importStar(require("fs"));
25
- const strict_1 = require("assert/strict");
25
+ const assert_1 = require("assert");
26
26
  const path_1 = require("path");
27
27
  const resolvers_1 = require("../../resolvers");
28
28
  const urlsMarkdown_1 = require("./urlsMarkdown");
@@ -58,7 +58,7 @@ const deleteFileIfExists = (filePath) => {
58
58
  };
59
59
  const makeGitHubReleaseNotes = (c) => {
60
60
  const releaseNotesPath = getReleaseNotesPath(c);
61
- strict_1.ok(releaseNotesPath, 'The path to the file with release notes is missing!');
61
+ assert_1.ok(releaseNotesPath, 'The path to the file with release notes is missing!');
62
62
  deleteFileIfExists(githubReleaseNotesPath);
63
63
  child_process_1.execSync(`sed '1d;2d' ${releaseNotesPath} >> ${githubReleaseNotesPath}`);
64
64
  const textToAppend = urlsMarkdown_1.getUrlsMarkdown(c);
@@ -67,11 +67,11 @@ const makeGitHubReleaseNotes = (c) => {
67
67
  const createRelease = (c) => {
68
68
  const { packageVersion, git } = c.buildConfig.common;
69
69
  const versionLabel = `v${packageVersion}`;
70
- strict_1.ok(token, 'process.env.GITHUB_TOKEN is not set!');
71
- strict_1.ok(targetCommit, 'process.env.TRAVIS_COMMIT is not set!');
72
- strict_1.ok(git.owner, 'Missing value for rnv config prop: common.git.owner');
73
- strict_1.ok(git.repo, 'Missing value for rnv config prop: common.git.repo');
74
- strict_1.ok(packageVersion);
70
+ assert_1.ok(token, 'process.env.GITHUB_TOKEN is not set!');
71
+ assert_1.ok(targetCommit, 'process.env.TRAVIS_COMMIT is not set!');
72
+ assert_1.ok(git.owner, 'Missing value for rnv config prop: common.git.owner');
73
+ assert_1.ok(git.repo, 'Missing value for rnv config prop: common.git.repo');
74
+ assert_1.ok(packageVersion);
75
75
  makeGitHubReleaseNotes(c);
76
76
  const releaseNotesContent = fs.readFileSync(githubReleaseNotesPath).toString();
77
77
  const data = {
@@ -119,7 +119,7 @@ const uploadZipWithPlatformBuilds = (c, platformName, githubUploadUrl) => {
119
119
  const githubRelease = (c) => {
120
120
  const releaseResponse = createRelease(c) || {};
121
121
  const uploadUrl = releaseResponse.upload_url;
122
- strict_1.ok(uploadUrl, 'Missing "upload_url" in release response!');
122
+ assert_1.ok(uploadUrl, 'Missing "upload_url" in release response!');
123
123
  c.buildConfig.defaults.supportedPlatforms.forEach((platformName) => {
124
124
  uploadZipWithPlatformBuilds(c, platformName, uploadUrl);
125
125
  });
@@ -21,11 +21,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.assertPath = exports.getFileContentAsString = void 0;
23
23
  const fs = __importStar(require("fs"));
24
- const strict_1 = require("assert/strict");
24
+ const assert_1 = require("assert");
25
25
  const getFileContentAsString = (filePath) => fs.readFileSync(filePath).toString();
26
26
  exports.getFileContentAsString = getFileContentAsString;
27
27
  const assertPath = (path) => {
28
28
  const errorMsg = `File or path ${path} does not exist!`;
29
- strict_1.ok(fs.existsSync(path), errorMsg);
29
+ assert_1.ok(fs.existsSync(path), errorMsg);
30
30
  };
31
31
  exports.assertPath = assertPath;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.assertRemoteBranch = exports.assertCurrentBranch = exports.assertEmptyStatusList = exports.push = exports.commit = exports.createBranch = exports.checkout = exports.add = exports.addAll = exports.pull = exports.remoteBranchExists = exports.pullRequest = exports.getCurrentBranchName = exports.statusList = void 0;
4
- const strict_1 = require("assert/strict");
4
+ const assert_1 = require("assert");
5
5
  const cmdUtils_1 = require("./cmdUtils");
6
6
  const stringUtils_1 = require("./stringUtils");
7
7
  const statusList = () => {
@@ -25,7 +25,7 @@ const pullRequest = (fromBranch, toBranch, prTitle) => {
25
25
  const errorMsg = `${cmdTool} is not installed! See ${installDocUrl}\n`;
26
26
  try {
27
27
  const toolPath = cmdUtils_1.cmdSyncTrimOut(`${cmdTool} --version`);
28
- strict_1.ok(toolPath, errorMsg);
28
+ assert_1.ok(toolPath, errorMsg);
29
29
  }
30
30
  catch (error) {
31
31
  throw new Error(errorMsg);
@@ -62,17 +62,17 @@ const push = (branchName, noVerify) => {
62
62
  };
63
63
  exports.push = push;
64
64
  const assertEmptyStatusList = () => {
65
- strict_1.ok(statusList().length === 0, 'An empty GIT stage is expected!');
65
+ assert_1.ok(statusList().length === 0, 'An empty GIT stage is expected!');
66
66
  };
67
67
  exports.assertEmptyStatusList = assertEmptyStatusList;
68
68
  const assertCurrentBranch = (expectedBranchName) => {
69
69
  const currentGitBranchName = getCurrentBranchName();
70
70
  const errorMsg = `The ${expectedBranchName} branch is expected to be active, not "${currentGitBranchName}"`;
71
- strict_1.ok(currentGitBranchName === expectedBranchName, errorMsg);
71
+ assert_1.ok(currentGitBranchName === expectedBranchName, errorMsg);
72
72
  };
73
73
  exports.assertCurrentBranch = assertCurrentBranch;
74
74
  const assertRemoteBranch = (expectedBranchName) => {
75
75
  const errorMsg = `Remote branch ${expectedBranchName} does not exist!`;
76
- strict_1.ok(remoteBranchExists(expectedBranchName), errorMsg);
76
+ assert_1.ok(remoteBranchExists(expectedBranchName), errorMsg);
77
77
  };
78
78
  exports.assertRemoteBranch = assertRemoteBranch;
@@ -22,13 +22,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.handleWebosSdk = exports.configureWebOSProject = exports.buildWebOSProject = exports.runWebOS = void 0;
23
23
  const fs = __importStar(require("fs"));
24
24
  const path = __importStar(require("path"));
25
- const semver = __importStar(require("semver"));
26
25
  const os_1 = require("os");
27
26
  const rnv_1 = require("rnv");
28
27
  const sdkUtils_1 = require("../sdkUtils");
29
28
  const { writeCleanFile } = rnv_1.FileUtils;
30
29
  const { execCLI } = rnv_1.Exec;
31
- const { getPlatformProjectDir, getTemplateProjectDir, getPlatformBuildDir, getAppVersion, getAppTitle, getAppId, getAppDescription, getConfigProp, checkPortInUse, confirmActiveBundler, addSystemInjects, } = rnv_1.Common;
30
+ const { getPlatformProjectDir, getTemplateProjectDir, getPlatformBuildDir, getConfigProp, checkPortInUse, confirmActiveBundler, } = rnv_1.Common;
32
31
  const { buildCoreWebpackProject, runWebpackServer, configureCoreWebProject, waitForWebpack, } = rnv_1.WebpackUtils;
33
32
  const { isPlatformActive } = rnv_1.PlatformManager;
34
33
  const { chalk, logTask, logInfo, logSuccess, logError } = rnv_1.Logger;
@@ -94,40 +93,14 @@ const buildWebOSProject = async (c) => {
94
93
  exports.buildWebOSProject = buildWebOSProject;
95
94
  const configureProject = async (c) => {
96
95
  logTask('configureProject');
97
- const { platform } = c;
98
96
  const configFile = 'appinfo.json';
99
- const injects = [
100
- {
101
- pattern: '{{APPLICATION_ID}}',
102
- override: getAppId(c, platform).toLowerCase(),
103
- },
104
- {
105
- pattern: '{{APP_TITLE}}',
106
- override: getAppTitle(c, platform),
107
- },
108
- {
109
- pattern: '{{APP_VERSION}}',
110
- override: semver.coerce(getAppVersion(c, platform)),
111
- },
112
- {
113
- pattern: '{{APP_DESCRIPTION}}',
114
- override: getAppDescription(c, platform),
115
- },
116
- {
117
- pattern: '{{APP_BG_COLOR}}',
118
- override: getConfigProp(c, platform, 'bgColor', '#fff'),
119
- },
120
- {
121
- pattern: '{{APP_ICON_COLOR}}',
122
- override: getConfigProp(c, platform, 'iconColor', '#000'),
123
- },
124
- {
125
- pattern: '{{APP_VENDOR}}',
126
- override: getConfigProp(c, platform, 'vendor', '24i'),
127
- },
128
- ];
129
- addSystemInjects(c, injects);
130
- writeCleanFile(path.join(getTemplateProjectDir(c), configFile), path.join(getPlatformProjectDir(c), configFile), injects, null, c);
97
+ const configFileSource = path.join(getTemplateProjectDir(c), configFile);
98
+ const configFileDest = path.join(getPlatformProjectDir(c), configFile);
99
+ writeCleanFile(configFileSource, configFileDest, [], null, c);
100
+ let fileContent = fs.readFileSync(configFileDest).toString();
101
+ fileContent = fileContent.replace(/"true"/g, 'true');
102
+ fileContent = fileContent.replace(/"false"/g, 'false');
103
+ fs.writeFileSync(configFileDest, fileContent);
131
104
  return true;
132
105
  };
133
106
  const configureWebOSProject = async (c) => {
@@ -139,7 +112,7 @@ const configureWebOSProject = async (c) => {
139
112
  await copyAssetsFolder(c, platform);
140
113
  await configureCoreWebProject(c);
141
114
  await configureProject(c);
142
- copyBuildsFolder(c, platform);
115
+ await copyBuildsFolder(c, platform);
143
116
  };
144
117
  exports.configureWebOSProject = configureWebOSProject;
145
118
  const sdkInstallerUUrl = 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/webos/ares_webos_builder_v1.10.4_multiplatform.zip';
@@ -50,10 +50,9 @@ const includeRtlFiles = ({ shouldIncludeRtlFiles }) => (content, loaderContext)
50
50
  }
51
51
  return content;
52
52
  };
53
- const relativePathToAppRuntimeCfg = path_1.default.join('conf', 'config.json');
54
- const getAppRuntimeConfigPath = (baseUrl, isBuildHosted = false) => {
53
+ const getAppContentPath = (baseUrl, isBuildHosted = false) => {
55
54
  const isBuildHostedAndHasBaseUrl = isBuildHosted && !!baseUrl;
56
- const relativePath = path_1.default.join(isBuildHostedAndHasBaseUrl ? './public' : '', 'content', relativePathToAppRuntimeCfg);
55
+ const relativePath = path_1.default.join(isBuildHostedAndHasBaseUrl ? './public' : '', 'content');
57
56
  return isBuildHostedAndHasBaseUrl
58
57
  ? `${baseUrl}/${relativePath}`
59
58
  : relativePath;
@@ -151,7 +150,7 @@ function generateConfig(config) {
151
150
  }
152
151
  });
153
152
  }
154
- const appRuntimeConfigPath = getAppRuntimeConfigPath(baseUrl, isBuildHosted);
153
+ const appContentPath = getAppContentPath(baseUrl, isBuildHosted);
155
154
  const copiedDirWithPublicContentPath = path_1.default.join(appBuildDir, `../${path_1.default.parse(appBuildDir).name}-public`);
156
155
  const plugins = {
157
156
  forkTsChecker: new fork_ts_checker_webpack_plugin_1.default({
@@ -163,11 +162,12 @@ function generateConfig(config) {
163
162
  webpack: new webpack_1.default.DefinePlugin({
164
163
  WEBPACK_INJECTION_APP_CONFIG_ID: JSON.stringify(config.appConfigId || ''),
165
164
  WEBPACK_INJECTION_APP_CREATED: JSON.stringify(new Date().toISOString()),
165
+ WEBPACK_INJECTION_APP_SCHEME: JSON.stringify(config.scheme || ''),
166
166
  WEBPACK_INJECTION_APP_RESOLUTION: JSON.stringify(getResolutionString(config)),
167
167
  WEBPACK_INJECTION_APP_VERSION: JSON.stringify(buildVersion || ''),
168
168
  WEBPACK_INJECTION_APP_ENVIRONMENT: JSON.stringify(config.environment || ''),
169
169
  WEBPACK_INJECTION_APP_PLATFORM: JSON.stringify(PLATFORM || ''),
170
- WEBPACK_INJECTION_APP_RUNTIME_CONFIG_PATH: JSON.stringify(appRuntimeConfigPath),
170
+ WEBPACK_INJECTION_APP_CONTENT_PATH: JSON.stringify(appContentPath),
171
171
  }),
172
172
  html: new html_webpack_plugin_1.default({
173
173
  alwaysWriteToDisk: true,
@@ -201,8 +201,8 @@ function generateConfig(config) {
201
201
  isDevServer ? {
202
202
  move: [
203
203
  {
204
- source: path_1.default.join(appBuildDir, 'project', 'public', 'content', relativePathToAppRuntimeCfg),
205
- destination: path_1.default.join(appBuildEngineProjectDir, 'content', relativePathToAppRuntimeCfg),
204
+ source: path_1.default.join(appBuildDir, 'project', 'public', 'content'),
205
+ destination: path_1.default.join(appBuildEngineProjectDir, 'content'),
206
206
  },
207
207
  ],
208
208
  } : null,
@@ -1,12 +1,19 @@
1
1
  {
2
- "vendor": "24i",
3
- "largeIcon": "app_icon_130x130.png",
4
2
  "icon": "app_icon_80x80.png",
5
- "main": "public/index.html",
6
3
  "id": "{{configProps.id}}",
4
+ "largeIcon": "app_icon_130x130.png",
5
+ "main": "public/index.html",
6
+ "splashBackground": "splash_background_1920x1080.png",
7
7
  "title": "{{configProps.title}}",
8
8
  "type": "web",
9
- "resolution": "{{configProps.webpackConfig.resolution.width}}x{{configProps.webpackConfig.resolution.height}}",
9
+ "vendor": "{{configProps.author.name}}",
10
+ "version": "{{configProps.packageVersion}}",
11
+ "appDescription": "{{configProps.description}}",
12
+ "bgColor": "{{configProps.backgroundColor}}",
13
+ "bgImage": "{{configProps.appinfo.bgImage}}",
10
14
  "disableBackHistoryAPI": true,
11
- "version": "{{APP_VERSION}}"
15
+ "handlesRelaunch": "{{configProps.appinfo.handlesRelaunch}}",
16
+ "iconColor": "{{configProps.appinfo.iconColor}}",
17
+ "resolution": "{{configProps.webpackConfig.resolution.width}}x{{configProps.webpackConfig.resolution.height}}",
18
+ "transparent": "{{configProps.appinfo.transparent}}"
12
19
  }
@@ -0,0 +1,60 @@
1
+ # rnv-build-engine
2
+ ## How to add new platform
3
+
4
+ ---
5
+ ### Choose platform ID
6
+ To see actual list of platform IDs, see table in [Supported platforms](../README.md#supported-platforms) section.
7
+
8
+ Platform ID is needed for ReNative CLI - to specify requested platform for build or for example for deploy:
9
+
10
+ `rnv build -c <flavour> -s <scheme> -p <platform_id>`
11
+
12
+ `rnv deploy -c <flavour> -s <scheme> -p <platform_id>`
13
+
14
+ ---
15
+ ### Choose file extension for new platform
16
+ Please read [Supported platforms](../README.md#supported-platforms) section,
17
+ where platform file extensions and their usage are described.
18
+
19
+ ---
20
+ ### Prepare driver for new platform
21
+ #### 1. Implement new platform driver
22
+ - Use [packages/create-package](../../create-package) to create a new package with driver for requested platform.
23
+ Name the new package `driver-<platform_id>` and implement the platform driver inside it.
24
+ Have a look at other driver packages to inspire.
25
+
26
+ #### 2. Include new platform driver into `device` package
27
+ - In [packages/device/src/resolver/index.ts](../../device/src/resolver/index.ts),
28
+ import driver for new platform from just created package with platform driver (previous step)
29
+ by the same way as other platform drivers.
30
+ - According to [Choose file extension for new platform](#choose-file-extension-for-new-platform) section,
31
+ in [packages/device/src/driver/](../../device/src/driver) dir,
32
+ add `index.<platform_extension>.ts` file and inside it, export new driver by the same way as other drivers.
33
+
34
+ ---
35
+ ### How to extend build engine with new platform
36
+ - in [package.json](../package.json), in `peerDependencies`, update version of `@24i/smartapps-bigscreen-device` package to new version (created in step above)
37
+ - add requested platform record into [renative.engine.json](../renative.engine.json)
38
+ - add requested platform record into [src/constants/platforms.ts](../src/constants/platforms.ts)
39
+ - add requested platform record into [src/index.ts](../src/index.ts):
40
+ - set file extension(s) for requested platform *(see [Choose file extension for new platform](#choose-file-extension-for-new-platform) section)*
41
+ - set value for `defaultPort`
42
+ - set `isWebHosted` to `true`
43
+ - add following webpack configs into `templates/platforms/<platform_id>/` dir *(you can copy them from `webtv` platform and edit as you need)*:
44
+ - `webpack.config.dev.ts`
45
+ - `webpack.config.prod.ts`
46
+ - add record for new platform into [src/scripts/release/urlsMarkdown.ts](../src/scripts/release/urlsMarkdown.ts) file, in `beautifyPlatformName` function
47
+ - extend build engine [tasks](../src/tasks) with new platform:
48
+ - extend `buildFn` in [src/tasks/task.rnv.build.ts](../src/tasks/task.rnv.build.ts) file with new platform
49
+ - extend `configureFn` in [src/tasks/task.rnv.configure.ts](../src/tasks/task.rnv.configure.ts) file with new platform
50
+ - extend `deployFn` in [src/tasks/task.rnv.deploy.ts](../src/tasks/task.rnv.deploy.ts) file with new platform
51
+ - extend `startFn` in [src/tasks/task.rnv.start.ts](../src/tasks/task.rnv.start.ts) file with new platform
52
+ - add info about new platform into [Supported platforms](../README.md#supported-platforms) section
53
+ - if needed, do other custom modifications / extends
54
+ - create alpha version of the package
55
+ (tutorial [here](https://24imedia.atlassian.net/wiki/spaces/PRDNGBIGSCR/pages/1183481960/Preparing+Alpha+Builds+After+Merged+PR+and+Before+Full+Publish))
56
+
57
+ ---
58
+ ### How to extend SmartApps Template repository with new platform
59
+ The last step is updating [SmartApps Template repository](https://github.com/24i/smartapps-bigscreen-template),
60
+ see its [documentation](https://github.com/24i/smartapps-bigscreen-template/blob/development/docs/PLATFORM_ADD.md) about adding a new platform.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@24i/smartapps-bigscreen-rnv-build-engine",
3
- "version": "0.8.5",
3
+ "version": "0.8.6-alpha.1402+fdefc217",
4
4
  "description": "Package with build engine for SmartApps BIGscreen projects...",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {
@@ -61,5 +61,5 @@
61
61
  "keywords": [],
62
62
  "author": "24i",
63
63
  "license": "ISC",
64
- "gitHead": "d7a6600d9d06a70defedf4be6e2a5648a620c9ca"
64
+ "gitHead": "fdefc21765850532808963bb3756f6399010354e"
65
65
  }