@fto-consult/expo-ui 8.20.7 → 8.21.0

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.
@@ -11,7 +11,7 @@ module.exports = (opts)=>{
11
11
  opts.projectRoot = opts.projectRoot || projectRoot;
12
12
  opts.withPouchDB = opts.withPouchDB !== false && opts.withPouchdb !== false ? true : false;
13
13
  delete opts.withPouchdb;
14
- const expoUI = require("./expo-ui-path")();
14
+ const expoUI = opts.isWeb === true ? require("./expo-ui-path")() : path.resolve(projectRoot,"node_modules","@fto-consult","expo-ui");
15
15
  const r = require("@fto-consult/common/babel.config.alias")(opts);
16
16
  const expo = path.resolve(expoUI,"src");
17
17
  r["$ecomponents"] = r["$expo-components"] = path.resolve(expo,"components");
@@ -64,9 +64,7 @@ module.exports = (opts)=>{
64
64
  }
65
65
  r.$eutils = path.resolve(expo,"utils");
66
66
  r.$ehooks = path.resolve(expo,"context","hooks");
67
- ///le chemin racine du projet expo-ui
68
67
  r["$expo-ui-root-path"] = r["$expo-ui-root"]= path.resolve(expo,"..");
69
-
70
68
  const $electron = path.resolve(dir,"electron");
71
69
  //le chemin ver le repertoire electron
72
70
  r.$eelectron = r["$e-electron"] = $electron;
package/babel.config.js CHANGED
@@ -1,19 +1,22 @@
1
+ const path = require("path");
2
+ const fs = require("fs");
3
+
1
4
  module.exports = function(api,opts) {
5
+ api.cache(true);
2
6
  opts = typeof opts =='object' && opts ? opts : {};
3
- api = api && typeof api =='object'? api : {};
4
- ///les chemin vers la variable d'environnement, le chemin du fichier .env,@see : https://github.com/brysgo/babel-plugin-inline-dotenv
5
- //console.log(environmentPath," is envvv ",opts);
6
- const path = require("path");
7
- const fs = require("fs");
8
- typeof api.cache =='function' && api.cache(true);
9
7
  const inlineDovOptions = { unsafe: true};
10
- const options = {...opts,platform:"expo"};
8
+ const platform = api.caller(caller => caller && caller.platform);
9
+ const isWeb = platform === 'web';
10
+ const options = {...opts,isWeb,isAndroid:platform==="android",isIos : platform==="ios",platform:"expo"};
11
11
  const environmentPath = require("./copy-env-file")();
12
12
  if(environmentPath && fs.existsSync(environmentPath)){
13
13
  inlineDovOptions.path ='./.env';
14
14
  }
15
15
  /*** par défaut, les variables d'environnements sont stockés dans le fichier .env situé à la racine du projet, référencée par la prop base */
16
16
  const alias = require("./babel.config.alias")(options);
17
+ if(typeof options.aliasMutator =="function"){
18
+ options.aliasMutator(alias);
19
+ }
17
20
  require(`${path.resolve(__dirname,"bin","generate-tables")}`)();//génère les tables des bases de données
18
21
  const plugins = (Array.isArray(opts.plugins) ? options.plugins : []);
19
22
  let reanimated = "react-native-reanimated/plugin";
package/metro.config.js CHANGED
@@ -6,8 +6,7 @@ module.exports = function(opts){
6
6
  let {assetExts,sourceExts} = opts;
7
7
  assetExts = Array.isArray(assetExts)? assetExts: [];
8
8
  sourceExts= Array.isArray(sourceExts)?sourceExts : [];
9
- const projectRoot = path.resolve(process.cwd());
10
- const localDir = path.resolve(__dirname);
9
+ const projectRoot = typeof opts.projectRoot =="string" && opts.projectRoot && fs.existsSync(path.resolve(opts.projectRoot))? path.resolve(opts.projectRoot) : path.resolve(process.cwd());
11
10
  const transpilePath = null;//require("./create-transpile-module-transformer")(opts);
12
11
  const hasTranspilePath = typeof transpilePath =='string' && transpilePath && fs.existsSync(transpilePath);
13
12
  //@see : https://docs.expo.dev/versions/latest/config/metro/
@@ -38,15 +37,21 @@ module.exports = function(opts){
38
37
  ...sourceExts,"txt",
39
38
  'jsx', 'js','tsx',
40
39
  ]
41
-
40
+ config.watchFolders = Array.isArray(config.watchFolders)? config.watchFolders : [];
41
+ let hasFTO = false;
42
+ for(let i in config.watchFolders){
43
+ if(typeof config.watchFolders[i] ==="string" && config.watchFolders[i].includes("@fto-consult")){
44
+ hasFTO = true;
45
+ }
46
+ }
47
+ if(!hasFTO){
48
+ config.watchFolders.push(path.resolve(projectRoot,"node_modules","@fto-consult"))
49
+ }
42
50
  // 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
43
51
  config.resolver.disableHierarchicalLookup = true;
44
52
 
45
53
  // Remove all console logs in production...
46
54
  config.transformer.minifierConfig.compress.drop_console = false;
47
55
 
48
- // 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`, @see : https://docs.expo.dev/guides/monorepos/
49
- config.resolver.disableHierarchicalLookup = true;
50
-
51
56
  return config;
52
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "8.20.7",
3
+ "version": "8.21.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",