@fto-consult/expo-ui 7.4.3 → 7.4.5

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.
@@ -1,6 +1,7 @@
1
1
  const path = require("path");
2
2
  const fs = require("fs");
3
3
  const writeFile = require("./electron/utils/writeFile");
4
+ const paths = require("./electron/utils/paths");
4
5
  module.exports = (opts)=>{
5
6
  const isLocalDev = require("./is-local-dev")();
6
7
  const dir = path.resolve(__dirname);
@@ -114,7 +115,7 @@ module.exports = (opts)=>{
114
115
  } catch{}
115
116
  }
116
117
  ///on sauvegarde les chemins des fichiers utiles, qui seront utilisées par la variable electron plus tard
117
- writeFile(path.resolve(dir,"electron","paths.json"),JSON.stringify(electronPaths));
118
+ writeFile(paths(projectRoot),JSON.stringify(electronPaths, null, "\t"));
118
119
  r["$erealm"] = path.resolve(expo,'realm');
119
120
  if(!r.$realm){
120
121
  r.$realm = r.$erealm;
package/bin/index.js CHANGED
@@ -10,7 +10,7 @@
10
10
  const { program } = require('commander');
11
11
  const path= require("path");
12
12
  const fs = require("fs");
13
- const {createDir,electronDir,copy,exec,throwError} = require("./utils");
13
+ const {createDir,electronDir,copy,exec,throwError,paths:getPaths} = require("./utils");
14
14
 
15
15
 
16
16
  const dir = path.resolve(__dirname);
@@ -59,7 +59,7 @@ program.command('electron')
59
59
  if(projectRoot == dir){
60
60
  throwError(`Invalid project root ${projectRoot}; project root must be different to ${dir}`);
61
61
  }
62
- const pathsJSON = path.resolve(electronDir,"paths.json");
62
+ const pathsJSON = path.resolve(electronDir,getPaths(projectRoot));
63
63
  if(!fs.existsSync(pathsJSON)){
64
64
  throwError("Le fichier des chemins d'accès à l'application est innexistant, rassurez vous de tester l'application en environnement web, via la cmde <npx expo start>, avant l'exécution du script electron.");
65
65
  }
@@ -85,6 +85,7 @@ program.command('electron')
85
85
  electronDir,
86
86
  electronProjectRoot,
87
87
  paths,
88
+ pathsJSON
88
89
  });
89
90
  }
90
91
  require("../electron/create-index-file")(electronProjectRoot);
package/bin/init.js CHANGED
@@ -4,13 +4,14 @@ const exec = require("../electron/utils/exec");
4
4
  const createDir = require("../electron/utils/createDir");
5
5
  const writeFile = require("../electron/utils/writeFile");
6
6
  const copy = require("../electron/utils/copy");
7
+ const paths = require("../electron/utils/paths");
7
8
  const electronDir = path.resolve(__dirname,"..","electron");
8
9
  const createIndexFile = require("../electron/create-index-file");
9
10
  const appSuffix = " Desktop";
10
11
  const mainPackage = require("../package.json");
11
12
  const mainPackageName = mainPackage.name;
12
13
 
13
- module.exports = ({projectRoot,electronProjectRoot})=>{
14
+ module.exports = ({projectRoot,electronProjectRoot,paths,pathsJSON})=>{
14
15
  return new Promise((resolve,reject)=>{
15
16
  //make shure electron project root exists
16
17
  if(!createDir(electronProjectRoot)){
@@ -57,6 +58,11 @@ module.exports = ({projectRoot,electronProjectRoot})=>{
57
58
  /**** copying all electron utils files */
58
59
  const utilsPath = path.resolve(electronProjectRoot,"utils");
59
60
  copy(path.resolve(electronDir,"utils"),utilsPath);
61
+ if(pathsJSON && fs.existsSync(pathsJSON)){
62
+ try {
63
+ copy(pathsJSON,path.resolve(electronProjectRoot,"paths.json"));
64
+ } catch(e){}
65
+ }
60
66
  console.log("installing package dependencies ...");
61
67
  return exec({
62
68
  cmd : "npm install",// --prefix "+electronProjectRoot,
package/bin/package.js CHANGED
@@ -1,5 +1,6 @@
1
1
  const getIcon = require("../electron/utils/getIcon");
2
2
  const path = require("path");
3
+ const path = require("../electron/utils/paths");
3
4
  const defaultFunc = (cb,cb2) => typeof cb =='function' ? cb : typeof cb2 ==='function'? cb2 : x=> x;
4
5
  const paths = require("../electron/paths.json");
5
6
  const images = paths.$images, assets = paths.$assets, logo = paths.logo;
@@ -7,6 +7,7 @@ module.exports = (projectRoot)=>{
7
7
  && fs.existsSync(path.resolve(projectRoot,"package.json"))
8
8
  && fs.existsSync(path.resolve(projectRoot,'processes',"main","index.js"))
9
9
  && fs.existsSync(path.resolve(projectRoot,'processes',"renderer","index.js"))
10
+ && fs.existsSync(path.resolve(projectRoot,"paths.json"))
10
11
 
11
12
  && true || false;
12
13
  }
@@ -4,6 +4,7 @@ module.exports = {
4
4
  writeFile : require("./writeFile"),
5
5
  copy : require("./copy"),
6
6
  electronDir : path.resolve(__dirname, ".."),
7
+ paths : require("./paths"),
7
8
  exec : require("./exec"),
8
9
  throwError : (...args)=>{
9
10
  console.error(...args);
@@ -0,0 +1,12 @@
1
+
2
+ /**** permet de retourner le chemin des fichier, généré via les alias paths.json
3
+ contenant la liste des fichiers de l'application
4
+ */
5
+ const fs = require("fs");
6
+ const path = requrie("path");
7
+
8
+ module.exports = (projectRoot)=>{
9
+ projectRoot = projectRoot && fs.existsSync(projectRoot) && projectRoot || process.cwd();
10
+ const mainPackage = require("../../package.json");
11
+ return path.resolve(projectRoot,"node_modules",mainPackage.name,"paths.json");
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.4.3",
3
+ "version": "7.4.5",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "main",
6
6
  "scripts": {