@fto-consult/expo-ui 6.18.8 → 6.18.11
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/GettingStarted with expo-ui.txt +4 -0
- package/bin/create-app.js +19 -0
- package/bin/index.js +13 -9
- package/package.json +4 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
module.exports = function(parsedArgs,{exec}){
|
|
5
|
+
const packageObj = require("../package.json");
|
|
6
|
+
const root = process.cwd(), mainPackagePath = path.resolve(root,"package.json");
|
|
7
|
+
const mainPackage = fs.existsSync(mainPackagePath) && require(`${mainPackagePath}`) || null;
|
|
8
|
+
const devDpendencies = packageObj.devDependencies;
|
|
9
|
+
const deps = devDpendencies && typeof devDpendencies =="object" && Object.keys(devDpendencies).join(" ");
|
|
10
|
+
new Promise((resolve,reject)=>{
|
|
11
|
+
if(typeof deps =="string" && deps){
|
|
12
|
+
console.log("installing dev dependencies ******************");
|
|
13
|
+
return exec(`npm i -D ${deps}`).then(resolve).catch(reject);
|
|
14
|
+
}
|
|
15
|
+
return resolve({});
|
|
16
|
+
}).then(()=>{
|
|
17
|
+
|
|
18
|
+
}).finally(process.exit);
|
|
19
|
+
}
|
package/bin/index.js
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
process.on('unhandledRejection', err => {
|
|
5
5
|
throw err;
|
|
6
6
|
});
|
|
7
|
+
const throwError = (...args)=>{
|
|
8
|
+
console.error(...args);
|
|
9
|
+
process.exit(-1);
|
|
10
|
+
}
|
|
7
11
|
const createAppScript = "create-app";
|
|
8
12
|
const supportedScript = {
|
|
9
13
|
"init" : true, //initialize electron app
|
|
@@ -22,14 +26,13 @@ const electronDir = path.resolve(dir, "..","electron");
|
|
|
22
26
|
const exec = require("../electron/utils/exec");
|
|
23
27
|
const projectRoot = path.resolve(process.cwd());
|
|
24
28
|
if(projectRoot == dir){
|
|
25
|
-
|
|
29
|
+
throwError(`Invalid project root ${projectRoot}; project root must be different to ${dir}`);
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
const parsedArgs = require("../electron/utils/parseArgs")(null,supportedScript);
|
|
29
33
|
parsedArgs.script = typeof parsedArgs.script =='string' && parsedArgs.script && parsedArgs.script.toLowerCase().trim() || "";
|
|
30
34
|
if(!parsedArgs.script || !(parsedArgs.script in supportedScript)){
|
|
31
|
-
|
|
32
|
-
process.exit();
|
|
35
|
+
throwError("Erreur : script invalide, vous devez spécifier script figurant parmi les script : ["+Object.keys(supportedScript).join(", ")+"]");
|
|
33
36
|
}
|
|
34
37
|
let cmd = null;
|
|
35
38
|
const script = parsedArgs.script;
|
|
@@ -43,15 +46,15 @@ const script = parsedArgs.script;
|
|
|
43
46
|
if(parsedArgs.electron){
|
|
44
47
|
const pathsJSON = path.resolve(electronDir,"paths.json");
|
|
45
48
|
if(!fs.existsSync(pathsJSON)){
|
|
46
|
-
|
|
49
|
+
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.");
|
|
47
50
|
}
|
|
48
51
|
const paths = require(`${pathsJSON}`);
|
|
49
52
|
if(typeof paths !=='object' || !paths || !paths.projectRoot){
|
|
50
|
-
|
|
53
|
+
throwError("Fichiers des chemins d'application invalide!!! merci d'exécuter l'application en environnement web|android|ios puis réessayez");
|
|
51
54
|
}
|
|
52
55
|
/**** le project root d'où a été lancé le script electron doit être le même que celui de l'application principale */
|
|
53
56
|
if(projectRoot !== paths.projectRoot){
|
|
54
|
-
|
|
57
|
+
throwError(`main app project root ${paths.projectRoot} must be equals to ${projectRoot} in which you want to generate electron app`);
|
|
55
58
|
}
|
|
56
59
|
const electronProjectRoot = path.resolve(projectRoot,"electron");
|
|
57
60
|
const isElectionInitialized = require("../electron/is-initialized")(electronProjectRoot);
|
|
@@ -72,7 +75,7 @@ if(parsedArgs.electron){
|
|
|
72
75
|
const out = parsedArgs.out || parsedArgs["output-dir"];
|
|
73
76
|
const outDir = out && path.dirname(out) && path.resolve(projectRoot,path.dirname(out),"electron") || path.resolve(electronProjectRoot,"bin")
|
|
74
77
|
if(!createDir(outDir)){
|
|
75
|
-
|
|
78
|
+
throwError("Impossible de créer le répertoire <<"+outDir+">> du fichier binaire!!");
|
|
76
79
|
}
|
|
77
80
|
const logoPath = paths.logo || paths.$assets && path.resolve(paths.$assets,"logo.png") || paths.$images && path.resolve(paths.$images,"logo.png");
|
|
78
81
|
if(!logoPath || !fs.existsSync(logoPath)){
|
|
@@ -117,7 +120,7 @@ if(parsedArgs.electron){
|
|
|
117
120
|
});
|
|
118
121
|
return promise.then(()=>{
|
|
119
122
|
if(!fs.existsSync(buildOutDir) || !fs.existsSync(indexFile)){
|
|
120
|
-
|
|
123
|
+
throwError("répertoire d'export web invalide où innexistant ["+buildOutDir+"]");
|
|
121
124
|
}
|
|
122
125
|
switch(parsedArgs.script){
|
|
123
126
|
case "start":
|
|
@@ -127,7 +130,7 @@ if(parsedArgs.electron){
|
|
|
127
130
|
break;
|
|
128
131
|
default :
|
|
129
132
|
if(!fs.existsSync(packagePath)){
|
|
130
|
-
|
|
133
|
+
throwError("package.json file does not exist in "+projectRoot+". please make jure that your have running package script in expo root application");
|
|
131
134
|
}
|
|
132
135
|
const packageObj = require(`${packagePath}`);
|
|
133
136
|
const electronPackage = require(`${path.resolve(electronProjectRoot,'package.json')}`);
|
|
@@ -154,6 +157,7 @@ if(parsedArgs.electron){
|
|
|
154
157
|
} else {
|
|
155
158
|
if(script ===createAppScript){
|
|
156
159
|
console.log(createAppScript," is script ",parsedArgs," is parse arrrrrr");
|
|
160
|
+
return require("./create-app")(parsedArgs,{exec});
|
|
157
161
|
}
|
|
158
162
|
process.exit();
|
|
159
163
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fto-consult/expo-ui",
|
|
3
|
-
"version": "6.18.
|
|
3
|
+
"version": "6.18.11",
|
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -43,7 +43,9 @@
|
|
|
43
43
|
"modifier-url-remote-git": "git remote set-url origin 'https://borispipo@github.com/borispipo/smart-eneo.git'",
|
|
44
44
|
"update": "npm i expo @emotion/native@latest react-native-big-list@latest apexcharts@latest file-saver@latest fs-extra@latest google-libphonenumber@latest @pchmn/expo-material3-theme@latest @gorhom/portal@latest @emotion/native@latest @fto-consult/common@latest react-native-blob-util react-native-gesture-handler@latest react-native-iphone-x-helper@latest react-native-mime-types@latest react-native-paper@latest react-native-safe-area-context@latest react-native-paper-dates@latest @react-navigation/native@latest @react-navigation/native-stack@latest react-native-screens@latest react-virtuoso@latest sharp-cli@latest tippy.js@latest websql@latest xlsx@latest && npx expo install --fix"
|
|
45
45
|
},
|
|
46
|
-
"bin":
|
|
46
|
+
"bin": {
|
|
47
|
+
"expo-ui":"./bin/index.js"
|
|
48
|
+
},
|
|
47
49
|
"repository": {
|
|
48
50
|
"type": "git",
|
|
49
51
|
"url": "git+https://github.com/borispipo/expo-ui.git"
|