@fto-consult/expo-ui 7.4.21 → 7.4.22

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 +17 -6
  2. package/package.json +1 -1
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,20 @@ 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{
145
+
146
+ }
137
147
  cmd = "npx expo export:web";
138
- return exec({cmd,projectRoot}).then(next).catch(reject);
148
+ return exec({cmd,projectRoot}).then((e)=>{
149
+ try {
150
+ writeFile(packagePath,JSON.stringify({...packageObj,homepage},null,"\t"));
151
+ } catch{}
152
+ next(e);
153
+ }).catch(reject);
139
154
  }
140
155
  next();
141
156
  });
@@ -150,10 +165,6 @@ program.command('electron')
150
165
  case "build":
151
166
  break;
152
167
  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
168
  const electronPackage = require(`${path.resolve(electronProjectRoot,'package.json')}`);
158
169
  electronPackage.name = packageObj.name;
159
170
  electronPackage.version = packageObj.version;
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.22",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "main",
6
6
  "scripts": {