@24i/smartapps-bigscreen-rnv-build-engine 0.0.2-alpha.1349 → 0.0.2-alpha.1351
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.js +2 -5
- package/dist/src/resolvers/resolveDeployLocations.js +20 -4
- package/dist/src/resolvers/resolveGenericRnvConfig.js +5 -8
- package/dist/src/scripts/release/deployToAppCenter.js +21 -5
- package/dist/src/scripts/release/githubRelease.js +23 -7
- package/dist/src/scripts/release/sentryRelease.js +20 -4
- package/dist/src/scripts/utils/cmdUtils.js +8 -8
- package/dist/src/scripts/utils/fsUtils.js +26 -7
- package/dist/src/scripts/utils/gitUtils.js +52 -32
- package/dist/src/scripts/utils/index.js +24 -9
- package/dist/src/scripts/utils/stringUtils.js +3 -3
- package/dist/src/sdks/sdk-tizen/index.js +46 -30
- package/dist/src/sdks/sdk-webos/index.js +25 -9
- package/dist/src/sdks/sdkUtils.js +4 -4
- package/dist/src/tasks/deploy/aswS3/aws.js +20 -4
- package/dist/src/tasks/deploy/aswS3/deployS3.js +5 -8
- package/dist/src/tasks/deploy/hbbtv/deployHbbtv.js +5 -8
- package/dist/src/tasks/task.rnv.build.js +22 -6
- package/dist/src/tasks/task.rnv.hooks.run.js +20 -4
- package/dist/src/tasks/task.rnv.start.js +20 -4
- package/dist/src/utils/zipBuildsByPlatforms.js +20 -4
- package/dist/templates/platforms/_shared/template.js +2 -1
- package/dist/templates/platforms/_shared/webpack.base.js +35 -20
- package/dist/templates/platforms/entone/webpack.config.dev.js +23 -3
- package/dist/templates/platforms/entone/webpack.config.prod.js +23 -3
- package/dist/templates/platforms/hbbtv/webpack.config.dev.js +23 -3
- package/dist/templates/platforms/hbbtv/webpack.config.prod.js +23 -3
- package/dist/templates/platforms/tizen/webpack.config.dev.js +23 -3
- package/dist/templates/platforms/tizen/webpack.config.prod.js +23 -3
- package/dist/templates/platforms/webos/webpack.config.dev.js +23 -3
- package/dist/templates/platforms/webos/webpack.config.prod.js +23 -3
- package/dist/templates/platforms/webtv/webpack.config.dev.js +23 -3
- package/dist/templates/platforms/webtv/webpack.config.prod.js +23 -3
- package/dist/types/src/scripts/utils/index.d.ts +4 -5
- package/dist/types/src/types/c.d.ts +4 -0
- package/dist/types/templates/platforms/_shared/template.d.ts +1 -1
- package/dist/types/templates/platforms/_shared/webpack.base.d.ts +80 -1
- package/dist/types/templates/platforms/entone/webpack.config.dev.d.ts +2 -2
- package/dist/types/templates/platforms/entone/webpack.config.prod.d.ts +2 -2
- package/dist/types/templates/platforms/hbbtv/webpack.config.dev.d.ts +2 -2
- package/dist/types/templates/platforms/hbbtv/webpack.config.prod.d.ts +2 -2
- package/dist/types/templates/platforms/tizen/webpack.config.dev.d.ts +2 -2
- package/dist/types/templates/platforms/tizen/webpack.config.prod.d.ts +2 -2
- package/dist/types/templates/platforms/webos/webpack.config.dev.d.ts +2 -2
- package/dist/types/templates/platforms/webos/webpack.config.prod.d.ts +2 -2
- package/dist/types/templates/platforms/webtv/webpack.config.dev.d.ts +2 -2
- package/dist/types/templates/platforms/webtv/webpack.config.prod.d.ts +2 -2
- package/package.json +5 -3
package/dist/src/index.js
CHANGED
|
@@ -18,9 +18,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
-
};
|
|
24
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
22
|
exports.Resolvers = exports.Constants = void 0;
|
|
26
23
|
const rnv_1 = require("rnv");
|
|
@@ -28,7 +25,7 @@ const Constants = __importStar(require("./constants"));
|
|
|
28
25
|
exports.Constants = Constants;
|
|
29
26
|
const Resolvers = __importStar(require("./resolvers"));
|
|
30
27
|
exports.Resolvers = Resolvers;
|
|
31
|
-
const
|
|
28
|
+
const CNF = __importStar(require("../../renative.engine.json"));
|
|
32
29
|
const constants_1 = require("./constants");
|
|
33
30
|
const engineTasks_1 = require("./tasks/engineTasks");
|
|
34
31
|
const { generateEngineTasks } = rnv_1.EngineManager;
|
|
@@ -46,7 +43,7 @@ const generateEngineExtensions = (platformExtensions = []) => {
|
|
|
46
43
|
exports.default = {
|
|
47
44
|
initializeRuntimeConfig: (c) => rnv_1.Config.initializeConfig(c),
|
|
48
45
|
tasks: generateEngineTasks(engineTasks_1.engineTaskList),
|
|
49
|
-
config:
|
|
46
|
+
config: CNF,
|
|
50
47
|
projectDirName: 'project',
|
|
51
48
|
serverDirName: 'server',
|
|
52
49
|
ejectPlatform: null,
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
4
20
|
};
|
|
5
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
22
|
exports.resolveDeployLocations = void 0;
|
|
7
|
-
const
|
|
23
|
+
const fs = __importStar(require("fs"));
|
|
8
24
|
const resolveBuildVersion_1 = require("./resolveBuildVersion");
|
|
9
25
|
const resolveBaseUrl_1 = require("./resolveBaseUrl");
|
|
10
26
|
const resolveHbbtvDeployUrl_1 = require("./resolveHbbtvDeployUrl");
|
|
@@ -44,7 +60,7 @@ const makeUrls = (c, platformName, flavourName) => {
|
|
|
44
60
|
if (!baseUrl)
|
|
45
61
|
return null;
|
|
46
62
|
const packageOutputDirPath = `platformBuilds/${flavourName}_${platformName}/output`;
|
|
47
|
-
const outputFilenameList =
|
|
63
|
+
const outputFilenameList = fs.readdirSync(packageOutputDirPath);
|
|
48
64
|
const packageFileName = outputFilenameList[0];
|
|
49
65
|
const packageUrl = packageFileName ? `${baseUrl}/build/${packageFileName}` : '';
|
|
50
66
|
const indexUrl = isHbbTVPlatform
|
|
@@ -18,13 +18,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
-
};
|
|
24
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
22
|
exports.getBaseConfig = exports.isObject = void 0;
|
|
26
|
-
const
|
|
27
|
-
const
|
|
23
|
+
const fs = __importStar(require("fs"));
|
|
24
|
+
const path = __importStar(require("path"));
|
|
28
25
|
const ConfigManager = __importStar(require("rnv/dist/core/configManager"));
|
|
29
26
|
const replaceRelevantStringsInConfig_1 = require("../utils/replaceRelevantStringsInConfig");
|
|
30
27
|
function isObject(item) {
|
|
@@ -50,17 +47,17 @@ const mergeDeep = (target, ...sources) => {
|
|
|
50
47
|
return mergeDeep(target, ...sources);
|
|
51
48
|
};
|
|
52
49
|
const mergeFileJsonIntoObject = (filePath = '', targetObject = {}) => {
|
|
53
|
-
const fileContentAsString =
|
|
50
|
+
const fileContentAsString = fs.readFileSync(filePath).toString();
|
|
54
51
|
const fileContentAsJSON = JSON.parse(fileContentAsString);
|
|
55
52
|
mergeDeep(targetObject, fileContentAsJSON);
|
|
56
53
|
};
|
|
57
54
|
const getBaseConfig = () => {
|
|
58
55
|
const c = ConfigManager.createRnvConfig({ ci: true }, process);
|
|
59
56
|
c.buildConfig = {};
|
|
60
|
-
const packageJsonfileContent =
|
|
57
|
+
const packageJsonfileContent = fs.readFileSync('package.json').toString();
|
|
61
58
|
c.files.project.package = JSON.parse(packageJsonfileContent);
|
|
62
59
|
mergeFileJsonIntoObject(c.paths.project.config, c.buildConfig);
|
|
63
|
-
const baseConfigPath =
|
|
60
|
+
const baseConfigPath = path.join(c.paths.project.appConfigBase.dir, 'renative.json');
|
|
64
61
|
mergeFileJsonIntoObject(baseConfigPath, c.buildConfig);
|
|
65
62
|
replaceRelevantStringsInConfig_1.replaceRelevantStringsInConfig(c);
|
|
66
63
|
return c;
|
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
4
20
|
};
|
|
5
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
22
|
exports.deployToAppCenter = void 0;
|
|
7
23
|
const child_process_1 = require("child_process");
|
|
8
|
-
const
|
|
24
|
+
const fs = __importStar(require("fs"));
|
|
9
25
|
const common_1 = require("rnv/dist/core/common");
|
|
10
26
|
const resolvers_1 = require("../../resolvers");
|
|
11
27
|
const urlsMarkdown_1 = require("./urlsMarkdown");
|
|
@@ -45,8 +61,8 @@ const processPlatform = (c, platformName) => {
|
|
|
45
61
|
if (!appName || !token || !releaseNotesPath || !zipPath || !buildVersion)
|
|
46
62
|
return;
|
|
47
63
|
const tempReleaseNotesPath = `RELEASE_NOTES_APPCENTER_${platformName.toUpperCase()}.md`;
|
|
48
|
-
if (
|
|
49
|
-
|
|
64
|
+
if (fs.existsSync(tempReleaseNotesPath)) {
|
|
65
|
+
fs.unlinkSync(tempReleaseNotesPath);
|
|
50
66
|
}
|
|
51
67
|
child_process_1.execSync(`cat ${releaseNotesPath} >> ${tempReleaseNotesPath}`);
|
|
52
68
|
const urlsMarkdown = urlsMarkdown_1.getUrlsMarkdown(c, [platformName]);
|
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
4
20
|
};
|
|
5
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
22
|
exports.githubRelease = void 0;
|
|
7
23
|
const child_process_1 = require("child_process");
|
|
8
|
-
const
|
|
24
|
+
const fs = __importStar(require("fs"));
|
|
9
25
|
const assert_1 = require("assert");
|
|
10
26
|
const path_1 = require("path");
|
|
11
27
|
const resolvers_1 = require("../../resolvers");
|
|
@@ -37,8 +53,8 @@ const getReleaseNotesPath = (c) => {
|
|
|
37
53
|
}
|
|
38
54
|
};
|
|
39
55
|
const deleteFileIfExists = (filePath) => {
|
|
40
|
-
if (
|
|
41
|
-
|
|
56
|
+
if (fs.existsSync(filePath)) {
|
|
57
|
+
fs.unlinkSync(filePath);
|
|
42
58
|
}
|
|
43
59
|
};
|
|
44
60
|
const makeGitHubReleaseNotes = (c) => {
|
|
@@ -58,7 +74,7 @@ const createRelease = (c) => {
|
|
|
58
74
|
ok(git.repo, 'Missing value for rnv config prop: common.git.repo');
|
|
59
75
|
ok(packageVersion);
|
|
60
76
|
makeGitHubReleaseNotes(c);
|
|
61
|
-
const releaseNotesContent =
|
|
77
|
+
const releaseNotesContent = fs.readFileSync(githubReleaseNotesPath).toString();
|
|
62
78
|
const data = {
|
|
63
79
|
tag_name: versionLabel,
|
|
64
80
|
target_commitish: targetCommit,
|
|
@@ -88,7 +104,7 @@ const uploadAsset = (uploadUrl = '', filePath) => {
|
|
|
88
104
|
if (!uploadUrl)
|
|
89
105
|
return null;
|
|
90
106
|
const url = `${uploadUrl.replace('{?name,label}', '')}`;
|
|
91
|
-
const headers = `-H "Accept: ${githubContentType}" -H "Authorization: token ${token}" -H "content-type: ${getFileMimeType(filePath)}" -H "content-length: ${
|
|
107
|
+
const headers = `-H "Accept: ${githubContentType}" -H "Authorization: token ${token}" -H "content-type: ${getFileMimeType(filePath)}" -H "content-length: ${fs.statSync(filePath).size}"`;
|
|
92
108
|
const cmd = `curl --data-binary @"${filePath}" ${headers} ${url}?name=${path_1.basename(filePath)}`;
|
|
93
109
|
console.log(`Uploading ${filePath} asset to created GitHub Release...`);
|
|
94
110
|
const responseString = child_process_1.execSync(cmd, { stdio: 'pipe' }).toString();
|
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
4
20
|
};
|
|
5
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
22
|
exports.sentryRelease = void 0;
|
|
7
23
|
const child_process_1 = require("child_process");
|
|
8
|
-
const
|
|
24
|
+
const fs = __importStar(require("fs"));
|
|
9
25
|
const constants_1 = require("../../constants");
|
|
10
26
|
const UNSUPPORTED_PLATFORMS = [constants_1.Platforms.WEBTV];
|
|
11
27
|
const executeSync = (cmd) => child_process_1.execSync(cmd, { stdio: 'inherit' });
|
|
@@ -37,7 +53,7 @@ const processPlatform = (c, platform, version) => {
|
|
|
37
53
|
const { platformBuildsDir } = c.buildConfig.paths;
|
|
38
54
|
const mapsPath = `${platformBuildsDir}/${flavour}_${platform}-public/public/content/js`;
|
|
39
55
|
const urlPrefix = `builds/${platform}/${flavour}/dist/${version}/public/content/js/`;
|
|
40
|
-
if (!
|
|
56
|
+
if (!fs.existsSync(mapsPath))
|
|
41
57
|
return;
|
|
42
58
|
console.log(`Uploading ${flavour}_${platform} sourcemaps to Sentry...`);
|
|
43
59
|
uploadSourceMaps({ version, sourceMapsPath: mapsPath, urlPrefix });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cmdSyncTrimOut = exports.cmdSyncPipeOut = exports.cmdSyncInheritOut = exports.cmdSync = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const cmdSync = (command, options) => child_process_1.execSync(command, options);
|
|
6
|
+
exports.cmdSync = cmdSync;
|
|
4
7
|
const cmdSyncInheritOut = (command) => cmdSync(command, { stdio: 'inherit' });
|
|
8
|
+
exports.cmdSyncInheritOut = cmdSyncInheritOut;
|
|
5
9
|
const cmdSyncPipeOut = (command) => cmdSync(command, { stdio: 'pipe' });
|
|
10
|
+
exports.cmdSyncPipeOut = cmdSyncPipeOut;
|
|
6
11
|
const cmdSyncTrimOut = (command) => cmdSync(command).toString().trim();
|
|
7
|
-
|
|
8
|
-
cmdSync,
|
|
9
|
-
cmdSyncInheritOut,
|
|
10
|
-
cmdSyncPipeOut,
|
|
11
|
-
cmdSyncTrimOut,
|
|
12
|
-
};
|
|
12
|
+
exports.cmdSyncTrimOut = cmdSyncTrimOut;
|
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.assertPath = exports.getFileContentAsString = void 0;
|
|
23
|
+
const fs = __importStar(require("fs"));
|
|
24
|
+
const assert = __importStar(require("assert"));
|
|
4
25
|
const getFileContentAsString = (filePath) => fs.readFileSync(filePath).toString();
|
|
26
|
+
exports.getFileContentAsString = getFileContentAsString;
|
|
5
27
|
const assertPath = (path) => {
|
|
6
28
|
const errorMsg = `File or path ${path} does not exist!`;
|
|
7
|
-
ok(fs.existsSync(path), errorMsg);
|
|
8
|
-
};
|
|
9
|
-
module.exports = {
|
|
10
|
-
getFileContentAsString,
|
|
11
|
-
assertPath,
|
|
29
|
+
assert.strict.ok(fs.existsSync(path), errorMsg);
|
|
12
30
|
};
|
|
31
|
+
exports.assertPath = assertPath;
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
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;
|
|
23
|
+
const assert = __importStar(require("assert"));
|
|
24
|
+
const cmdUtils_1 = require("./cmdUtils");
|
|
25
|
+
const stringUtils_1 = require("./stringUtils");
|
|
26
|
+
const { ok } = assert.strict;
|
|
5
27
|
const statusList = () => {
|
|
6
28
|
const gitCmd = 'git status --porcelain';
|
|
7
|
-
const outputString = cmdSyncTrimOut(gitCmd);
|
|
29
|
+
const outputString = cmdUtils_1.cmdSyncTrimOut(gitCmd);
|
|
8
30
|
if (!outputString)
|
|
9
31
|
return [];
|
|
10
32
|
const handleMultipleWhitespaces = (rowString) => {
|
|
@@ -12,67 +34,65 @@ const statusList = () => {
|
|
|
12
34
|
const parts = rowString.split(spaceChar);
|
|
13
35
|
return parts.filter(Boolean).join(spaceChar);
|
|
14
36
|
};
|
|
15
|
-
return splitByNewLine(outputString).map(handleMultipleWhitespaces);
|
|
37
|
+
return stringUtils_1.splitByNewLine(outputString).map(handleMultipleWhitespaces);
|
|
16
38
|
};
|
|
17
|
-
|
|
39
|
+
exports.statusList = statusList;
|
|
40
|
+
const getCurrentBranchName = () => cmdUtils_1.cmdSyncTrimOut('git branch --show-current');
|
|
41
|
+
exports.getCurrentBranchName = getCurrentBranchName;
|
|
18
42
|
const pullRequest = (fromBranch, toBranch, prTitle) => {
|
|
19
43
|
const cmdTool = 'hub';
|
|
20
44
|
const installDocUrl = 'https://github.com/github/hub#installation';
|
|
21
45
|
const errorMsg = `${cmdTool} is not installed! See ${installDocUrl}\n`;
|
|
22
46
|
try {
|
|
23
|
-
const toolPath = cmdSyncTrimOut(`${cmdTool} --version`);
|
|
47
|
+
const toolPath = cmdUtils_1.cmdSyncTrimOut(`${cmdTool} --version`);
|
|
24
48
|
ok(toolPath, errorMsg);
|
|
25
49
|
}
|
|
26
50
|
catch (error) {
|
|
27
51
|
throw new Error(errorMsg);
|
|
28
52
|
}
|
|
29
53
|
const cmd = `${cmdTool} pull-request -m "${prTitle}" --head ${fromBranch} --base ${toBranch}`;
|
|
30
|
-
cmdSyncInheritOut(cmd);
|
|
54
|
+
cmdUtils_1.cmdSyncInheritOut(cmd);
|
|
31
55
|
};
|
|
56
|
+
exports.pullRequest = pullRequest;
|
|
32
57
|
const remoteBranchExists = (expectedBranchName) => {
|
|
33
58
|
const gitCmd = `git ls-remote --heads origin ${expectedBranchName}`;
|
|
34
|
-
const output = cmdSyncTrimOut(gitCmd);
|
|
59
|
+
const output = cmdUtils_1.cmdSyncTrimOut(gitCmd);
|
|
35
60
|
return Boolean(output);
|
|
36
61
|
};
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
62
|
+
exports.remoteBranchExists = remoteBranchExists;
|
|
63
|
+
const pull = () => cmdUtils_1.cmdSyncPipeOut('git remote update -p && git merge --ff-only @{u}');
|
|
64
|
+
exports.pull = pull;
|
|
65
|
+
const addAll = () => cmdUtils_1.cmdSyncPipeOut('git add --all');
|
|
66
|
+
exports.addAll = addAll;
|
|
67
|
+
const add = (fileList) => cmdUtils_1.cmdSyncPipeOut(`git add ${fileList.join(' ')}`);
|
|
68
|
+
exports.add = add;
|
|
69
|
+
const checkout = (branchName) => cmdUtils_1.cmdSyncPipeOut(`git checkout ${branchName}`);
|
|
70
|
+
exports.checkout = checkout;
|
|
71
|
+
const createBranch = (branchName) => cmdUtils_1.cmdSyncPipeOut(`git branch ${branchName}`);
|
|
72
|
+
exports.createBranch = createBranch;
|
|
42
73
|
const commit = (commitMessage, noVerify) => {
|
|
43
74
|
const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
|
|
44
|
-
return cmdSyncPipeOut(`git commit -m "${commitMessage}" ${maybeNoVerifyParam}`.trimEnd());
|
|
75
|
+
return cmdUtils_1.cmdSyncPipeOut(`git commit -m "${commitMessage}" ${maybeNoVerifyParam}`.trimEnd());
|
|
45
76
|
};
|
|
77
|
+
exports.commit = commit;
|
|
46
78
|
const push = (branchName, noVerify) => {
|
|
47
79
|
const maybeNoVerifyParam = noVerify ? '--no-verify' : '';
|
|
48
80
|
const cmd = `git push --set-upstream origin ${branchName} ${maybeNoVerifyParam}`.trimEnd();
|
|
49
|
-
return cmdSyncPipeOut(cmd);
|
|
81
|
+
return cmdUtils_1.cmdSyncPipeOut(cmd);
|
|
50
82
|
};
|
|
83
|
+
exports.push = push;
|
|
51
84
|
const assertEmptyStatusList = () => {
|
|
52
85
|
ok(statusList().length === 0, 'An empty GIT stage is expected!');
|
|
53
86
|
};
|
|
87
|
+
exports.assertEmptyStatusList = assertEmptyStatusList;
|
|
54
88
|
const assertCurrentBranch = (expectedBranchName) => {
|
|
55
89
|
const currentGitBranchName = getCurrentBranchName();
|
|
56
90
|
const errorMsg = `The ${expectedBranchName} branch is expected to be active, not "${currentGitBranchName}"`;
|
|
57
91
|
ok(currentGitBranchName === expectedBranchName, errorMsg);
|
|
58
92
|
};
|
|
93
|
+
exports.assertCurrentBranch = assertCurrentBranch;
|
|
59
94
|
const assertRemoteBranch = (expectedBranchName) => {
|
|
60
95
|
const errorMsg = `Remote branch ${expectedBranchName} does not exist!`;
|
|
61
96
|
ok(remoteBranchExists(expectedBranchName), errorMsg);
|
|
62
97
|
};
|
|
63
|
-
|
|
64
|
-
statusList,
|
|
65
|
-
getCurrentBranchName,
|
|
66
|
-
pullRequest,
|
|
67
|
-
remoteBranchExists,
|
|
68
|
-
pull,
|
|
69
|
-
addAll,
|
|
70
|
-
add,
|
|
71
|
-
checkout,
|
|
72
|
-
createBranch,
|
|
73
|
-
commit,
|
|
74
|
-
push,
|
|
75
|
-
assertEmptyStatusList,
|
|
76
|
-
assertCurrentBranch,
|
|
77
|
-
assertRemoteBranch,
|
|
78
|
-
};
|
|
98
|
+
exports.assertRemoteBranch = assertRemoteBranch;
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
11
20
|
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.stringUtils = exports.gitUtils = exports.fsUtils = exports.cmdUtils = void 0;
|
|
23
|
+
exports.cmdUtils = __importStar(require("./cmdUtils"));
|
|
24
|
+
exports.fsUtils = __importStar(require("./fsUtils"));
|
|
25
|
+
exports.gitUtils = __importStar(require("./gitUtils"));
|
|
26
|
+
exports.stringUtils = __importStar(require("./stringUtils"));
|
|
@@ -1,17 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
4
20
|
};
|
|
5
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
22
|
exports.runTizen = exports.handleTizenSdk = exports.configureTizenProject = exports.configureTizenGlobal = exports.buildTizenProject = void 0;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
23
|
+
const fs = __importStar(require("fs"));
|
|
24
|
+
const path = __importStar(require("path"));
|
|
25
|
+
const os = __importStar(require("os"));
|
|
26
|
+
const semver = __importStar(require("semver"));
|
|
11
27
|
const rnv_1 = require("rnv");
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
28
|
+
const child_process_1 = require("child_process");
|
|
29
|
+
const installer_1 = require("rnv/dist/core/sdkManager/installer");
|
|
30
|
+
const sdkUtils_1 = require("../sdkUtils");
|
|
15
31
|
const { execCLI } = rnv_1.Exec;
|
|
16
32
|
const { CLI_TIZEN, REMOTE_DEBUGGER_ENABLED_PLATFORMS } = rnv_1.Constants;
|
|
17
33
|
const { getPlatformProjectDir, getAppVersion, getConfigProp, checkPortInUse, confirmActiveBundler, addSystemInjects, } = rnv_1.Common;
|
|
@@ -24,7 +40,7 @@ const { runTizenSimOrDevice, createDevelopTizenCertificate, DEFAULT_CERTIFICATE_
|
|
|
24
40
|
const DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION = `${DEFAULT_CERTIFICATE_NAME}.p12`;
|
|
25
41
|
const configureTizenGlobal = (c) => new Promise((resolve, reject) => {
|
|
26
42
|
logTask('configureTizenGlobal');
|
|
27
|
-
const authorCert =
|
|
43
|
+
const authorCert = path.join(c.paths.workspace.dir, DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION);
|
|
28
44
|
if (fsExistsSync(authorCert)) {
|
|
29
45
|
logDebug(`${DEFAULT_CERTIFICATE_NAME_WITH_EXTENSION} file exists!`);
|
|
30
46
|
resolve();
|
|
@@ -100,9 +116,9 @@ const buildTizenProject = async (c) => {
|
|
|
100
116
|
const { buildConfig, platform } = c;
|
|
101
117
|
const platformConfig = buildConfig.platforms[platform];
|
|
102
118
|
const projectDir = getPlatformProjectDir(c);
|
|
103
|
-
const projectParentDir =
|
|
104
|
-
const tBuild =
|
|
105
|
-
const tOut =
|
|
119
|
+
const projectParentDir = path.join(projectDir, '..');
|
|
120
|
+
const tBuild = path.join(projectParentDir, 'build');
|
|
121
|
+
const tOut = path.join(projectParentDir, 'output');
|
|
106
122
|
const certProfile = (_a = platformConfig.certificateProfile) !== null && _a !== void 0 ? _a : DEFAULT_SECURITY_PROFILE_NAME;
|
|
107
123
|
await execCLI(c, CLI_TIZEN, `build-web -- ${projectDir} -out ${tBuild}`);
|
|
108
124
|
await execCLI(c, CLI_TIZEN, `package -- ${tBuild} -s ${certProfile} -t wgt -o ${tOut}`);
|
|
@@ -121,10 +137,10 @@ const configureProject = (c) => new Promise((resolve) => {
|
|
|
121
137
|
{ pattern: '{{PACKAGE}}', override: p.package },
|
|
122
138
|
{ pattern: '{{ID}}', override: p.id },
|
|
123
139
|
{ pattern: '{{APP_NAME}}', override: p.appName },
|
|
124
|
-
{ pattern: '{{APP_VERSION}}', override:
|
|
140
|
+
{ pattern: '{{APP_VERSION}}', override: semver.coerce(getAppVersion(c, platform)) },
|
|
125
141
|
];
|
|
126
142
|
addSystemInjects(c, injects);
|
|
127
|
-
const file =
|
|
143
|
+
const file = path.join(getPlatformProjectDir(c), configFile);
|
|
128
144
|
writeCleanFile(file, file, injects, null, c);
|
|
129
145
|
resolve();
|
|
130
146
|
});
|
|
@@ -146,19 +162,19 @@ const configureTizenProject = async (c) => {
|
|
|
146
162
|
};
|
|
147
163
|
exports.configureTizenProject = configureTizenProject;
|
|
148
164
|
const handleLinuxKeyring = () => {
|
|
149
|
-
if (process.env.CI &&
|
|
165
|
+
if (process.env.CI && os.platform() === 'linux') {
|
|
150
166
|
const options = { stdio: 'inherit' };
|
|
151
|
-
execSync('eval $(dbus-launch --sh-syntax)', options);
|
|
152
|
-
execSync('mkdir -p ~/.cache', options);
|
|
153
|
-
execSync('mkdir -p ~/.local/share/keyrings', options);
|
|
154
|
-
execSync('eval "$(printf \'\\n\' | gnome-keyring-daemon --unlock)"', options);
|
|
155
|
-
execSync('eval "$(printf \'\\n\' | /usr/bin/gnome-keyring-daemon --start)"', options);
|
|
167
|
+
child_process_1.execSync('eval $(dbus-launch --sh-syntax)', options);
|
|
168
|
+
child_process_1.execSync('mkdir -p ~/.cache', options);
|
|
169
|
+
child_process_1.execSync('mkdir -p ~/.local/share/keyrings', options);
|
|
170
|
+
child_process_1.execSync('eval "$(printf \'\\n\' | gnome-keyring-daemon --unlock)"', options);
|
|
171
|
+
child_process_1.execSync('eval "$(printf \'\\n\' | /usr/bin/gnome-keyring-daemon --start)"', options);
|
|
156
172
|
}
|
|
157
173
|
};
|
|
158
174
|
const setTizenCertificate = (c) => {
|
|
159
175
|
const { TIZEN_SECURITY_PROFILE_NAME = '24i-SmartApps-BigScreen', TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH = 'certificates/24i_smartapps_bigscreen_author.p12', TIZEN_AUTHOR_CERTIFICATE_PASSWORD, } = process.env;
|
|
160
176
|
const tizenCliPath = c.cli.tizen;
|
|
161
|
-
if (!
|
|
177
|
+
if (!fs.existsSync(TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH)) {
|
|
162
178
|
console.log(`'process.env.TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH' points to not existing location: ${TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH}`);
|
|
163
179
|
return false;
|
|
164
180
|
}
|
|
@@ -170,7 +186,7 @@ const setTizenCertificate = (c) => {
|
|
|
170
186
|
console.log('\'c.cli.tizen\' is not set');
|
|
171
187
|
return false;
|
|
172
188
|
}
|
|
173
|
-
const spawnSyncReturn = spawnSync(tizenCliPath, [
|
|
189
|
+
const spawnSyncReturn = child_process_1.spawnSync(tizenCliPath, [
|
|
174
190
|
'security-profiles', 'add',
|
|
175
191
|
'-n', TIZEN_SECURITY_PROFILE_NAME,
|
|
176
192
|
'-a', TIZEN_AUTHOR_CERTIFICATE_RELATIVE_PATH,
|
|
@@ -193,7 +209,7 @@ const setTizenCertificate = (c) => {
|
|
|
193
209
|
return true;
|
|
194
210
|
};
|
|
195
211
|
const getSdkInstallerUrl = () => {
|
|
196
|
-
switch (
|
|
212
|
+
switch (os.platform()) {
|
|
197
213
|
case 'darwin':
|
|
198
214
|
return 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/tizen/tizen_builder_v3.7_mac.zip';
|
|
199
215
|
case 'linux':
|
|
@@ -206,21 +222,21 @@ const handleTizenSdk = async (c) => {
|
|
|
206
222
|
var _a;
|
|
207
223
|
const { TIZEN_SDK_INSTALLER_URL = getSdkInstallerUrl() } = process.env;
|
|
208
224
|
const { TIZEN_SDK } = ((_a = c.buildConfig) === null || _a === void 0 ? void 0 : _a.sdks) || {};
|
|
209
|
-
const installPath = `${
|
|
225
|
+
const installPath = `${os.homedir()}/tizen-studio`;
|
|
210
226
|
const rnvSdkKey = 'TIZEN_SDK';
|
|
211
227
|
if (!TIZEN_SDK) {
|
|
212
228
|
handleLinuxKeyring();
|
|
213
|
-
if (
|
|
214
|
-
await registerSdkPath(c, rnvSdkKey, installPath);
|
|
229
|
+
if (fs.existsSync(installPath)) {
|
|
230
|
+
await sdkUtils_1.registerSdkPath(c, rnvSdkKey, installPath);
|
|
215
231
|
}
|
|
216
232
|
else {
|
|
217
|
-
const sdkInstalledToPath = await installSdk(TIZEN_SDK_INSTALLER_URL, installPath);
|
|
233
|
+
const sdkInstalledToPath = await sdkUtils_1.installSdk(TIZEN_SDK_INSTALLER_URL, installPath);
|
|
218
234
|
if (sdkInstalledToPath) {
|
|
219
|
-
await registerSdkPath(c, rnvSdkKey, sdkInstalledToPath);
|
|
235
|
+
await sdkUtils_1.registerSdkPath(c, rnvSdkKey, sdkInstalledToPath);
|
|
220
236
|
}
|
|
221
237
|
}
|
|
222
238
|
}
|
|
223
|
-
await checkAndConfigureTizenSdks(c);
|
|
239
|
+
await installer_1.checkAndConfigureTizenSdks(c);
|
|
224
240
|
setTizenCertificate(c);
|
|
225
241
|
};
|
|
226
242
|
exports.handleTizenSdk = handleTizenSdk;
|