@24i/smartapps-bigscreen-rnv-build-engine 0.0.2-alpha.1367 → 0.8.6-alpha.1394

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
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  id: README
3
- title: rnv Build Engine
3
+ title: Rnv Build Engine
4
4
  hide_title: true
5
5
  sidebar_label: Rnv Build Engine
6
6
  ---
@@ -8,24 +8,23 @@ sidebar_label: Rnv Build Engine
8
8
  # rnv-build-engine
9
9
 
10
10
  > To **start a new project** with usage of our build process,
11
- > please use [SmartApps BIGscreen Template repository](https://github.com/24i/smartapps-bigscreen-template),
11
+ > please use [SmartApps BIGscreen Template repository](https://github.com/24i/smartapps-bigscreen-template),
12
12
  > it uses this package and has prepared other required configuration files as well.
13
13
 
14
- ## Content
15
- 1. [About the package](#1-about-the-package)
16
- 2. [Supported platforms](#2-supported-platforms)
17
- 3. [Supported build schemes](#3-supported-build-schemes)
18
- 4. [Package content](#4-package-content)
19
- 5. [How to set up new project with SmartApps BIGscreen build engine](#5-how-to-set-up-new-project-with-smartapps-bigscreen-build-engine)
14
+ ## Table of Contents
15
+ - [About the package](#about-the-package)
16
+ - [Supported platforms](#supported-platforms)
17
+ - [Supported build schemes](#supported-build-schemes)
18
+ - [Available Webpack Injections](#available-webpack-injections)
19
+ - [Package content](#package-content)
20
+ - [How to set up new project with SmartApps BIGscreen build engine](#how-to-set-up-new-project-with-smartapps-bigscreen-build-engine)
20
21
 
21
22
  ---
22
-
23
- ## 1. About the package
23
+ ## About the package
24
24
  > Package for `SmartApps BIGscreen` projects, which needs **automated build and deploy process**.
25
25
 
26
- Uses [ReNative](https://github.com/pavjacko/renative) -
27
- this package contains (not only) custom build engine for `ReNative` which is used instead of core ReNative engine
28
- to fulfill the needs of SmartApps BIGscreen projects.
26
+ Uses [ReNative](https://github.com/pavjacko/renative) - this package contains (not only) custom build engine for `ReNative`
27
+ which is used instead of core ReNative engine to fulfill the needs of SmartApps BIGscreen projects.
29
28
 
30
29
  it
31
30
  - **builds** applications for requested platforms
@@ -34,18 +33,35 @@ it
34
33
  - sends **Slack notifications** for `release candidate` and `release` builds
35
34
  - supports `Sentry.io` runtime **error logging**
36
35
 
37
- ## 2. Supported platforms
38
36
 
39
- | *Platform* | *Vendor* | *id* | *Build file extension* | *Note* |
40
- | :--------- | :------: | :------: | :--------------------: | :------------------------------: |
41
- | **Entone** | Amino | `entone` | `.zip` | set-top boxes |
42
- | **HbbTV** | N/A | `hbbtv` | `.zip` | |
43
- | **Saphi** | Philips | `saphi` | `.zip` | |
44
- | **Tizen** | Samsung | `tizen` | `.wgt` | |
45
- | **WebTV** | N/A | `webtv` | `.zip` | for previewing builds in browser |
46
- | **webOS** | LG | `webos` | `.ipk` | |
47
-
48
- ## 3. Supported build schemes
37
+ ---
38
+ ## Supported platforms
39
+
40
+ | *Platform* | *Vendor* | *id* | *Build file extension* | *Registered file extensions* | *Note* |
41
+ | :--------- | :------: | :------: | :--------------------: | :-------------------------------: | :------------------------------: |
42
+ | **Entone** | Amino | `entone` | `.zip` | `*.entone.{js,jsx,ts,tsx,json}` | set-top boxes |
43
+ | **HbbTV** | N/A | `hbbtv` | `.zip` | `*.hbbtv.tv.{js,jsx,ts,tsx,json}` | |
44
+ | **Saphi** | Philips | `saphi` | `.zip` | `*.saphi.tv.{js,jsx,ts,tsx,json}` | |
45
+ | **Tizen** | Samsung | `tizen` | `.wgt` | `*.tizen.tv.{js,jsx,ts,tsx,json}` | |
46
+ | **webOS** | LG | `webos` | `.ipk` | `*.webos.tv.{js,jsx,ts,tsx,json}` | |
47
+ | **WebTV** | N/A | `webtv` | `.zip` | `*.webtv.{js,jsx,ts,tsx,json}` | for previewing builds in browser |
48
+
49
+ When building the application with ReNative, if file with ***registered platform extensinon*** is found,
50
+ it takes precedence and is bundled instead of file without registered file extension (such as `index.ts`).
51
+ 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
+ ```
54
+ drivers/
55
+ index.ts // fallback when file with platform file extension for selected platform is not found
56
+ index.entone.ts // if build for entone platform is selected, this file will be picked for the build
57
+ index.hbbtv.tv.ts
58
+ index.saphi.tv.ts
59
+ index.tizen.tv.ts
60
+ index.webos.tv.ts
61
+ index.webtv.ts
62
+ ```
63
+ ---
64
+ ## Supported build schemes
49
65
 
50
66
  | *Scheme id* | *Build Environment* | *Usage* |
51
67
  | :----------------- | :-----------------: | ------------------------------------------------------------- |
@@ -58,35 +74,75 @@ it
58
74
  | **release:latest** | production | By CI on merge any pull request into `master` branch |
59
75
  | **release:dist** | production | By CI on merge pull request into `master` branch |
60
76
 
61
- ### 3.1 Schemes with `:latest` postfix
77
+ ### Schemes with `:latest` postfix
62
78
  Scheme names with `:latest` postfix **always deploys into the same location**.
63
79
  In other words, app url is the same for each deployed build.
64
80
 
65
- ### 3.2 `release:dist` scheme
66
- The difference from [schemes with `:latest` postfix](#) is that new builds are not deployed to the same remote folder all the time.
67
- Instead, a new folder is created for each new app version - **builds are versioned and archived**.
81
+ An example:
82
+ ```
83
+ http://smartapps-bigscreen.<PROJECT_NAME>.24imedia.com.s3.amazonaws.com/builds/<PLATFORM>/<FLAVOUR>/latest/dev/...
84
+ http://smartapps-bigscreen.<PROJECT_NAME>.24imedia.com.s3.amazonaws.com/builds/<PLATFORM>/<FLAVOUR>/latest/rc/...
85
+ http://smartapps-bigscreen.<PROJECT_NAME>.24imedia.com.s3.amazonaws.com/builds/<PLATFORM>/<FLAVOUR>/latest/release/...
86
+ ```
87
+
88
+ ### `release:dist` scheme
89
+ The difference from [schemes with `:latest` postfix](#schemes-with-latest-postfix)
90
+ is that new builds are not deployed to the same remote folder all the time.
91
+ Instead, a new folder is created for each new app version.
92
+
93
+ An example:
94
+ ```
95
+ http://smartapps-bigscreen.<PROJECT_NAME>.24imedia.com.s3.amazonaws.com/builds/<PLATFORM>/<FLAVOUR>/dist/v0.0.1/...
96
+ http://smartapps-bigscreen.<PROJECT_NAME>.24imedia.com.s3.amazonaws.com/builds/<PLATFORM>/<FLAVOUR>/dist/v0.0.2/...
97
+ ```
98
+
99
+ ---
100
+ ## Available Webpack Injections
101
+
102
+ The build engine replaces pre-defined variables in project code with values at compile time.
103
+
104
+ Currently, following variable names are configured for replacing:
105
+
106
+ | *Variable Name* | *Type* | *Description* | *Examples* |
107
+ | :-------------------------------------------- | :----: | ------------------------------------------------------- | :-----------------------------------------: |
108
+ | **WEBPACK_INJECTION_APP_CONFIG_ID** | string | flavour id *(value of rnv CLI `-c` param value)* | `'animated_1080'`, `'basic_720'` |
109
+ | **WEBPACK_INJECTION_APP_CREATED** | string | build time in ISO 8601 format | `'2021-07-30T09:18:26.014Z'` |
110
+ | **WEBPACK_INJECTION_APP_RESOLUTION** | string | app resolution in `<WIDTH>x<HEIGHT>` format (in pixels) | `'1920x1080'`, `'1280x720'` |
111
+ | **WEBPACK_INJECTION_APP_VERSION** | string | app version | `'v0.0.1.dev'`, `'v0.0.1.rc-1'`, `'v0.0.1'` |
112
+ | **WEBPACK_INJECTION_APP_ENVIRONMENT** | string | environment used during the build | `'development'`, `'production'` |
113
+ | **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'` |
68
115
 
69
- ## 4. Package content
116
+ An example:
117
+ ```typescript
118
+ const appPlatform: string = WEBPACK_INJECTION_APP_PLATFORM;
70
119
 
71
- ### 4.1 npm dependenncies
72
- All npm dependencies are listed in [package.json](../package.json) file.
120
+ // will be at compile time compiled to
121
+ const appPlatform = 'tizen'; // (or another platform id which is used for build);
122
+ ```
123
+
124
+ ---
125
+ ## Package content
126
+
127
+ ### npm dependenncies
128
+ All npm dependencies are listed in [package.json](package.json) file.
73
129
 
74
130
  However, not all dependencies are directly bundled into a final npm package,
75
- but their will be installed alongside with this package into the project's `node_modules` folder.
131
+ but they will be installed alongside this package into the project's `node_modules` folder.
76
132
 
77
- Because of this, those npm dependencies don't have to be listed in custom project's `package.lock` file
78
- and may be updated only here - from one place.
133
+ Because of this, those npm dependencies don't have to be listed in custom project's `package.json` file
134
+ and can be updated only here - from one place.
79
135
  With this approach, each individual project will use the same version of those dependencies,
80
136
  which simplify the future dependencies update and reduce the amount of time spent with those updates.
81
137
 
82
- #### 4.1.1 ReNative npm dependencies
138
+ #### ReNative npm dependencies
83
139
  Firstly, the package contains main ReNative npm packages, namely:
84
140
 
85
141
  - `renative`
86
142
  - `renative-template-blank`
87
143
  - `rnv`
88
144
 
89
- #### 4.1.2 npm dependencies related to custom ReNative build engine
145
+ #### npm dependencies related to custom ReNative build engine
90
146
  Following dependencies are used in source code for custom build engine for ReNative:
91
147
 
92
148
  - `@24i/smartapps-bigscreen-icon` *(generating SVG icons)*
@@ -95,7 +151,7 @@ Following dependencies are used in source code for custom build engine for ReNat
95
151
  - `node-ssh` *(connection to HbbTV server)*
96
152
  - `svgo` *(generating SVG icons)*
97
153
 
98
- #### 4.1.3 npm dependencies related to webpack
154
+ #### npm dependencies related to webpack
99
155
  The package has also dependencies which are related to build the applications with webpack bundler, namely:
100
156
 
101
157
  - `css-hot-loader`
@@ -114,17 +170,17 @@ The package has also dependencies which are related to build the applications wi
114
170
  - `webpack-cli`
115
171
  - `webpack-dev-server`
116
172
 
117
- #### 4.1.4 other npm dependencies
173
+ #### other npm dependencies
118
174
  There are also dependencies on packages which may be listed in each custom project's dependencies.
119
- However, as they are listed in this package, those npm dependencies don't need to be listed in custom project's `package.lock` file
120
- and may be updated only here - from one place.
175
+ However, as they are listed in this package, those npm dependencies don't need to be listed in custom project's `package.json` file
176
+ and can be updated only here - from one place.
121
177
 
122
178
  - `core-js` *(polyfills collection)*
123
179
  - `coveralls` *(detecting and reporting code coverage)*
124
180
  - `raf` *(`requestAnimationFrame` polyfill)*
125
181
  - `regenerator-runtime` *(runtime support for compiled/transpiled async functions.)*
126
182
 
127
- ### 4.2 Custom build engine for ReNative
183
+ ### Custom build engine for ReNative
128
184
  The package also contains our custom ReNative engine implementation.
129
185
  It allows us to extend the number of platforms we build for
130
186
  (core rnv engine supports only `Tizen` and `webOS` platforms for our purposes).
@@ -133,23 +189,24 @@ Using the custom engine allows us to change the build steps defined in core ReNa
133
189
  Also, custom engine is prepared for deploying the built applications to `AWS S3` and to server specially configured for `HbbTV` builds.
134
190
  Our custom build engine is also configured to deploy releases to `AppCenter.me`, `GitHub` and `Sentry`.
135
191
 
136
- - added support for more platforms (see [supported platforms](#2-supported-platforms))
192
+ - added support for more platforms (see [supported platforms](#supported-platforms))
137
193
  - overwritten rnv tasks (such us `build`, `deploy`)
138
194
  - added automatic installation of `Tizen` and `webOS` SDKs before building the packages
139
195
  - deploy to `AWS S3`, `Appcenter.me`, `GitHub`, `Sentry`
140
- - added support for `Slack` notifications for `release canndidate` and `release` builds
196
+ - added support for `Slack` notifications for `release candidate` and `release` builds
141
197
 
142
- Inside `src/task/` folder, there is a source code for **ReNative tasks** which override core ReNative tasks.
143
- Basically, it's copy-pasted code from core ReNative engine, with changed in many cases only a few lines and rewritten into Typescript.
198
+ Inside [src/tasks/](src/tasks) folder, there is a source code for **ReNative tasks** which overrides core ReNative tasks.
199
+ Basically, it's copy-pasted code from the core ReNative engine that has, in many cases, only a few lines changed and is rewritten into Typescript.
144
200
 
145
- Inside `templates/platforms/` folder, there are **webpack configs** for each platform.
146
- If any platform needs some **platform-specific files**, there are located also in that location.
201
+ Inside [templates/platforms/](templates/platforms) folder, there are **webpack configs** for each platform.
202
+ If any platform needs any **platform-specific files**, those can be found also in that location.
147
203
 
148
- ## 5. How to set up new project with SmartApps BIGscreen build engine
149
- There are a few things which are not included in the package and needs to be added manually.
204
+ ---
205
+ ## How to set up new project with SmartApps BIGscreen build engine
206
+ There are a few things that are not included in the package and need to be added manually.
150
207
  For example `renative.json` config file and `appConfigs` folder (both related to ReNative)
151
208
  and `.travis.yml`config file (related to Travis CI).
152
209
 
153
210
  > To **start a new project** with usage of our build process,
154
211
  > please use [SmartApps BIGscreen Template repository](https://github.com/24i/smartapps-bigscreen-template),
155
- > it uses this package and contains other required configuration files as well.
212
+ > it uses this package and contains other required configuration files as well.
package/dist/src/index.js CHANGED
@@ -33,10 +33,10 @@ const generateEngineExtensions = (platformExtensions) => {
33
33
  const fileExtensions = ['js', 'jsx', 'ts', 'tsx', 'json'];
34
34
  const output = [];
35
35
  fileExtensions.forEach((fileExtension) => {
36
- output.push(fileExtension);
37
36
  platformExtensions.forEach((platformExtension) => {
38
37
  output.push(`${platformExtension}.${fileExtension}`);
39
38
  });
39
+ output.push(fileExtension);
40
40
  });
41
41
  return output;
42
42
  };
@@ -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
  };
@@ -22,7 +22,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.getBaseConfig = exports.isObject = void 0;
23
23
  const fs = __importStar(require("fs"));
24
24
  const path = __importStar(require("path"));
25
- const ConfigManager = __importStar(require("rnv/dist/core/configManager"));
25
+ const rnv_1 = require("rnv");
26
26
  const replaceRelevantStringsInConfig_1 = require("../utils/replaceRelevantStringsInConfig");
27
27
  function isObject(item) {
28
28
  return (item && typeof item === 'object' && !Array.isArray(item));
@@ -52,7 +52,7 @@ const mergeFileJsonIntoObject = (filePath = '', targetObject = {}) => {
52
52
  mergeDeep(targetObject, fileContentAsJSON);
53
53
  };
54
54
  const getBaseConfig = () => {
55
- const c = ConfigManager.createRnvConfig({ ci: true }, process);
55
+ const c = rnv_1.ConfigManager.createRnvConfig({ ci: true }, process);
56
56
  c.buildConfig = {};
57
57
  const packageJsonfileContent = fs.readFileSync('package.json').toString();
58
58
  c.files.project.package = JSON.parse(packageJsonfileContent);
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveZippedPlatformBuildsRelativeFilePath = void 0;
4
- const common_1 = require("rnv/dist/core/common");
4
+ const rnv_1 = require("rnv");
5
5
  const resolveZippedPlatformBuildsRelativeFilePath = (c, platformName) => {
6
6
  const { platformBuildsDir } = c.buildConfig.paths;
7
- const appNameInFileName = common_1.getConfigProp(c, platformName, 'appNameInFileName', '');
8
- const buildVersion = common_1.getConfigProp(c, platformName, 'packageVersion', '');
7
+ const appNameInFileName = rnv_1.Common.getConfigProp(c, platformName, 'appNameInFileName', '');
8
+ const buildVersion = rnv_1.Common.getConfigProp(c, platformName, 'packageVersion', '');
9
9
  const zippedFilesParentDir = 'zipped_by_platform';
10
10
  const fileExtension = 'zip';
11
11
  const relativePathToDir = `${platformBuildsDir}/${zippedFilesParentDir}`;
@@ -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.deployToAppCenter = void 0;
23
23
  const child_process_1 = require("child_process");
24
24
  const fs = __importStar(require("fs"));
25
- const common_1 = require("rnv/dist/core/common");
25
+ const rnv_1 = require("rnv");
26
26
  const resolvers_1 = require("../../resolvers");
27
27
  const urlsMarkdown_1 = require("./urlsMarkdown");
28
28
  const appCenterRelease = (params) => {
@@ -50,14 +50,15 @@ const getTokenByPlatform = (platformName = '') => {
50
50
  return process.env[envVariableName] || '';
51
51
  };
52
52
  const processPlatform = (c, platformName) => {
53
+ const { getConfigProp } = rnv_1.Common;
53
54
  const appCenterConfig = getAppCenterConfigByPlatformName(c, platformName);
54
55
  if (!appCenterConfig)
55
56
  return;
56
57
  const { appName } = appCenterConfig;
57
58
  const token = getTokenByPlatform(platformName);
58
59
  const zipPath = resolvers_1.resolveZippedPlatformBuildsRelativeFilePath(c, platformName);
59
- const buildVersion = common_1.getConfigProp(c, platformName, 'packageVersion', '');
60
- const releaseNotesPath = common_1.getConfigProp(c, platformName, 'releaseNotes', {}).relativePath || '';
60
+ const buildVersion = getConfigProp(c, platformName, 'packageVersion', '');
61
+ const releaseNotesPath = getConfigProp(c, platformName, 'releaseNotes', {}).relativePath || '';
61
62
  if (!appName || !token || !releaseNotesPath || !zipPath || !buildVersion)
62
63
  return;
63
64
  const tempReleaseNotesPath = `RELEASE_NOTES_APPCENTER_${platformName.toUpperCase()}.md`;
@@ -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;
@@ -26,14 +26,13 @@ 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 installer_1 = require("rnv/dist/core/sdkManager/installer");
30
29
  const sdkUtils_1 = require("../sdkUtils");
31
30
  const { execCLI } = rnv_1.Exec;
32
31
  const { CLI_TIZEN, REMOTE_DEBUGGER_ENABLED_PLATFORMS } = rnv_1.Constants;
33
32
  const { getPlatformProjectDir, getAppVersion, getConfigProp, checkPortInUse, confirmActiveBundler, addSystemInjects, } = rnv_1.Common;
34
33
  const { chalk, logTask, logDebug, logError, logSuccess, logWarning, logInfo, } = rnv_1.Logger;
35
34
  const { isPlatformActive } = rnv_1.PlatformManager;
36
- const { writeCleanFile, fsExistsSync } = rnv_1.FileUtils;
35
+ const { writeCleanFile, fsExistsSync, updateObjectSync } = rnv_1.FileUtils;
37
36
  const { buildCoreWebpackProject, runWebpackServer, configureCoreWebProject, waitForWebpack, } = rnv_1.WebpackUtils;
38
37
  const { copyAssetsFolder, copyBuildsFolder } = rnv_1.ProjectManager;
39
38
  const { runTizenSimOrDevice, createDevelopTizenCertificate, DEFAULT_CERTIFICATE_NAME, DEFAULT_SECURITY_PROFILE_NAME, } = rnv_1.SDKManager.Tizen;
@@ -203,7 +202,7 @@ const setTizenCertificate = (c) => {
203
202
  tizen: { certificateProfile: TIZEN_SECURITY_PROFILE_NAME },
204
203
  },
205
204
  };
206
- rnv_1.FileUtils.updateObjectSync(rnvWorkspaceConfigPath, customObjectToMerge);
205
+ updateObjectSync(rnvWorkspaceConfigPath, customObjectToMerge);
207
206
  Object.assign(c.buildConfig, customObjectToMerge);
208
207
  return true;
209
208
  };
@@ -234,7 +233,7 @@ const handleTizenSdk = async (c) => {
234
233
  }
235
234
  }
236
235
  }
237
- await installer_1.checkAndConfigureTizenSdks(c);
236
+ await rnv_1.SDKManager.Installer.checkAndConfigureTizenSdks(c);
238
237
  setTizenCertificate(c);
239
238
  };
240
239
  exports.handleTizenSdk = handleTizenSdk;
@@ -22,14 +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
- const installer_1 = require("rnv/dist/core/sdkManager/installer");
29
27
  const sdkUtils_1 = require("../sdkUtils");
30
28
  const { writeCleanFile } = rnv_1.FileUtils;
31
29
  const { execCLI } = rnv_1.Exec;
32
- 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;
33
31
  const { buildCoreWebpackProject, runWebpackServer, configureCoreWebProject, waitForWebpack, } = rnv_1.WebpackUtils;
34
32
  const { isPlatformActive } = rnv_1.PlatformManager;
35
33
  const { chalk, logTask, logInfo, logSuccess, logError } = rnv_1.Logger;
@@ -95,40 +93,14 @@ const buildWebOSProject = async (c) => {
95
93
  exports.buildWebOSProject = buildWebOSProject;
96
94
  const configureProject = async (c) => {
97
95
  logTask('configureProject');
98
- const { platform } = c;
99
96
  const configFile = 'appinfo.json';
100
- const injects = [
101
- {
102
- pattern: '{{APPLICATION_ID}}',
103
- override: getAppId(c, platform).toLowerCase(),
104
- },
105
- {
106
- pattern: '{{APP_TITLE}}',
107
- override: getAppTitle(c, platform),
108
- },
109
- {
110
- pattern: '{{APP_VERSION}}',
111
- override: semver.coerce(getAppVersion(c, platform)),
112
- },
113
- {
114
- pattern: '{{APP_DESCRIPTION}}',
115
- override: getAppDescription(c, platform),
116
- },
117
- {
118
- pattern: '{{APP_BG_COLOR}}',
119
- override: getConfigProp(c, platform, 'bgColor', '#fff'),
120
- },
121
- {
122
- pattern: '{{APP_ICON_COLOR}}',
123
- override: getConfigProp(c, platform, 'iconColor', '#000'),
124
- },
125
- {
126
- pattern: '{{APP_VENDOR}}',
127
- override: getConfigProp(c, platform, 'vendor', '24i'),
128
- },
129
- ];
130
- addSystemInjects(c, injects);
131
- 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);
132
104
  return true;
133
105
  };
134
106
  const configureWebOSProject = async (c) => {
@@ -140,7 +112,7 @@ const configureWebOSProject = async (c) => {
140
112
  await copyAssetsFolder(c, platform);
141
113
  await configureCoreWebProject(c);
142
114
  await configureProject(c);
143
- copyBuildsFolder(c, platform);
115
+ await copyBuildsFolder(c, platform);
144
116
  };
145
117
  exports.configureWebOSProject = configureWebOSProject;
146
118
  const sdkInstallerUUrl = 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/webos/ares_webos_builder_v1.10.4_multiplatform.zip';
@@ -158,6 +130,6 @@ const handleWebosSdk = async (c) => {
158
130
  await sdkUtils_1.registerSdkPath(c, rnvSdkKey, sdkInstalledToPath);
159
131
  }
160
132
  }
161
- await installer_1.checkAndConfigureWebosSdks(c);
133
+ await rnv_1.SDKManager.Installer.checkAndConfigureWebosSdks(c);
162
134
  };
163
135
  exports.handleWebosSdk = handleWebosSdk;
@@ -23,10 +23,10 @@ exports.customRnvBuildTask = void 0;
23
23
  const child_process_1 = require("child_process");
24
24
  const fs = __importStar(require("fs"));
25
25
  const rnv_1 = require("rnv");
26
- const common_1 = require("rnv/dist/core/common");
27
26
  const constants_1 = require("../constants");
28
27
  const sdks_1 = require("../sdks");
29
28
  const resolvers_1 = require("../resolvers");
29
+ const { getConfigProp, getPlatformBuildDir, getPlatformProjectDir } = rnv_1.Common;
30
30
  const { logErrorPlatform } = rnv_1.PlatformManager;
31
31
  const { logTask } = rnv_1.Logger;
32
32
  const { buildWeb } = sdks_1.SDKWebpack;
@@ -64,18 +64,18 @@ const getBuildVersionForFileName = (c) => {
64
64
  };
65
65
  const makeBuildName = (c) => {
66
66
  const platformName = c.platform;
67
- const appNameInFileName = common_1.getConfigProp(c, platformName, 'appNameInFileName', '');
67
+ const appNameInFileName = getConfigProp(c, platformName, 'appNameInFileName', '');
68
68
  const buildVersion = getBuildVersionForFileName(c);
69
69
  const appConfigId = c.runtime.appId || '';
70
70
  const extension = getPackageExtensionByPlatform(platformName);
71
71
  return `${appNameInFileName}_${platformName}_${buildVersion}_${appConfigId}.${extension}`;
72
72
  };
73
73
  const makeZipOutput = (c) => {
74
- const platformBuildDir = common_1.getPlatformBuildDir(c);
74
+ const platformBuildDir = getPlatformBuildDir(c);
75
75
  const copiedProjectBuildDir = `${platformBuildDir}/build`;
76
76
  const defaultZipFileName = `${c.platform}_${c.runtime.appId}.zip`;
77
77
  const fileName = makeBuildName(c) || defaultZipFileName;
78
- child_process_1.execSync(`cp -r ${common_1.getPlatformProjectDir(c)}/public ${copiedProjectBuildDir}`);
78
+ child_process_1.execSync(`cp -r ${getPlatformProjectDir(c)}/public ${copiedProjectBuildDir}`);
79
79
  child_process_1.execSync(`rm -rf ${platformBuildDir}/output`);
80
80
  child_process_1.execSync(`mkdir ${platformBuildDir}/output`);
81
81
  child_process_1.execSync(`zip -r ../output/${fileName} *`, { cwd: copiedProjectBuildDir });
@@ -1,30 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.customRnvConfigureSoftTask = void 0;
4
- const logger_1 = require("rnv/dist/core/systemManager/logger");
4
+ const rnv_1 = require("rnv");
5
5
  const schemeParser_1 = require("rnv/dist/core/configManager/schemeParser");
6
- const platformManager_1 = require("rnv/dist/core/platformManager");
7
- const runtimeManager_1 = require("rnv/dist/core/runtimeManager");
8
- const taskManager_1 = require("rnv/dist/core/taskManager");
9
- const constants_1 = require("rnv/dist/core/constants");
10
- const installer_1 = require("rnv/dist/core/sdkManager/installer");
11
6
  const replaceRelevantStringsInConfig_1 = require("../utils/replaceRelevantStringsInConfig");
7
+ const { logTask } = rnv_1.Logger;
8
+ const { isPlatformSupported } = rnv_1.PlatformManager;
9
+ const { configureRuntimeDefaults } = rnv_1.RuntimeManager;
10
+ const { executeTask } = rnv_1.TaskManager;
11
+ const { TASK_APP_CONFIGURE, TASK_CONFIGURE_SOFT, PARAMS } = rnv_1.Constants;
12
+ const { checkSdk } = rnv_1.SDKManager.Installer;
12
13
  const configureSoftFn = async (c, parentTask, originTask) => {
13
- logger_1.logTask('taskRnvConfigureSoft');
14
- await runtimeManager_1.configureRuntimeDefaults(c);
15
- await taskManager_1.executeTask(c, constants_1.TASK_APP_CONFIGURE, parentTask, originTask);
16
- await platformManager_1.isPlatformSupported(c);
14
+ logTask('taskRnvConfigureSoft');
15
+ await configureRuntimeDefaults(c);
16
+ await executeTask(c, TASK_APP_CONFIGURE, parentTask, originTask);
17
+ await isPlatformSupported(c);
17
18
  await schemeParser_1.isBuildSchemeSupported(c);
18
- await installer_1.checkSdk(c);
19
- await runtimeManager_1.configureRuntimeDefaults(c);
19
+ await checkSdk(c);
20
+ await configureRuntimeDefaults(c);
20
21
  replaceRelevantStringsInConfig_1.replaceRelevantStringsInConfig(c);
21
22
  return true;
22
23
  };
23
24
  const customRnvConfigureSoftTask = {
24
- description: 'Configure system and project wothout recreating files (used for --only)',
25
+ description: 'Configure system and project without recreating files (used for --only)',
25
26
  fn: configureSoftFn,
26
- task: constants_1.TASK_CONFIGURE_SOFT,
27
- params: constants_1.PARAMS.withBase(),
27
+ task: TASK_CONFIGURE_SOFT,
28
+ params: PARAMS.withBase(),
28
29
  platforms: [],
29
30
  };
30
31
  exports.customRnvConfigureSoftTask = customRnvConfigureSoftTask;
@@ -21,18 +21,19 @@ var __importStar = (this && this.__importStar) || function (mod) {
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.customRnvHooksRunTask = void 0;
23
23
  const inquirer = __importStar(require("inquirer"));
24
- const logger_1 = require("rnv/dist/core/systemManager/logger");
24
+ const rnv_1 = require("rnv");
25
25
  const buildHooks_1 = require("rnv/dist/core/projectManager/buildHooks");
26
- const taskManager_1 = require("rnv/dist/core/taskManager");
27
- const fileutils_1 = require("rnv/dist/core/systemManager/fileutils");
28
- const constants_1 = require("rnv/dist/core/constants");
26
+ const { logTask, logInfo } = rnv_1.Logger;
27
+ const { executeTask } = rnv_1.TaskManager;
28
+ const { fsExistsSync } = rnv_1.FileUtils;
29
+ const { TASK_HOOKS_RUN, TASK_PROJECT_CONFIGURE, PARAMS, PARAM_KEYS } = rnv_1.Constants;
29
30
  const hooksRunFn = async (c, parentTask, originTask) => {
30
- logger_1.logTask('taskRnvHooksRun');
31
- if (fileutils_1.fsExistsSync(c.paths.project.config)) {
32
- await taskManager_1.executeTask(c, constants_1.TASK_PROJECT_CONFIGURE, constants_1.TASK_HOOKS_RUN, originTask);
31
+ logTask('taskRnvHooksRun');
32
+ if (fsExistsSync(c.paths.project.config)) {
33
+ await executeTask(c, TASK_PROJECT_CONFIGURE, TASK_HOOKS_RUN, originTask);
33
34
  }
34
35
  else {
35
- logger_1.logInfo('Your are running your buildHook outside of renative project');
36
+ logInfo('Your are running your buildHook outside of renative project');
36
37
  }
37
38
  await buildHooks_1.buildHooks(c);
38
39
  if (!c.buildHooks) {
@@ -40,10 +41,7 @@ const hooksRunFn = async (c, parentTask, originTask) => {
40
41
  }
41
42
  let hookName = c.program?.exeMethod;
42
43
  let showHookList = false;
43
- if (!hookName || hookName === true) {
44
- showHookList = true;
45
- }
46
- else if (!c.buildHooks[hookName]) {
44
+ if (!hookName || hookName === true || !c.buildHooks[hookName]) {
47
45
  showHookList = true;
48
46
  }
49
47
  if (showHookList) {
@@ -62,8 +60,8 @@ const hooksRunFn = async (c, parentTask, originTask) => {
62
60
  const customRnvHooksRunTask = {
63
61
  description: 'Run specific build hook',
64
62
  fn: hooksRunFn,
65
- task: constants_1.TASK_HOOKS_RUN,
66
- params: constants_1.PARAMS.withBase([constants_1.PARAM_KEYS.exeMethod]),
63
+ task: TASK_HOOKS_RUN,
64
+ params: PARAMS.withBase([PARAM_KEYS.exeMethod]),
67
65
  platforms: [],
68
66
  skipAppConfig: true,
69
67
  skipPlatforms: true,
@@ -2,17 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.customRnvPackageTask = void 0;
4
4
  const rnv_1 = require("rnv");
5
- const common_1 = require("rnv/dist/core/common");
6
- const fileutils_1 = require("rnv/dist/core/systemManager/fileutils");
7
- const resolve_1 = require("rnv/dist/core/systemManager/resolve");
8
- const utils_1 = require("rnv/dist/core/systemManager/utils");
9
5
  const constants_1 = require("../constants");
6
+ const { getConfigProp } = rnv_1.Common;
7
+ const { configureFilesystem } = rnv_1.FileUtils;
8
+ const { doResolve } = rnv_1.Resolver;
9
+ const { isSystemWin } = rnv_1.Utils;
10
10
  const { logTask } = rnv_1.Logger;
11
11
  const { TASK_PACKAGE, TASK_CONFIGURE, PARAMS } = rnv_1.Constants;
12
12
  const { executeOrSkipTask } = rnv_1.TaskManager;
13
13
  const packageFn = async (c, parentTask, originTask) => {
14
14
  logTask('taskRnvPackage', `parent:${parentTask}`);
15
- fileutils_1.configureFilesystem(common_1.getConfigProp, resolve_1.doResolve, utils_1.isSystemWin);
15
+ configureFilesystem(getConfigProp, doResolve, isSystemWin);
16
16
  await executeOrSkipTask(c, TASK_CONFIGURE, TASK_PACKAGE, originTask);
17
17
  return true;
18
18
  };
@@ -21,93 +21,92 @@ var __importStar = (this && this.__importStar) || function (mod) {
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.customRnvProjectConfigureTask = void 0;
23
23
  const path = __importStar(require("path"));
24
- const pluginManager_1 = require("rnv/dist/core/pluginManager");
25
- const logger_1 = require("rnv/dist/core/systemManager/logger");
26
- const configManager_1 = require("rnv/dist/core/configManager");
27
- const runtimeManager_1 = require("rnv/dist/core/runtimeManager");
28
- const templateManager_1 = require("rnv/dist/core/templateManager");
29
- const fileutils_1 = require("rnv/dist/core/systemManager/fileutils");
24
+ const rnv_1 = require("rnv");
30
25
  const crypto_1 = require("rnv/dist/core/systemManager/crypto");
31
- const migrator_1 = require("rnv/dist/core/projectManager/migrator");
32
- const constants_1 = require("rnv/dist/core/constants");
33
- const projectManager_1 = require("rnv/dist/core/projectManager");
34
- const engineManager_1 = require("rnv/dist/core/engineManager");
35
- const taskManager_1 = require("rnv/dist/core/taskManager");
36
26
  const replaceRelevantStringsInConfig_1 = require("../utils/replaceRelevantStringsInConfig");
27
+ const { configurePlugins, overrideTemplatePlugins, resolvePluginDependants, } = rnv_1.PluginManager;
28
+ const { chalk, logTask, logInfo } = rnv_1.Logger;
29
+ const { checkIsRenativeProject, generateRuntimeConfig } = rnv_1.ConfigManager;
30
+ const { updateRenativeConfigs, configureRuntimeDefaults } = rnv_1.RuntimeManager;
31
+ const { applyTemplate, checkIfTemplateConfigured, configureTemplateFiles, isTemplateInstalled, } = rnv_1.TemplateManager;
32
+ const { fsExistsSync, fsMkdirSync } = rnv_1.FileUtils;
33
+ const { TASK_INSTALL, TASK_PROJECT_CONFIGURE, TASK_TEMPLATE_APPLY, TASK_APP_CONFIGURE, TASK_WORKSPACE_CONFIGURE, PARAMS, } = rnv_1.Constants;
34
+ const { checkAndCreateBabelConfig, copyRuntimeAssets, cleanPlaformAssets, checkAndCreateGitignore, versionCheck, } = rnv_1.ProjectManager;
35
+ const { configureEngines, getEngineRunnerByPlatform } = rnv_1.EngineManager;
36
+ const { executeTask, initializeTask, findSuitableTask } = rnv_1.TaskManager;
37
37
  const patchEngineTemplatesPath = (c) => {
38
38
  const templatesPath = path.join(process.cwd(), 'node_modules', '@24i', 'smartapps-bigscreen-rnv-build-engine', 'dist', 'templates');
39
- const engine = engineManager_1.getEngineRunnerByPlatform(c, c.platform);
39
+ const engine = getEngineRunnerByPlatform(c, c.platform);
40
40
  engine.originalTemplatePlatformsDir = path.join(templatesPath, 'platforms');
41
41
  engine.originalTemplateAssetsDir = path.join(templatesPath, 'assets');
42
42
  engine.originalTemplatePlatformProjectDir = path.join(templatesPath, 'platforms', 'project');
43
43
  c.paths.project.platformTemplatesDirs[c.platform] = engine.originalTemplatePlatformsDir;
44
44
  };
45
45
  const projectConfigureFn = async (c, parentTask, originTask) => {
46
- logger_1.logTask('taskRnvProjectConfigure');
46
+ logTask('taskRnvProjectConfigure');
47
47
  patchEngineTemplatesPath(c);
48
- if (c.paths.project.builds.dir && !fileutils_1.fsExistsSync(c.paths.project.builds.dir)) {
49
- logger_1.logInfo(`Creating folder ${c.paths.project.builds.dir} ...DONE`);
50
- fileutils_1.fsMkdirSync(c.paths.project.builds.dir);
48
+ if (c.paths.project.builds.dir && !fsExistsSync(c.paths.project.builds.dir)) {
49
+ logInfo(`Creating folder ${c.paths.project.builds.dir} ...DONE`);
50
+ fsMkdirSync(c.paths.project.builds.dir);
51
51
  }
52
- await migrator_1.checkAndMigrateProject(c);
53
- await runtimeManager_1.updateRenativeConfigs(c);
54
- await configManager_1.checkIsRenativeProject(c);
55
- await taskManager_1.executeTask(c, constants_1.TASK_WORKSPACE_CONFIGURE, constants_1.TASK_PROJECT_CONFIGURE, originTask);
52
+ await updateRenativeConfigs(c);
53
+ await checkIsRenativeProject(c);
54
+ await executeTask(c, TASK_WORKSPACE_CONFIGURE, TASK_PROJECT_CONFIGURE, originTask);
56
55
  if (c.program.only && !!parentTask) {
57
- await runtimeManager_1.configureRuntimeDefaults(c);
58
- await taskManager_1.executeTask(c, constants_1.TASK_APP_CONFIGURE, constants_1.TASK_PROJECT_CONFIGURE, originTask);
59
- await configManager_1.generateRuntimeConfig(c);
56
+ await configureRuntimeDefaults(c);
57
+ await executeTask(c, TASK_APP_CONFIGURE, TASK_PROJECT_CONFIGURE, originTask);
58
+ await generateRuntimeConfig(c);
60
59
  return true;
61
60
  }
62
- await templateManager_1.checkIfTemplateConfigured(c);
63
- await taskManager_1.executeTask(c, constants_1.TASK_INSTALL, constants_1.TASK_PROJECT_CONFIGURE, originTask);
61
+ await checkIfTemplateConfigured(c);
62
+ await executeTask(c, TASK_INSTALL, TASK_PROJECT_CONFIGURE, originTask);
64
63
  await crypto_1.checkCrypto(c, parentTask, originTask);
65
- await runtimeManager_1.configureRuntimeDefaults(c);
66
- if (originTask !== constants_1.TASK_TEMPLATE_APPLY) {
67
- if (c.runtime.requiresBootstrap || !templateManager_1.isTemplateInstalled(c)) {
68
- await templateManager_1.applyTemplate(c);
69
- logger_1.logInfo('Your template has been bootstrapped. RESTARTING...DONE');
70
- const taskInstance = await taskManager_1.findSuitableTask(c);
64
+ await configureRuntimeDefaults(c);
65
+ if (originTask !== TASK_TEMPLATE_APPLY) {
66
+ if (c.runtime.requiresBootstrap || !isTemplateInstalled(c)) {
67
+ await applyTemplate(c);
68
+ logInfo('Your template has been bootstrapped. RESTARTING...DONE');
69
+ const taskInstance = await findSuitableTask(c);
71
70
  c.runtime.requiresBootstrap = false;
72
- return taskManager_1.initializeTask(c, taskInstance.task);
71
+ return initializeTask(c, taskInstance.task);
73
72
  }
74
- await templateManager_1.applyTemplate(c);
75
- await runtimeManager_1.configureRuntimeDefaults(c);
76
- await taskManager_1.executeTask(c, constants_1.TASK_INSTALL, constants_1.TASK_PROJECT_CONFIGURE, originTask);
77
- await taskManager_1.executeTask(c, constants_1.TASK_APP_CONFIGURE, constants_1.TASK_PROJECT_CONFIGURE, originTask);
78
- await projectManager_1.versionCheck(c);
79
- await engineManager_1.configureEngines(c);
80
- await pluginManager_1.resolvePluginDependants(c);
81
- await pluginManager_1.configurePlugins(c);
82
- await runtimeManager_1.configureRuntimeDefaults(c);
73
+ await applyTemplate(c);
74
+ await configureRuntimeDefaults(c);
75
+ await executeTask(c, TASK_INSTALL, TASK_PROJECT_CONFIGURE, originTask);
76
+ await executeTask(c, TASK_APP_CONFIGURE, TASK_PROJECT_CONFIGURE, originTask);
77
+ await versionCheck(c);
78
+ await configureEngines(c);
79
+ await resolvePluginDependants(c);
80
+ await configurePlugins(c);
81
+ await configureRuntimeDefaults(c);
83
82
  if (!c.runtime.disableReset) {
84
83
  if (c.program.resetHard) {
85
- logger_1.logInfo(`You passed ${logger_1.chalk().white('-R, --resetHard')} argument. "${logger_1.chalk().white('./platformAssets')}" will be cleaned up first`);
86
- await projectManager_1.cleanPlaformAssets(c);
84
+ logInfo(`You passed ${chalk().white('-R, --resetHard')} argument. "${chalk().white('./platformAssets')}" will be cleaned up first`);
85
+ await cleanPlaformAssets(c);
87
86
  }
88
87
  else if (c.program.resetAssets) {
89
- logger_1.logInfo(`You passed ${logger_1.chalk().white('-a, --resetAssets')} argument. "${logger_1.chalk().white('./platformAssets')}" will be cleaned up first`);
90
- await projectManager_1.cleanPlaformAssets(c);
88
+ logInfo(`You passed ${chalk().white('-a, --resetAssets')} argument. "${chalk().white('./platformAssets')}" will be cleaned up first`);
89
+ await cleanPlaformAssets(c);
91
90
  }
92
91
  }
93
- await projectManager_1.copyRuntimeAssets(c);
94
- await templateManager_1.configureTemplateFiles(c);
95
- await projectManager_1.checkAndCreateGitignore(c);
96
- await projectManager_1.checkAndCreateBabelConfig(c);
92
+ await copyRuntimeAssets(c);
93
+ await configureTemplateFiles(c);
94
+ await checkAndCreateGitignore(c);
95
+ await checkAndCreateBabelConfig(c);
97
96
  if (!c.buildConfig.platforms) {
98
- await runtimeManager_1.updateRenativeConfigs(c);
97
+ await updateRenativeConfigs(c);
99
98
  }
100
99
  replaceRelevantStringsInConfig_1.replaceRelevantStringsInConfig(c);
101
- await configManager_1.generateRuntimeConfig(c);
102
- await pluginManager_1.overrideTemplatePlugins(c);
100
+ await generateRuntimeConfig(c);
101
+ await overrideTemplatePlugins(c);
103
102
  }
104
103
  return true;
105
104
  };
106
105
  const customRnvProjectConfigureTask = {
107
106
  description: 'Configure current project',
108
107
  fn: projectConfigureFn,
109
- task: constants_1.TASK_PROJECT_CONFIGURE,
110
- params: constants_1.PARAMS.withBase(),
108
+ task: TASK_PROJECT_CONFIGURE,
109
+ params: PARAMS.withBase(),
111
110
  platforms: [],
112
111
  };
113
112
  exports.customRnvProjectConfigureTask = customRnvProjectConfigureTask;
@@ -140,13 +140,14 @@ function generateConfig(config) {
140
140
  ? '@24i/smartapps-bigscreen-device'
141
141
  : '@24i/smartapps-bigscreen-device/resolver',
142
142
  };
143
- if (config.moduleAliases) {
144
- Object.keys(config.moduleAliases).forEach((key) => {
145
- if (typeof config.moduleAliases[key] === 'string') {
146
- aliases[key] = config.moduleAliases[key];
143
+ const { moduleAliases } = config;
144
+ if (moduleAliases) {
145
+ Object.keys(moduleAliases).forEach((key) => {
146
+ if (typeof moduleAliases[key] === 'string') {
147
+ aliases[key] = moduleAliases[key];
147
148
  }
148
- else {
149
- aliases[key] = path_1.default.resolve(projectDir, config.moduleAliases[key].projectPath);
149
+ else if (moduleAliases[key].projectPath) {
150
+ aliases[key] = path_1.default.resolve(projectDir, moduleAliases[key].projectPath);
150
151
  }
151
152
  });
152
153
  }
@@ -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
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@24i/smartapps-bigscreen-rnv-build-engine",
3
- "version": "0.0.2-alpha.1367+b19f25ca",
4
- "description": "Package with build engine for SmartApps BigScreen projects...",
3
+ "version": "0.8.6-alpha.1394+0fca2ad5",
4
+ "description": "Package with build engine for SmartApps BIGscreen projects...",
5
5
  "main": "dist/src/index.js",
6
6
  "scripts": {
7
7
  "build:clean": "rm -rf dist",
@@ -23,7 +23,7 @@
23
23
  "core-js": "3.15.2",
24
24
  "coveralls": "3.1.1",
25
25
  "css-hot-loader": "1.4.4",
26
- "css-loader": "5.2.6",
26
+ "css-loader": "5.2.7",
27
27
  "file-loader": "6.2.0",
28
28
  "filemanager-webpack-plugin": "3.1.1",
29
29
  "fork-ts-checker-webpack-plugin": "6.2.12",
@@ -37,7 +37,7 @@
37
37
  "renative": "0.32.0-alpha.43",
38
38
  "renative-template-blank": "0.32.0-alpha.43",
39
39
  "rnv": "0.32.0-alpha.43",
40
- "sass": "1.35.1",
40
+ "sass": "1.37.0",
41
41
  "sass-loader": "10.1.1",
42
42
  "source-map-loader": "1.1.3",
43
43
  "svgo": "1.3.2",
@@ -47,8 +47,10 @@
47
47
  "webpack-dev-server": "3.11.2"
48
48
  },
49
49
  "devDependencies": {
50
+ "@types/inquirer": "7.3.3",
50
51
  "@types/mini-css-extract-plugin": "1.2.2",
51
52
  "@types/node": "16.3.1",
53
+ "@types/semver": "7.3.8",
52
54
  "@types/ssh2": "0.5.47",
53
55
  "@types/tapable": "1.0.6",
54
56
  "@types/webpack": "4.41.26"
@@ -59,5 +61,5 @@
59
61
  "keywords": [],
60
62
  "author": "24i",
61
63
  "license": "ISC",
62
- "gitHead": "b19f25ca3f6eeddb3a141d2735abe61f7efa96e2"
64
+ "gitHead": "0fca2ad5a9cc12107cb5c33ccbe1fdb1340d1704"
63
65
  }