@fto-consult/expo-ui 7.4.15 → 7.4.17

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.
Files changed (2) hide show
  1. package/bin/index.js +10 -4
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -53,16 +53,22 @@ program.command('electron')
53
53
  .option('-a, --arch [architecture]', 'l\'architecture de la plateforme')
54
54
  .option('-p, --platform [platform]', 'la plateforme à utiliser pour la compilation')
55
55
  .action((script, options) => {
56
+ const electronProjectRoot = path.resolve(projectRoot,"electron");
56
57
  const opts = Object.assign({},typeof options.opts =='function'? options.opts() : options);
57
58
  let {out,arch,url,compile,platform} = opts;
58
59
  //let {projectRoot} = opts;
59
60
  if(projectRoot == dir){
60
61
  throwError(`Invalid project root ${projectRoot}; project root must be different to ${dir}`);
61
62
  }
62
- const pathsJSON = path.resolve(getPaths(projectRoot));
63
+ let pathsJSON = path.resolve(getPaths(projectRoot));
64
+ const electronPathsJSON = path.resolve(electronProjectRoot,"paths.json");
63
65
  if(!fs.existsSync(pathsJSON)){
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
- }
66
+ if(fs.existsSync(electronPathsJSON)){
67
+ pathsJSON = electronPathsJSON
68
+ } else {
69
+ 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.");
70
+ }
71
+ }
66
72
  const paths = require(`${pathsJSON}`);
67
73
  if(typeof paths !=='object' || !paths || !paths.projectRoot){
68
74
  throwError("Fichiers des chemins d'application invalide!!! merci d'exécuter l'application en environnement web|android|ios puis réessayez");
@@ -72,7 +78,6 @@ program.command('electron')
72
78
  throwError(`main app project root ${paths.projectRoot} must be equals to ${projectRoot} in which you want to generate electron app`);
73
79
  }
74
80
 
75
- const electronProjectRoot = path.resolve(projectRoot,"electron");
76
81
  const isElectionInitialized = require("../electron/is-initialized")(electronProjectRoot);
77
82
  process.env.isElectron = true;
78
83
  process.env.isElectronScript = true;
@@ -103,6 +108,7 @@ program.command('electron')
103
108
  const indexFile = path.resolve(buildOutDir,"index.html");
104
109
  const webBuildDir = path.resolve(projectRoot,"web-build");
105
110
  const packagePath = path.resolve(projectRoot,"package.json");
111
+ let cmd = undefined;
106
112
  const start = x=>{
107
113
  return new Promise((resolve,reject)=>{
108
114
  cmd = `electron "${electronProjectRoot}"${url? ` url="${url}"`:''}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.4.15",
3
+ "version": "7.4.17",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "main",
6
6
  "scripts": {