@fto-consult/expo-ui 7.5.24 → 7.5.26
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.
@@ -3,14 +3,18 @@ const writeFile = require("../electron/utils/writeFile");
|
|
3
3
|
const path = require("path");
|
4
4
|
const packageJSON = require("../package.json");
|
5
5
|
|
6
|
-
module.exports = ({electronProjectRoot,
|
6
|
+
module.exports = ({electronProjectRoot,force,appName})=>{
|
7
7
|
if(!electronProjectRoot || typeof electronProjectRoot !='string' || !fs.existsSync(electronProjectRoot)){
|
8
8
|
return null;
|
9
9
|
}
|
10
10
|
const indexPath = path.resolve(electronProjectRoot,"index.js");
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
if(true || !fs.existsSync(indexPath) || force === true){
|
12
|
+
writeFile(indexPath,`
|
13
|
+
module.exports = require("${packageJSON.name}/electron/index.js")({
|
14
|
+
projectRoot : __dirname,
|
15
|
+
appName : "${appName}"
|
16
|
+
})
|
17
|
+
`);
|
18
|
+
}
|
15
19
|
return indexPath;
|
16
20
|
}
|
package/electron/index.js
CHANGED
@@ -17,8 +17,8 @@ const isValidUrl = require("./utils/isValidUrl");
|
|
17
17
|
|
18
18
|
const distPath = path.join("dist",'index.html');
|
19
19
|
const processCWD = process.cwd();
|
20
|
-
const electronProjectRoot = mainProjectRoot && fs.existsSync(mainProjectRoot) && fs.existsSync(path.resolve(mainProjectRoot,distPath))
|
21
|
-
const projectRoot = electronProjectRoot || fs.existsSync(path.resolve(processCWD,"electron")) && fs.existsSync(path.resolve(processCWD,"electron",distPath))
|
20
|
+
const electronProjectRoot = mainProjectRoot && typeof mainProjectRoot =='string' && fs.existsSync(mainProjectRoot) && fs.existsSync(path.resolve(mainProjectRoot,distPath)) && mainProjectRoot || null;
|
21
|
+
const projectRoot = electronProjectRoot || fs.existsSync(path.resolve(processCWD,"electron")) && fs.existsSync(path.resolve(processCWD,"electron",distPath)) && path.resolve(processCWD,"electron") || undefined;
|
22
22
|
const packageJSONPath = fs.existsSync(processCWD,"package.json")? path.resolve(processCWD,"package.json") : path.resolve(projectRoot,"package.json");
|
23
23
|
const packageJSON = fs.existsSync(packageJSONPath) ? require(`${packageJSONPath}`) : {};
|
24
24
|
|
@@ -39,7 +39,7 @@ function mainExportedApp (options){
|
|
39
39
|
}
|
40
40
|
options.packageJSON = ObjectSize(options.packageJSON) && options.packageJSON || packageJSON;
|
41
41
|
if(!ObjectSize(options.packageJSON)){
|
42
|
-
if(options.projectRoot && fs.existsSync(path.resolve(options.projectRoot,"package.json"))){
|
42
|
+
if(options.projectRoot && typeof options.projectRoot =='string' && fs.existsSync(path.resolve(options.projectRoot,"package.json"))){
|
43
43
|
options.packageJSON = require(path.resolve(options.projectRoot,"package.json"));
|
44
44
|
}
|
45
45
|
}
|
File without changes
|