@fto-consult/expo-ui 1.1.28 → 1.1.29

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/expo-ui-path.js CHANGED
@@ -14,10 +14,10 @@ module.exports = function (...args){
14
14
  const rootPath = path.resolve(p,"..");
15
15
  const src = path.resolve(rootPath,"src");
16
16
  if(fs.existsSync(src) && fs.existsSync((path.resolve(rootPath,"babel.config.js")))){
17
- const expoUIPath = path.resolve(rootPath,"expo-ui-path.js");
17
+ const expoUIPath = path.resolve(rootPath,"expo-ui-build-path.js");
18
18
  try {
19
19
  var writeStream = fs.createWriteStream(expoUIPath);
20
- writeStream.write("module.exports=\""+(p.replace(sep,(sep+sep)))+(sep+sep)+"\";");
20
+ writeStream.write("module.exports=\"./expo-ui/\";");
21
21
  writeStream.end();
22
22
  return path.resolve(p,suffix).replace(sep,(sep+sep));
23
23
  } catch{
package/metro.config.js CHANGED
@@ -1,6 +1,7 @@
1
1
  const { getDefaultConfig } = require('@expo/metro-config');
2
2
  const path = require("path");
3
3
  const isCaseSensitive = require("./is-os-case-sensitive");
4
+ const fs = require("fs");
4
5
  module.exports = (opts)=>{
5
6
  opts = opts && typeof opts =='object'? opts : {};
6
7
  let {dir,nodeModulesPaths,assetExts,sourceExts} = opts;
@@ -8,6 +9,7 @@ module.exports = (opts)=>{
8
9
  assetExts = Array.isArray(assetExts)? assetExts: [];
9
10
  sourceExts= Array.isArray(sourceExts)?sourceExts : [];
10
11
  dir = dir || path.resolve(__dirname);
12
+ require("./expo-ui-path")(path.basename(__filename));
11
13
  const projectRoot = path.resolve(dir);
12
14
  const localDir = path.resolve(__dirname);
13
15
  const config = getDefaultConfig(projectRoot);
@@ -15,6 +17,16 @@ module.exports = (opts)=>{
15
17
  if(projectRoot !== localDir){
16
18
  config.watchFolders.push(localDir);
17
19
  }
20
+ const eUI = path.resolve(projectRoot,"expo-ui-build-path.js");
21
+ //si le fichier n'existe pas alors on le crèèe
22
+ if(!fs.existsSync(eUI)){
23
+ try {
24
+ const writeStream = fs.createWriteStream(eUI);
25
+ writeStream.write("module.exports=\"@fto-consult/expo-ui/\";");
26
+ writeStream.end();
27
+ return path.resolve(p,suffix).replace(sep,(sep+sep));
28
+ }catch{}
29
+ }
18
30
  config.resolver.assetExts = [
19
31
  ...config.resolver.assetExts,
20
32
  ...assetExts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "1.1.28",
3
+ "version": "1.1.29",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {