@fto-consult/expo-ui 7.4.26 → 7.4.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.
package/electron/index.js CHANGED
@@ -314,8 +314,8 @@ app.whenReady().then(() => {
314
314
  })
315
315
 
316
316
  ipcMain.on("electron-restart-app",x =>{app.relaunch();})
317
- let tray = null;
318
- let isJSON = function (json_string){
317
+ let tray = null;
318
+ let isJSON = function (json_string){
319
319
  if(!json_string || typeof json_string != 'string') return false;
320
320
  var text = json_string;
321
321
  return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g, '')));
@@ -357,6 +357,14 @@ ipcMain.on("electron-get-path",(event,pathName)=>{
357
357
  return p;
358
358
  });
359
359
 
360
+ ipcMain.on("electron-get-package-json",(event)=>{
361
+ const packageJSON = path.resolve(projectRoot,"package.json");
362
+ if(fs.existsSync(packageJSON)){
363
+ return JSON.stringify(require(packageJSON));
364
+ }
365
+ return JSON.stringify({});
366
+ });
367
+
360
368
  ipcMain.on("electron-get-media-access-status",(event,mediaType)=>{
361
369
  let p = systemPreferences.getMediaAccessStatus(mediaType);
362
370
  event.returnValue = p;
@@ -6,12 +6,8 @@ const path = require("path");
6
6
  const fs = require("fs");
7
7
  const isObj = x=>x && typeof x =='object' && !Array.isArray(x);
8
8
  const isNonNullString = x=>x && typeof x =='string';
9
- const ePath = path.resolve(__dirname);
10
- const packagePath = path.resolve(ePath,"package.json");
11
- if(!fs.existsSync(packagePath)){
12
- throw {message : "Chemin du fichier "+packagePath+ " introuvable"};
13
- }
14
- const _app = require(`${packagePath}`);
9
+ const packageJSONStr = ipcRenderer.sendSync("electron-get-package-json");
10
+ const _app = packageJSONStr ? JSON.parse(packageJSONStr) : {};
15
11
  if(!_app || typeof _app !=='object' || typeof _app.name !=='string'){
16
12
  throw {message : "Contenu du fichier "+packagePath+" invalide!! Veuillez spécifier un nom valide d'application, propriété <<name>> dudit fichier"}
17
13
  }
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.4.26",
3
+ "version": "7.4.27",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "main",
6
6
  "scripts": {