@fto-consult/expo-ui 7.4.21 → 7.4.23

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/bin/index.js CHANGED
@@ -108,6 +108,11 @@ program.command('electron')
108
108
  const indexFile = path.resolve(buildOutDir,"index.html");
109
109
  const webBuildDir = path.resolve(projectRoot,"web-build");
110
110
  const packagePath = path.resolve(projectRoot,"package.json");
111
+ if(!fs.existsSync(packagePath)){
112
+ throwError("package.json file does not exist in "+projectRoot+". please make jure that your have running package script in expo root application");
113
+ }
114
+ const packageObj = require(`${packagePath}`);
115
+ const homepage = packageObj.homepage;
111
116
  let cmd = undefined;
112
117
  const start = x=>{
113
118
  return new Promise((resolve,reject)=>{
@@ -132,10 +137,18 @@ program.command('electron')
132
137
  reject("dossier web-build exporté par electron innexistant!!");
133
138
  }
134
139
  }
135
- if(!url && (compile || !fs.existsSync(path.resolve(webBuildDir,"index.html")))){
140
+ if(!url && (compile || script ==="build" || !fs.existsSync(path.resolve(webBuildDir,"index.html")))){
136
141
  console.log("exporting expo web app ...");
142
+ try {
143
+ writeFile(packagePath,JSON.stringify({...packageObj,homepage:"./"},null,"\t"));
144
+ } catch{}
137
145
  cmd = "npx expo export:web";
138
- return exec({cmd,projectRoot}).then(next).catch(reject);
146
+ return exec({cmd,projectRoot}).then((e)=>{
147
+ try {
148
+ writeFile(packagePath,JSON.stringify({...packageObj,homepage},null,"\t"));
149
+ } catch{}
150
+ next(e);
151
+ }).catch(reject);
139
152
  }
140
153
  next();
141
154
  });
@@ -150,10 +163,6 @@ program.command('electron')
150
163
  case "build":
151
164
  break;
152
165
  default :
153
- if(!fs.existsSync(packagePath)){
154
- throwError("package.json file does not exist in "+projectRoot+". please make jure that your have running package script in expo root application");
155
- }
156
- const packageObj = require(`${packagePath}`);
157
166
  const electronPackage = require(`${path.resolve(electronProjectRoot,'package.json')}`);
158
167
  electronPackage.name = packageObj.name;
159
168
  electronPackage.version = packageObj.version;
package/electron/index.js CHANGED
@@ -13,9 +13,9 @@ program
13
13
 
14
14
  const programOptions = program.opts();
15
15
  const {url:pUrl,paths:pathsJSON,root:mainProjectRoot} = programOptions
16
-
16
+ const cPaths = path.resolve("./paths.json");
17
17
  const pathsJ = pathsJSON && fs.existsSync(pathsJSON) && pathsJSON.endsWith("paths.json")? pathsJSON : null;
18
- let paths = pathsJ ? require(`${pathsJ}`) : fs.existsSync(path.resolve("./paths.json")) ? require("./paths.json") : null;
18
+ let paths = pathsJ ? require(`${pathsJ}`) : fs.existsSync(cPaths) ? require(cPaths) : null;
19
19
  const projectRoot = mainProjectRoot && fs.existsSync(mainProjectRoot) ? mainProjectRoot : paths.projectRoot || '';
20
20
  const electronProjectRoot = projectRoot && fs.existsSync(path.resolve(projectRoot,"electron")) && path.resolve(projectRoot,"electron") || null;
21
21
  const ePathsJSON = path.resolve(electronProjectRoot,"paths.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.4.21",
3
+ "version": "7.4.23",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "main",
6
6
  "scripts": {