@fto-consult/expo-ui 1.1.5 → 1.1.7

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.js CHANGED
@@ -1,7 +1,8 @@
1
+ require("./expo-ui-path");
1
2
  module.exports = function(api,opts) {
2
3
  opts = typeof opts =='object' && opts ? opts : {};
3
4
  ///les chemin vers la variable d'environnement, le chemin du fichier .env,@see : https://github.com/brysgo/babel-plugin-inline-dotenv
4
- const environmentPath = opts.environmentPath || opts.envPath;
5
+ let environmentPath = opts.environmentPath || opts.envPath;
5
6
  const path = require("path");
6
7
  const fs = require("fs");
7
8
  const dir = path.resolve(__dirname);
@@ -0,0 +1,31 @@
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
+
5
+ const fs = require("fs");
6
+ const path = require("path");
7
+ const dir = path.resolve(__dirname)
8
+ let devExpoUIPath = path.resolve(dir);
9
+ const parentPackage = require("./parent-package");
10
+ if(parentPackage){
11
+ console.log(parentPackage," is parent packag path heinn")
12
+ }
13
+ ///retourne le chemin vers le package @expo-ui
14
+ module.exports = (()=>{
15
+ const isDev = fs.existsSync(devExpoUIPath) && fs.existsSync(path.resolve(devExpoUIPath,"babel.config.alias.js"))
16
+ && fs.existsSync(path.resolve(devExpoUIPath,"src"));
17
+ const isDevFile = path.resolve(dir,"expo-ui-production-path.js");
18
+ const expoUIPath = isDev ? "./expo-ui" : "@fto-consult/expo-ui"
19
+ try {
20
+ var writeStream = fs.createWriteStream(isDevFile);
21
+ writeStream.write("module.exports=\""+expoUIPath+"\";");
22
+ writeStream.end();
23
+ } catch{
24
+ if(fs.existsSync(isDevFile)){
25
+ try {
26
+ fs.rmSync(isDevFile);
27
+ } catch{}
28
+ }
29
+ }
30
+ return expoUIPath;
31
+ })();
package/find-licenses.js CHANGED
@@ -53,7 +53,7 @@ const findLicences = (_path)=> new Promise((resolve,reject)=>{
53
53
  }
54
54
  resolve(openLibraries);
55
55
  })
56
- const parentPath = require("./parent-package")();
56
+ const parentPath = require("./parent-package");
57
57
  Promise.all([
58
58
  parentPath ? path.resolve(path.dirname(parentPath)): findLicences(dir),
59
59
  ]).then(()=>{
package/index.js CHANGED
@@ -10,7 +10,7 @@ const defaultObj = x=> isObj(x)? x : {};
10
10
  * config {object}, le fichier de configuration de l'application
11
11
  * }
12
12
  */
13
- export default function ExpoUIApp (options){
13
+ export default function registerExpoUIApp (options){
14
14
  options = defaultObj(options);
15
15
  const config = defaultObj(options.config);
16
16
  appConfig.current = config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/parent-package.js CHANGED
@@ -3,10 +3,10 @@
3
3
  // license that can be found in the LICENSE file.
4
4
 
5
5
  /**** cette fonction a pour rôle de retourner le package parent à celui ci */
6
- module.exports = ()=>{
6
+ module.exports = (()=>{
7
7
  const pathToParent = require("parent-package-json")(); // Will return false if no parent exists
8
8
  if (pathToParent !== false) {
9
9
  return pathToParent.path;
10
10
  }
11
11
  return "";
12
- }
12
+ })();
@@ -2,7 +2,7 @@ const editJsonFile = require("./edit-json-file.js");
2
2
  const fs = require("fs");
3
3
  /***** le fichier de configuration doit être stocké dans le repertoire /src/config.js où src est le repertoire source du projet parent qui a installé l'application */
4
4
  const run = () => {
5
- const parentPackage = require("./parent-package")();
5
+ const parentPackage = require("./parent-package");
6
6
  if(!parentPackage) return;
7
7
  console.log("before updating parent package version ",parentPackage)
8
8
  const srcParent = path.dirname(parentPackage,"src","config.js");