@fto-consult/expo-ui 6.20.18 → 6.20.20
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/babel.config.alias.js +5 -5
- package/index.js +3 -7
- package/package.json +1 -1
package/babel.config.alias.js
CHANGED
|
@@ -3,12 +3,12 @@ const fs = require("fs");
|
|
|
3
3
|
const writeFile = require("./electron/utils/writeFile");
|
|
4
4
|
module.exports = (opts)=>{
|
|
5
5
|
const dir = path.resolve(__dirname);
|
|
6
|
-
const
|
|
6
|
+
const projectRoot = typeof opts.projectRoot =='string' && fs.existsSync(opts.projectRoot.trim()) && opts.projectRoot.trim() || process.cwd();
|
|
7
7
|
const assets = path.resolve(dir,"assets");
|
|
8
8
|
opts = typeof opts =='object' && opts ? opts : {};
|
|
9
9
|
opts.platform = "expo";
|
|
10
10
|
opts.assets = opts.assets || opts.alias && typeof opts.alias =='object' && opts.alias.$assets || assets;
|
|
11
|
-
opts.
|
|
11
|
+
opts.projectRoot = opts.projectRoot || projectRoot;
|
|
12
12
|
opts.withPouchDB = opts.withPouchDB !== false && opts.withPouchdb !== false ? true : false;
|
|
13
13
|
delete opts.withPouchdb;
|
|
14
14
|
const expoUI = require("./expo-ui-path")();
|
|
@@ -77,7 +77,7 @@ module.exports = (opts)=>{
|
|
|
77
77
|
const HelpScreen = path.resolve(r["$escreens"],"Help");
|
|
78
78
|
///on génère les librairies open sources utilisées par l'application
|
|
79
79
|
const root = path.resolve(r.$src,"..");
|
|
80
|
-
const nModulePath = fs.existsSync(path.resolve(root,"node_modules")) && path.resolve(root,"node_modules") || fs.existsSync(path.resolve(r.$src,"node_modules")) && path.resolve(r.$src,"node_modules") || path.resolve(
|
|
80
|
+
const nModulePath = fs.existsSync(path.resolve(root,"node_modules")) && path.resolve(root,"node_modules") || fs.existsSync(path.resolve(r.$src,"node_modules")) && path.resolve(r.$src,"node_modules") || path.resolve(projectRoot,"node_modules");
|
|
81
81
|
const nodeModulesPath = fs.existsSync(nModulePath) ? nModulePath : path.resolve(process.cwd(),"node_modules");
|
|
82
82
|
const outputPath = path.resolve(HelpScreen,"openLibraries.js");
|
|
83
83
|
r.$nodeModulesPath = r.$enodeModulesPath= nodeModulesPath;
|
|
@@ -93,7 +93,7 @@ module.exports = (opts)=>{
|
|
|
93
93
|
sourceCode : r.$src,
|
|
94
94
|
assets : $assets,
|
|
95
95
|
images : r.$images,
|
|
96
|
-
projectRoot :
|
|
96
|
+
projectRoot : projectRoot,//la racine au projet
|
|
97
97
|
electron : $electron,//le chemin racine electron
|
|
98
98
|
};
|
|
99
99
|
//le chemin ver le repertoire electron
|
|
@@ -114,7 +114,7 @@ module.exports = (opts)=>{
|
|
|
114
114
|
electronPaths.logo = logoPath;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
const jsonPath = path.resolve(
|
|
117
|
+
const jsonPath = path.resolve(projectRoot,'package.json');
|
|
118
118
|
if(fs.existsSync(jsonPath)){
|
|
119
119
|
require("./electron/utils/copy")(jsonPath,path.resolve(dir,"electron","package.app.json"));
|
|
120
120
|
}
|
package/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { registerRootComponent } from "expo";
|
|
2
2
|
import {Platform,AppRegistry } from 'react-native';
|
|
3
|
-
import apConfig from '$capp/config';
|
|
4
3
|
import App from "./src/App";
|
|
5
4
|
import Provider from "$econtext/Provider";
|
|
6
5
|
const isWeb = Platform.OS === "web";
|
|
@@ -18,13 +17,10 @@ const isWeb = Platform.OS === "web";
|
|
|
18
17
|
* }
|
|
19
18
|
*/
|
|
20
19
|
export default function registerApp ({onMount,onUnmount,onRender,render,swrConfig,init,...rest}){
|
|
21
|
-
|
|
22
|
-
return AppRegistry.registerComponent(appConfing.name,()=>{
|
|
23
|
-
return <Provider {...rest} swrConfig={isObj(swrConfig) && swrConfig || {}} children={<App init={init} render={render} onMount={onMount} onUnmount={onUnmount} onRender={onRender}/>}/>
|
|
24
|
-
});
|
|
25
|
-
return registerRootComponent(function(props){
|
|
20
|
+
const component = function(props){
|
|
26
21
|
return <Provider {...props} {...rest} swrConfig={isObj(swrConfig) && swrConfig || {}} children={<App init={init} render={render} onMount={onMount} onUnmount={onUnmount} onRender={onRender}/>}/>
|
|
27
|
-
}
|
|
22
|
+
};
|
|
23
|
+
return isWeb ? registerRootComponent(component) : AppRegistry.registerComponent('main',() => component);
|
|
28
24
|
}
|
|
29
25
|
|
|
30
26
|
///fix bug lié au fait que l'application stuck on splashscreen en environnement mobile
|