@fto-consult/expo-ui 1.1.30 → 1.1.32
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 +4 -3
- package/expo-ui-path.js +1 -20
- package/lookup-expo-ui-path.js +24 -0
- package/package.json +1 -1
package/babel.config.alias.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const path = require("path");
|
|
2
2
|
module.exports = (opts)=>{
|
|
3
3
|
const dir = path.resolve(__dirname);
|
|
4
|
-
const expo = path.resolve(dir,"src");
|
|
5
4
|
const assets = path.resolve(dir,"assets");
|
|
6
5
|
opts = typeof opts =='object' && opts ? opts : {};
|
|
7
6
|
opts.platform = "expo";
|
|
@@ -9,7 +8,10 @@ module.exports = (opts)=>{
|
|
|
9
8
|
opts.base = opts.base || dir;
|
|
10
9
|
opts.withPouchDB = opts.withPouchDB !== false && opts.withPouchdb !== false ? true : false;
|
|
11
10
|
delete opts.withPouchdb;
|
|
12
|
-
const
|
|
11
|
+
const src = path.resolve(opts.base);
|
|
12
|
+
const expo = require("./lookup-expo-ui-path")()?path.resolve(src,"..","expo-ui") : path.resolve(dir,"src");
|
|
13
|
+
console.log(expo," is expo heee ",`${expo}/node_modules/common/babel.config.alias`);
|
|
14
|
+
const r = require(`${expo}/node_modules/common/babel.config.alias`)(opts);
|
|
13
15
|
r["$eauth"] = path.resolve(expo,"auth");
|
|
14
16
|
r["$ecomponents"] = r["$expo-components"] = path.resolve(expo,"components");
|
|
15
17
|
r["$components"] = r["$components"] || r["$ecomponents"];
|
|
@@ -67,7 +69,6 @@ module.exports = (opts)=>{
|
|
|
67
69
|
if(!r["$logoComponent"]){
|
|
68
70
|
r["$logoComponent"] = r["$elogoComponent"];
|
|
69
71
|
}
|
|
70
|
-
|
|
71
72
|
if(typeof opts.mutator =='function'){
|
|
72
73
|
opts.mutator(r);
|
|
73
74
|
}
|
package/expo-ui-path.js
CHANGED
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const path = require("path");
|
|
7
|
-
const dir = path.resolve(__dirname)
|
|
8
7
|
///retourne le chemin vers le package @expo-ui
|
|
9
8
|
module.exports = function (...args){
|
|
10
9
|
const suffix = path.join(...args);
|
|
11
|
-
const p =
|
|
10
|
+
const p = require("./lookup-expo-ui-path")();
|
|
12
11
|
const sep = path.sep;
|
|
13
12
|
if(p && fs.existsSync(p)){
|
|
14
13
|
const rootPath = path.resolve(p,"..");
|
|
@@ -20,21 +19,3 @@ module.exports = function (...args){
|
|
|
20
19
|
return suffix ? path.join("@fto-consult/expo-ui",suffix).replace(sep,"/"):"@fto-consult/expo-ui";
|
|
21
20
|
};
|
|
22
21
|
|
|
23
|
-
const lookupForExpoUIPath = ()=>{
|
|
24
|
-
let level = 4; //jusqu'à 4 niveaux
|
|
25
|
-
let expoUIPath= null;
|
|
26
|
-
let rootPath = path.resolve(dir);
|
|
27
|
-
while(level>0 && !expoUIPath){
|
|
28
|
-
const p = path.resolve(rootPath,"expo-ui");
|
|
29
|
-
const nPath = path.resolve(rootPath,"node_modules");
|
|
30
|
-
const srcPath = path.resolve(rootPath,"src");
|
|
31
|
-
const babelPath = path.resolve(rootPath,"babel.config.js");
|
|
32
|
-
if(fs.existsSync(p) && fs.existsSync(nPath) && fs.existsSync(srcPath) && fs.existsSync(babelPath)){
|
|
33
|
-
expoUIPath = p;
|
|
34
|
-
return expoUIPath;
|
|
35
|
-
}
|
|
36
|
-
rootPath = path.resolve(rootPath,"..");
|
|
37
|
-
level = level-1;
|
|
38
|
-
}
|
|
39
|
-
return expoUIPath;
|
|
40
|
-
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright 2022 @fto-consult/Boris Fouomene. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const dir = path.resolve(__dirname)
|
|
7
|
+
module.exports = function lookupForExpoUIPath (){
|
|
8
|
+
let level = 4; //jusqu'à 4 niveaux
|
|
9
|
+
let expoUIPath= null;
|
|
10
|
+
let rootPath = path.resolve(dir);
|
|
11
|
+
while(level>0 && !expoUIPath){
|
|
12
|
+
const p = path.resolve(rootPath,"expo-ui");
|
|
13
|
+
const nPath = path.resolve(rootPath,"node_modules");
|
|
14
|
+
const srcPath = path.resolve(rootPath,"src");
|
|
15
|
+
const babelPath = path.resolve(rootPath,"babel.config.js");
|
|
16
|
+
if(fs.existsSync(p) && fs.existsSync(nPath) && fs.existsSync(srcPath) && fs.existsSync(babelPath)){
|
|
17
|
+
expoUIPath = p;
|
|
18
|
+
return expoUIPath;
|
|
19
|
+
}
|
|
20
|
+
rootPath = path.resolve(rootPath,"..");
|
|
21
|
+
level = level-1;
|
|
22
|
+
}
|
|
23
|
+
return expoUIPath;
|
|
24
|
+
}
|