@fto-consult/expo-ui 7.5.25 → 7.5.27

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.
@@ -9,10 +9,12 @@ module.exports = ({electronProjectRoot,force,appName})=>{
9
9
  }
10
10
  const indexPath = path.resolve(electronProjectRoot,"index.js");
11
11
  if(true || !fs.existsSync(indexPath) || force === true){
12
- writeFile(indexPath,`module.exports = require("${packageJSON.name}/electron/index.js")({
13
- projectRoot : "${electronProjectRoot}",
14
- appName : "${appName}"
15
- })`);
12
+ writeFile(indexPath,`
13
+ module.exports = require("${packageJSON.name}/electron/index.js")({
14
+ projectRoot : __dirname,
15
+ appName : "${appName}"
16
+ })
17
+ `);
16
18
  }
17
19
  return indexPath;
18
20
  }
package/electron/index.js CHANGED
@@ -17,11 +17,13 @@ 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)) ? mainProjectRoot : null;
21
- const projectRoot = electronProjectRoot || fs.existsSync(path.resolve(processCWD,"electron")) && fs.existsSync(path.resolve(processCWD,"electron",distPath)) ? path.resolve(processCWD,"electron") : undefined;
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
 
25
+ throw `electron project root is ${electronProjectRoot} and project root is ${projectRoot}`;
26
+
25
27
  const ObjectSize = (object)=>{
26
28
  if(!object || typeof object !=='object' || Array.isArray(object)) return false;
27
29
  for(let i in object){
@@ -39,7 +41,7 @@ function mainExportedApp (options){
39
41
  }
40
42
  options.packageJSON = ObjectSize(options.packageJSON) && options.packageJSON || packageJSON;
41
43
  if(!ObjectSize(options.packageJSON)){
42
- if(options.projectRoot && fs.existsSync(path.resolve(options.projectRoot,"package.json"))){
44
+ if(options.projectRoot && typeof options.projectRoot =='string' && fs.existsSync(path.resolve(options.projectRoot,"package.json"))){
43
45
  options.packageJSON = require(path.resolve(options.projectRoot,"package.json"));
44
46
  }
45
47
  }
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.5.25",
3
+ "version": "7.5.27",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",