@24i/smartapps-bigscreen-rnv-build-engine 0.17.1-alpha.2145 → 0.17.1-alpha.2146
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.
|
@@ -32,17 +32,23 @@ const path_1 = __importDefault(require("path"));
|
|
|
32
32
|
const getFirstExistingPackageJson = (projectDir, modulePath, packageName) => {
|
|
33
33
|
const firstPackageJsonPath = path_1.default.resolve(`node_modules/${modulePath}`, 'package.json');
|
|
34
34
|
const secondPackageJsonPath = path_1.default.resolve(`${projectDir}/node_modules/${packageName}`, 'package.json');
|
|
35
|
-
const resolvedPath = fs.existsSync(firstPackageJsonPath)
|
|
36
|
-
|
|
35
|
+
const resolvedPath = fs.existsSync(firstPackageJsonPath)
|
|
36
|
+
? firstPackageJsonPath
|
|
37
|
+
: secondPackageJsonPath;
|
|
38
|
+
if (fs.existsSync(resolvedPath)) {
|
|
39
|
+
const fileContent = fs.readFileSync(resolvedPath).toString();
|
|
40
|
+
return JSON.parse(fileContent);
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
37
43
|
};
|
|
38
44
|
const resolvePackageVersions = (projectDir, { sdkName = '@24i/bigscreen-sdk', wlName = '@24i/bigscreen-wl', dlName = '@24i/smartapps-backstage-dl', } = {}) => {
|
|
39
45
|
const packageWl = getFirstExistingPackageJson(projectDir, wlName);
|
|
40
46
|
const packageSdk = getFirstExistingPackageJson(projectDir, `${wlName}/node_modules/${sdkName}`, sdkName);
|
|
41
47
|
const packageDl = getFirstExistingPackageJson(projectDir, `${wlName}/node_modules/${dlName}`, dlName);
|
|
42
48
|
return {
|
|
43
|
-
wl:
|
|
44
|
-
sdk:
|
|
45
|
-
dl:
|
|
49
|
+
wl: packageWl?.version || '',
|
|
50
|
+
sdk: packageSdk?.version || '',
|
|
51
|
+
dl: packageDl?.version || ''
|
|
46
52
|
};
|
|
47
53
|
};
|
|
48
54
|
exports.resolvePackageVersions = resolvePackageVersions;
|
package/package.json
CHANGED