@fto-consult/expo-ui 1.1.7 → 1.1.8

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/expo-ui-path.js +16 -3
  2. package/package.json +1 -1
package/expo-ui-path.js CHANGED
@@ -6,10 +6,23 @@ const fs = require("fs");
6
6
  const path = require("path");
7
7
  const dir = path.resolve(__dirname)
8
8
  let devExpoUIPath = path.resolve(dir);
9
- const parentPackage = require("./parent-package");
10
- if(parentPackage){
11
- console.log(parentPackage," is parent packag path heinn")
9
+ const lookupForExpoUIPath = ()=>{
10
+ let level = 4; //jusqu'à 4 niveaux
11
+ let expoUIPath= null;
12
+ let rootPath = path.resolve(dir);
13
+ while(level>0 && !expoUIPath){
14
+ rootPath = path.resolve(rootPath,"..");
15
+ const p = path.resolve(rootPath,"expo-ui");
16
+ if(fs.existsSync(p) && fs.existsSync(path.resolve(rootPath,"node_modules") && fs.existsSync(path.resolve(rootPath,"src")))){
17
+ expoUIPath = p;
18
+ break;
19
+ }
20
+ level = level-1;
21
+ }
22
+ console.log("has lookup ",expoUIPath);
23
+ return expoUIPath;
12
24
  }
25
+ lookupForExpoUIPath();
13
26
  ///retourne le chemin vers le package @expo-ui
14
27
  module.exports = (()=>{
15
28
  const isDev = fs.existsSync(devExpoUIPath) && fs.existsSync(path.resolve(devExpoUIPath,"babel.config.alias.js"))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {