@fto-consult/expo-ui 7.4.1 → 7.4.3
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/init.js +2 -2
- package/electron/index.js +5 -3
- package/electron/init/main.js +17 -1
- package/electron/is-initialized.js +2 -2
- package/electron/pload.js +3 -2
- package/electron/utils/index.js +1 -1
- package/package.json +1 -1
package/bin/init.js
CHANGED
@@ -37,8 +37,8 @@ module.exports = ({projectRoot,electronProjectRoot})=>{
|
|
37
37
|
if(!fs.existsSync(electronProjectRootPackage)){
|
38
38
|
throw `unable to create ${electronProjectRootPackage} file`;
|
39
39
|
}
|
40
|
-
const mainFolder = path.resolve(electronProjectRoot,"main");
|
41
|
-
const rendererFolder = path.resolve(electronProjectRoot,"renderer");
|
40
|
+
const mainFolder = path.resolve(electronProjectRoot,'processes',"main");
|
41
|
+
const rendererFolder = path.resolve(electronProjectRoot,'processes',"renderer");
|
42
42
|
if(!createDir(mainFolder)){
|
43
43
|
throw `unable to create main process folder at ${mainFolder}`
|
44
44
|
}
|
package/electron/index.js
CHANGED
@@ -9,7 +9,8 @@ if(!fs.existsSync(path.resolve(ePath,"paths.json"))){
|
|
9
9
|
const paths = require("./paths.json");
|
10
10
|
const projectRoot = paths.projectRoot || '';
|
11
11
|
const electronProjectRoot = projectRoot && fs.existsSync(path.resolve(projectRoot,"electron")) && path.resolve(projectRoot,"electron") || null;
|
12
|
-
const
|
12
|
+
const mainProcessPath = path.resolve('processes',"main","index.js");
|
13
|
+
const mainProcessIndex = electronProjectRoot && fs.existsSync(path.resolve(electronProjectRoot,mainProcessPath)) && path.resolve(electronProjectRoot,mainProcessPath);
|
13
14
|
const mainProcessRequired = mainProcessIndex && require(`${mainProcessIndex}`);
|
14
15
|
//pour étendre les fonctionnalités au niveau du main proceess, bien vouloir écrire dans le fichier projectRoot/electron/main/index.js
|
15
16
|
const mainProcess = mainProcessRequired && typeof mainProcessRequired =='object'? mainProcessRequired : {};
|
@@ -275,10 +276,11 @@ ipcMain.on("electron-toggle-dev-tools",function(event,value) {
|
|
275
276
|
|
276
277
|
|
277
278
|
app.whenReady().then(() => {
|
279
|
+
const readOpts = {toggleDevTools,window:win,win};
|
278
280
|
if(typeof mainProcess.whenReady =='function'){
|
279
|
-
mainProcess.whenReady();
|
281
|
+
mainProcess.whenReady(readOpts);
|
280
282
|
} else if(typeof mainProcess.appOnReady =='function'){
|
281
|
-
mainProcess.appOnReady();
|
283
|
+
mainProcess.appOnReady(readOpts);
|
282
284
|
}
|
283
285
|
globalShortcut.register('CommandOrControl+F12', () => {
|
284
286
|
toggleDevTools();
|
package/electron/init/main.js
CHANGED
@@ -7,4 +7,20 @@
|
|
7
7
|
* }
|
8
8
|
*/
|
9
9
|
|
10
|
-
module.exports = {
|
10
|
+
module.exports = {
|
11
|
+
/*****
|
12
|
+
@must return Instance of Browser window
|
13
|
+
width: 500, height: 400, transparent: true, frame: false,
|
14
|
+
alwaysOnTop: true
|
15
|
+
*/
|
16
|
+
splashScreen : function({width, height, transparent, frame, alwaysOnTop}){
|
17
|
+
return null;
|
18
|
+
},
|
19
|
+
/*** this function is called when app is ready
|
20
|
+
toggleDevTools : {function},la fonction permettant de toggle les outils de developements
|
21
|
+
window : {BrowserWindow}, le browser window principal de l'application
|
22
|
+
*/
|
23
|
+
whenReady : function({toggleDevTools,window,win}){
|
24
|
+
|
25
|
+
}
|
26
|
+
}
|
@@ -5,8 +5,8 @@ module.exports = (projectRoot)=>{
|
|
5
5
|
projectRoot = typeof projectRoot =='string' && projectRoot && fs.existsSync(projectRoot) && projectRoot || process.cwd();
|
6
6
|
return fs.existsSync(path.resolve(projectRoot,"node_modules")) && fs.existsSync(path.resolve(projectRoot,"index.js"))
|
7
7
|
&& fs.existsSync(path.resolve(projectRoot,"package.json"))
|
8
|
-
&& fs.existsSync(path.resolve(projectRoot,"main"))
|
9
|
-
&& fs.existsSync(path.resolve(projectRoot,"renderer"))
|
8
|
+
&& fs.existsSync(path.resolve(projectRoot,'processes',"main","index.js"))
|
9
|
+
&& fs.existsSync(path.resolve(projectRoot,'processes',"renderer","index.js"))
|
10
10
|
|
11
11
|
&& true || false;
|
12
12
|
}
|
package/electron/pload.js
CHANGED
@@ -101,8 +101,9 @@ module.exports = (ELECTRON,paths)=>{
|
|
101
101
|
|
102
102
|
const projectRoot = (paths || {}).projectRoot;
|
103
103
|
const electronProjectRoot = projectRoot && fs.existsSync(path.resolve(projectRoot,"electron")) && path.resolve(projectRoot,"electron") || null;
|
104
|
-
const
|
105
|
-
|
104
|
+
const mainRendererPath = path.resolve('processes',"renderer","index.js");
|
105
|
+
const rendererProcessIndex = electronProjectRoot && fs.existsSync(path.resolve(electronProjectRoot,mainRendererPath)) && path.resolve(electronProjectRoot,mainRendererPath);
|
106
|
+
//pour étendre les fonctionnalités au niveau du renderer proceess, bien vouloir écrire dans le fichier projectRoot/electron/processes/renderer/index.js
|
106
107
|
// dans lequel exporter une fonction prenant en paramètre l'objet electron, que l'on peut étendre et le rendre accessible depuis l'application
|
107
108
|
const rendererProcess = rendererProcessIndex && require(`${rendererProcessIndex}`);
|
108
109
|
(typeof rendererProcess ==='function') && rendererProcess(ELECTRON);
|
package/electron/utils/index.js
CHANGED