@fto-consult/expo-ui 7.5.40 → 7.5.41

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/bin/index.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  /**
4
4
  toujours ajouter l'instruction ci-dessus à la première ligne de chaque script npx
package/electron/index.js CHANGED
@@ -31,9 +31,11 @@ const isAsar = (typeof require.main =="string" && require.main ||"").indexOf('ap
31
31
  const distPath = path.join("dist",'index.html');
32
32
 
33
33
  const processCWD = process.cwd();
34
+ const asarPath = path.resolve(processCWD,"resources","app.asar");
34
35
  const electronProjectRoot = mainProjectRoot && typeof mainProjectRoot =='string' && fs.existsSync(path.resolve(mainProjectRoot)) && fs.existsSync(path.resolve(mainProjectRoot,distPath)) && path.resolve(mainProjectRoot) || null;
35
36
  const projectRoot = electronProjectRoot || fs.existsSync(path.resolve(processCWD,"electron")) && fs.existsSync(path.resolve(processCWD,"electron",distPath)) && path.resolve(processCWD,"electron")
36
- || fs.existsSync(path.resolve(processCWD,distPath)) && path.resolve(processCWD) || processCWD;
37
+ || fs.existsSync(path.resolve(processCWD,distPath)) && path.resolve(processCWD) || fs.existsSync(asarPath) && fs.existsSync(path.relative(asarPath,"dist")) && asarPath ||
38
+ processCWD;
37
39
  const packageJSONPath = fs.existsSync(processCWD,"package.json")? path.resolve(processCWD,"package.json") : path.resolve(projectRoot,"package.json");
38
40
  const packageJSON = fs.existsSync(packageJSONPath) ? Object.assign({},require(`${packageJSONPath}`)) : {};
39
41
  const appName = typeof packageJSON.realAppName =='string' && packageJSON.realAppName || typeof packageJSON.name =="string" && packageJSON.name || "";
@@ -49,10 +51,11 @@ const mainProcessIndex = projectRoot && fs.existsSync(path.resolve(projectRoot,m
49
51
  const mainProcessRequired = mainProcessIndex && require(`${mainProcessIndex}`);
50
52
  //pour étendre les fonctionnalités au niveau du main proceess, bien vouloir écrire dans le fichier projectRoot/electron/main/index.js
51
53
  const mainProcess = mainProcessRequired && typeof mainProcessRequired =='object'? mainProcessRequired : {};
54
+ const execPath = app.getPath ('exe') || process.execPath;
52
55
 
53
56
  // Gardez une reference globale de l'objet window, si vous ne le faites pas, la fenetre sera
54
57
  if(!isValidUrl(pUrl) && !fs.existsSync(indexFilePath)){
55
- throw {message:`Unable to start the application: index file located at [${indexFilePath}] does not exists : projectRoot = [${projectRoot}], isAsar:[${require.main}]`}
58
+ throw {message:`Unable to start the application: index file located at [${indexFilePath}] does not exists : projectRoot = [${projectRoot}], exec path is ${execPath}`}
56
59
  }
57
60
 
58
61
  const quit = ()=>{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.5.40",
3
+ "version": "7.5.41",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",