@fto-consult/expo-ui 1.1.13 → 1.1.14

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.
Files changed (2) hide show
  1. package/index.js +10 -9
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,11 +1,5 @@
1
1
  import { registerRootComponent } from 'expo';
2
- const expoPath = (require("./expo-ui-production-path")+"/").replace("//","/");
3
- const appConfigPath = expoPath+"node_modules/@fto-consult/common/src/app/config";
4
- console.log(expoPath," is expo path found heinnnnn ",appConfigPath," and expo app is ",expoPath+'src/App');
5
- const appConfig = require (appConfigPath);
6
2
 
7
- const isObj = x=>typeof x =='object' && x && !Array.isArray(x);
8
- const defaultObj = x=> isObj(x)? x : {};
9
3
 
10
4
  /**** initialise l'application expoUI avec les paramètres de configuration
11
5
  * les options sont de la forme :
@@ -13,9 +7,16 @@ const defaultObj = x=> isObj(x)? x : {};
13
7
  * config {object}, le fichier de configuration de l'application
14
8
  * }
15
9
  */
16
- export default function registerExpoUIApp (options){
17
- options = defaultObj(options);
10
+ export default function ExpoUIApp (options){
11
+ const expoUIPath = require("./expo-ui-production-path");
12
+ if(expoUIPath && !expoUIPath.includes("@fto-consult/")){
13
+ const path = (expoUIPath+"/").replace("//","/")+"src/index";
14
+ console.log("found local expo-ui dev index path at ",expoUIPath," is expo ui path heinn and path is ",path);
15
+ return require(`${path}`)(options);
16
+ }
17
+ const appConfig = require("$capp/config").default;
18
+ options = options && typeof options =='object' && !Array.isArray(options)? options : {};
18
19
  const config = defaultObj(options.config);
19
20
  appConfig.current = config;
20
- registerRootComponent(require(expoPath+'src/App').default(options));
21
+ registerRootComponent(require('./src/App').default(options));
21
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "1.1.13",
3
+ "version": "1.1.14",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {