@fto-consult/expo-ui 7.5.45 → 7.6.2
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/babel.config.alias.js +1 -19
- package/bin/index.js +0 -152
- package/bin/update-appex-chart.js +1 -1
- package/bin/update-pdfmake.js +1 -1
- package/bin/utils.js +1 -1
- package/copy-env-file.js +3 -6
- package/create-transpile-module-transformer.js +1 -1
- package/find-licenses.js +1 -1
- package/package.json +3 -4
- package/src/screens/Help/openLibraries.js +339 -1
- package/bin/init.js +0 -95
- package/electron/app/desktopCapturer.js +0 -123
- package/electron/app/email.js +0 -55
- package/electron/app/file.js +0 -501
- package/electron/app/index.html +0 -32
- package/electron/app/index.js +0 -19
- package/electron/app/instance.js +0 -46
- package/electron/create-index-file.js +0 -15
- package/electron/dependencies.js +0 -13
- package/electron/index.js +0 -560
- package/electron/init/index.js +0 -0
- package/electron/init/main.js +0 -55
- package/electron/init/renderer.js +0 -6
- package/electron/is-initialized.js +0 -11
- package/electron/pload.js +0 -88
- package/electron/preload.js +0 -461
- package/electron/tools.js +0 -0
- package/electron/utils/config.js +0 -30
- package/electron/utils/copy.js +0 -20
- package/electron/utils/createDir.js +0 -30
- package/electron/utils/createDirSync.js +0 -31
- package/electron/utils/debounce.js +0 -19
- package/electron/utils/dependencies.js +0 -10
- package/electron/utils/env.js +0 -80
- package/electron/utils/exec.js +0 -81
- package/electron/utils/getDirname.js +0 -14
- package/electron/utils/getIcon.js +0 -25
- package/electron/utils/index.js +0 -24
- package/electron/utils/isBase64.js +0 -14
- package/electron/utils/isDataURL.js +0 -13
- package/electron/utils/isValidUrl.js +0 -4
- package/electron/utils/json.js +0 -57
- package/electron/utils/parseArgs.js +0 -21
- package/electron/utils/paths.js +0 -11
- package/electron/utils/postMessage.js +0 -19
- package/electron/utils/replaceAll.js +0 -12
- package/electron/utils/session.js +0 -5
- package/electron/utils/uniqid.js +0 -33
- package/electron/utils/writeFile.js +0 -14
package/babel.config.alias.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
const path = require("path");
|
2
2
|
const fs = require("fs");
|
3
|
+
|
3
4
|
module.exports = (opts)=>{
|
4
5
|
const isLocalDev = require("./is-local-dev")();
|
5
6
|
const dir = path.resolve(__dirname);
|
@@ -77,16 +78,7 @@ module.exports = (opts)=>{
|
|
77
78
|
///le chemin racine du projet expo-ui
|
78
79
|
r["$expo-ui-root-path"] = r["$expo-ui-root"]= path.resolve(expo,"..");
|
79
80
|
|
80
|
-
const $assets = r.$assets;
|
81
81
|
const $electron = path.resolve(dir,"electron");
|
82
|
-
const electronPaths = {
|
83
|
-
...r,
|
84
|
-
sourceCode : r.$src,
|
85
|
-
assets : $assets,
|
86
|
-
images : r.$images,
|
87
|
-
projectRoot : projectRoot,//la racine au projet
|
88
|
-
electron : $electron,//le chemin racine electron
|
89
|
-
};
|
90
82
|
//le chemin ver le repertoire electron
|
91
83
|
r.$eelectron = r["$e-electron"] = $electron;
|
92
84
|
r.$electron = r.$electron || r.$eelectron;
|
@@ -97,16 +89,6 @@ module.exports = (opts)=>{
|
|
97
89
|
if(!r.$context){
|
98
90
|
r.$context = r.$econtext;
|
99
91
|
}
|
100
|
-
const electronAssetsPath = path.resolve(dir,"electron","assets");
|
101
|
-
if($assets){
|
102
|
-
const l1 = path.resolve($assets,"logo.png"), l2 = path.resolve($assets,"logo.png");
|
103
|
-
const logoPath = fs.existsSync(l1)? l1 : fs.existsSync(l2)? l2 : undefined;
|
104
|
-
const ePath = path.resolve(electronAssetsPath,"images","logo.png");
|
105
|
-
if(logoPath && require("./electron/utils/createDir")(ePath)){
|
106
|
-
fs.copyFileSync(logoPath,ePath,fs.constants.COPYFILE_FICLONE);
|
107
|
-
electronPaths.logo = logoPath;
|
108
|
-
}
|
109
|
-
}
|
110
92
|
r["$erealm"] = path.resolve(expo,'realm');
|
111
93
|
if(!r.$realm){
|
112
94
|
r.$realm = r.$erealm;
|
package/bin/index.js
CHANGED
@@ -8,19 +8,10 @@
|
|
8
8
|
'use strict';
|
9
9
|
|
10
10
|
const { program } = require('commander');
|
11
|
-
const path= require("path");
|
12
|
-
const fs = require("fs");
|
13
|
-
const {createDir,electronDir,copy,exec,throwError,writeFile,isValidUrl} = require("./utils");
|
14
11
|
|
15
|
-
|
16
|
-
const dir = path.resolve(__dirname);
|
17
|
-
const projectRoot = path.resolve(process.cwd());
|
18
12
|
const packageObj = require("../package.json");
|
19
13
|
const version = packageObj.version;
|
20
|
-
const description = packageObj.description;
|
21
14
|
const packageName = packageObj.name;
|
22
|
-
const localElectronPackage = path.resolve(projectRoot,"node_modules",packageName)
|
23
|
-
const localElectronPackageElectron = path.resolve(localElectronPackage,"electron");
|
24
15
|
|
25
16
|
program
|
26
17
|
.name(packageName)
|
@@ -41,148 +32,5 @@ program.command('generate-getTable')
|
|
41
32
|
.action((src, options) => {
|
42
33
|
require("./generate-tables")();
|
43
34
|
});
|
44
|
-
|
45
|
-
program.command('electron')
|
46
|
-
.description('utilitaire cli pour la plateforme electron. NB : Le package electron doit être installé globalement via l\'instruction npm i -g electron')
|
47
|
-
.argument('<cmd>', 'la commande à exécuter (start,init,build,package). Start permet de démarrer le script electron, init permet d\'initialiser l\'application, build permet de compiler le code expo (exporter), package permet d\'effectuer le packaging de l\'application pour la distribution')
|
48
|
-
//.option('-r, --project-root [dir]', 'le project root de l\'application')
|
49
|
-
//.option('-c, --config [dir]', 'le chemin (relatif au project root) du fichier de configuration de l\'application electron')
|
50
|
-
//.option('-s, --splash [dir]', 'le chemin (relatif au project root) du fichier du splash screen de l\'application')
|
51
|
-
.option('-o, --out [dir]', 'le chemin du répertoire qui contiendra les fichiers build, des fichiers du exporté par le framework expo; commande : build|start')
|
52
|
-
.option('-u, --url [url]', 'le lien url qui sera ouvert par l\'application; commande start')
|
53
|
-
.option('-b, --build [boolean]', 'si ce flag est spécfifié alors l\'application sera compilée; combinée avec la commande start|package pour indiquer que l\'application sera à nouveau exportée ou pas.')
|
54
|
-
.option('-a, --arch [architecture]', 'l\'architecture de la plateforme; Commande package')
|
55
|
-
.option('-p, --platform [platform]', 'la plateforme à utiliser pour la compilation; commande package')
|
56
|
-
.option('-l, --icon [iconPath]', 'le chemin vers le dossier des icones de l\'application : (Dans ce dossier, doit contenir une image icon.ico pour window, icon.incs pour mac et icon.png pour linux)')
|
57
|
-
.option('-i, --import [boolean]', 'la commande d\'initialisation du package electron forge, utile pour le packaging de l\'application. Elle permet d\'exécuter le cli electron package, pour l\'import d\'un projet existant. Commande package. exemple : expo-ui electron package --import')
|
58
|
-
|
59
|
-
.action((script, options) => {
|
60
|
-
const electronProjectRoot = path.resolve(projectRoot,"electron");
|
61
|
-
const opts = Object.assign({},typeof options.opts =='function'? options.opts() : options);
|
62
|
-
let {out,arch,url,build,platform,import:packageImport,icon} = opts;
|
63
|
-
if(projectRoot == dir){
|
64
|
-
throwError(`Invalid project root ${projectRoot}; project root must be different to ${dir}`);
|
65
|
-
}
|
66
|
-
|
67
|
-
const isElectionInitialized = require("../electron/is-initialized")(electronProjectRoot);
|
68
|
-
process.env.isElectron = true;
|
69
|
-
process.env.isElectronScript = true;
|
70
|
-
const buildOutDir = path.resolve(electronProjectRoot,"dist");
|
71
|
-
const indexFile = path.resolve(buildOutDir,"index.html");
|
72
|
-
const webBuildDir = path.resolve(projectRoot,"web-build");
|
73
|
-
const packagePath = path.resolve(projectRoot,"package.json");
|
74
|
-
if(!fs.existsSync(packagePath)){
|
75
|
-
throwError("package.json file does not exist in "+projectRoot+". please make jure that your have running package script in expo root application");
|
76
|
-
}
|
77
|
-
const packageObj = require(`${packagePath}`);
|
78
|
-
const homepage = packageObj.homepage;
|
79
|
-
let cmd = undefined;
|
80
|
-
icon = icon && typeof icon =="string" && fs.existsSync(path.resolve(icon)) && icon || undefined;
|
81
|
-
require("../electron/create-index-file")({electronProjectRoot,appName:packageObj.name,icon});
|
82
|
-
if(fs.existsSync(electronProjectRoot)){
|
83
|
-
const mainPackagePath = path.resolve(electronProjectRoot,"package.app.json");
|
84
|
-
try {
|
85
|
-
const mainPackageAppJSON = fs.existsSync(mainPackagePath)? require(mainPackagePath) : {};
|
86
|
-
writeFile(mainPackagePath,JSON.stringify({...packageObj,...mainPackageAppJSON,name:packageObj.name,icon:icon||mainPackageAppJSON.icon||undefined},null,"\t"));
|
87
|
-
} catch{}
|
88
|
-
}
|
89
|
-
|
90
|
-
if(!isElectionInitialized || script =='init'){
|
91
|
-
if(script !=='init'){
|
92
|
-
console.log("initializing electron application before ....");
|
93
|
-
}
|
94
|
-
return require("./init")({
|
95
|
-
projectRoot,
|
96
|
-
electronDir,
|
97
|
-
electronProjectRoot,
|
98
|
-
icon,
|
99
|
-
});
|
100
|
-
}
|
101
|
-
const outDir = out && path.dirname(out) && path.resolve(path.dirname(out),"electron") || path.resolve(electronProjectRoot,"bin")
|
102
|
-
if(!createDir(outDir)){
|
103
|
-
throwError("Impossible de créer le répertoire <<"+outDir+">> du fichier binaire!!");
|
104
|
-
}
|
105
|
-
const start = x=>{
|
106
|
-
return new Promise((resolve,reject)=>{
|
107
|
-
cmd = `electron "${electronProjectRoot}" ${icon ? `--icon ${path.resolve(icon)}`:""} ${isValidUrl(url)? ` --url ${url}`:''}`; //--root ${electronProjectRoot}
|
108
|
-
exec({
|
109
|
-
cmd,
|
110
|
-
projectRoot : electronProjectRoot,
|
111
|
-
}).finally(()=>{
|
112
|
-
console.log("ant to exit");
|
113
|
-
})
|
114
|
-
typeof (resolve) =='function' && setTimeout(resolve,1000);
|
115
|
-
})
|
116
|
-
};
|
117
|
-
if(url){
|
118
|
-
return start().then(process.exit);
|
119
|
-
}
|
120
|
-
const promise = new Promise((resolve,reject)=>{
|
121
|
-
const next = ()=>{
|
122
|
-
if(fs.existsSync(webBuildDir)){
|
123
|
-
return copy(webBuildDir,buildOutDir).catch(reject).then(resolve);
|
124
|
-
} else {
|
125
|
-
reject("dossier web-build exporté par electron innexistant!!");
|
126
|
-
}
|
127
|
-
}
|
128
|
-
if(!url && (build || script ==="build" || !fs.existsSync(path.resolve(webBuildDir,"index.html")))){
|
129
|
-
console.log("exporting expo web app ...");
|
130
|
-
try {
|
131
|
-
writeFile(packagePath,JSON.stringify({...packageObj,homepage:"./"},null,"\t"));
|
132
|
-
} catch{}
|
133
|
-
cmd = "npx expo export:web";
|
134
|
-
return exec({cmd,projectRoot}).then(next).catch(reject).finally(()=>{
|
135
|
-
try {
|
136
|
-
writeFile(packagePath,JSON.stringify({...packageObj,homepage},null,"\t"));
|
137
|
-
} catch{}
|
138
|
-
});
|
139
|
-
}
|
140
|
-
next();
|
141
|
-
});
|
142
|
-
return promise.then(()=>{
|
143
|
-
if(!fs.existsSync(buildOutDir) || !fs.existsSync(indexFile)){
|
144
|
-
throwError("répertoire d'export web invalide où innexistant ["+buildOutDir+"]");
|
145
|
-
}
|
146
|
-
switch(script){
|
147
|
-
case "start":
|
148
|
-
return start();
|
149
|
-
break;
|
150
|
-
case "build":
|
151
|
-
break;
|
152
|
-
case "package" :
|
153
|
-
if(packageImport || opts.import){ //on importe le projet existant electron forge, @see : https://www.electronforge.io/import-existing-project
|
154
|
-
console.log("importing electron forge existing project....");
|
155
|
-
cmd = "npm install --save-dev @electron-forge/cli";
|
156
|
-
return exec({cmd,projectRoot:electronProjectRoot}).finally(()=>{
|
157
|
-
cmd = `npm exec --package=@electron-forge/cli -c "electron-forge import"`;
|
158
|
-
return exec({cmd,projectRoot:electronProjectRoot}).then(()=>{
|
159
|
-
console.log("package electron forge importé avec succèss");
|
160
|
-
});
|
161
|
-
});
|
162
|
-
|
163
|
-
} else {
|
164
|
-
cmd = `npx electron-forge package ${platform? `--platform="${platform}"`:""} ${arch?`--arch="${arch}"`:""}`;
|
165
|
-
const electronPackagePath = path.resolve(electronProjectRoot,'package.json');
|
166
|
-
const electronPackageJSON = require(electronPackagePath);
|
167
|
-
try {
|
168
|
-
writeFile(electronPackagePath,JSON.stringify({...electronPackageJSON,name:packageObj.name||electronPackageJSON.realName||electronPackageJSON.name},null,"\t"));
|
169
|
-
} catch{}
|
170
|
-
return exec({cmd,projectRoot:electronProjectRoot}).then(()=>{
|
171
|
-
console.log("application package avec succèss");
|
172
|
-
}).finally(()=>{
|
173
|
-
try {
|
174
|
-
writeFile(electronPackagePath,JSON.stringify(electronPackageJSON,null,"\t"));
|
175
|
-
} catch{}
|
176
|
-
});
|
177
|
-
}
|
178
|
-
break;
|
179
|
-
}
|
180
|
-
}).catch((e)=>{
|
181
|
-
console.log(e," is cathing ggg");
|
182
|
-
}).finally(()=>{
|
183
|
-
process.exit();
|
184
|
-
});
|
185
|
-
|
186
|
-
});
|
187
35
|
|
188
36
|
program.parse();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
const path = require("path");
|
2
2
|
const fs = require("fs");
|
3
|
-
const {writeFile} = require("../
|
3
|
+
const {writeFile} = require("../bin/utils")
|
4
4
|
const $ecomponents = path.resolve("./src/components");
|
5
5
|
const eAppex = path.resolve($ecomponents,"Chart","appexChart");
|
6
6
|
const cwdApexChart = path.resolve(process.cwd(),"node_modules","apexcharts","dist","apexcharts.min.js");
|
package/bin/update-pdfmake.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
const path = require("path");
|
2
2
|
const fs = require("fs");
|
3
|
-
const {writeFile} = require("../
|
3
|
+
const {writeFile} = require("../bin/utils")
|
4
4
|
const ePdfmake = path.resolve("./src","pdf","pdfmake");
|
5
5
|
const pdfmakeBuildPath = path.resolve(process.cwd(),"node_modules","pdfmake","build");
|
6
6
|
const pdfmakePath = path.resolve(pdfmakeBuildPath,"pdfmake.min.js"),
|
package/bin/utils.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
module.exports = require("
|
1
|
+
module.exports = require("@fto-consult/electron/src/utils");
|
package/copy-env-file.js
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
const fs = require("fs");
|
2
|
-
const fsExtra = require("fs-extra");
|
3
2
|
const path = require("path");
|
4
|
-
const writeFile = require("./
|
5
|
-
|
6
|
-
*
|
7
|
-
*/
|
3
|
+
const {writeFile,copy} = require("./bin/utils");
|
4
|
+
|
8
5
|
module.exports = (projectRoot,forceCreate)=>{
|
9
6
|
const env = typeof process.env.NODE_ENV =="string" && process.env.NODE_ENV.toLowerCase().trim() || "development";
|
10
7
|
const isDevEnv = 'development' === env;
|
@@ -16,7 +13,7 @@ module.exports = (projectRoot,forceCreate)=>{
|
|
16
13
|
if(environmentPath && fs.existsSync(environmentPath)){
|
17
14
|
// File ".env" will be created or overwritten by default.
|
18
15
|
try {
|
19
|
-
|
16
|
+
copy(environmentPath, localEnv,{overwrite:true});
|
20
17
|
}
|
21
18
|
catch (e){}
|
22
19
|
}
|
package/find-licenses.js
CHANGED
@@ -96,7 +96,7 @@ const findLicencesMain = (options)=>{
|
|
96
96
|
for(let i in s){
|
97
97
|
content[s[i]] = openLibraries[s[i]]
|
98
98
|
}
|
99
|
-
fs.writeFileSync(outputPath, "module.exports = "+JSON.stringify(content)+";");
|
99
|
+
fs.writeFileSync(outputPath, "module.exports = "+JSON.stringify(content,null,"\t")+";");
|
100
100
|
} else {
|
101
101
|
return ({
|
102
102
|
error : true,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fto-consult/expo-ui",
|
3
|
-
"version": "7.
|
3
|
+
"version": "7.6.2",
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
5
5
|
"scripts": {
|
6
6
|
"clear-npx-cache": "npx clear-npx-cache",
|
@@ -44,7 +44,7 @@
|
|
44
44
|
"test-bin": "node ./bin/index.js",
|
45
45
|
"update-appexchart": "npm run update-apexchart",
|
46
46
|
"delete-node-modules": "rimraf ./**/node_modules",
|
47
|
-
"extract-asar"
|
47
|
+
"extract-asar": "npx @electron/asar extract app.asar <destfolder>",
|
48
48
|
"dev": "npx expo start --no-dev --minify -c",
|
49
49
|
"modifier-url-remote-git": "git remote set-url origin 'https://borispipo@github.com/borispipo/smart-eneo.git'",
|
50
50
|
"update": "npm i pdfmake@latest 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 @emotion/native@latest @fto-consult/common@latest @react-navigation/stack react-native-blob-util react-native-iphone-x-helper@latest react-native-mime-types@latest react-native-paper@latest react-native-paper-dates@latest @react-navigation/native@latest @react-navigation/native-stack@latest react-virtuoso@latest tippy.js@latest websql@latest xlsx@latest react-native-web@latest react-dom@latest && npx expo install --fix && npm run update-apexchart && npm run update-pdfmake && npm run find-licenses"
|
@@ -73,6 +73,7 @@
|
|
73
73
|
"@expo/vector-icons": "^13.0.0",
|
74
74
|
"@faker-js/faker": "^8.0.2",
|
75
75
|
"@fto-consult/common": "^3.73.10",
|
76
|
+
"@fto-consult/electron": "^1.0.2",
|
76
77
|
"@pchmn/expo-material3-theme": "^1.3.1",
|
77
78
|
"@react-native-async-storage/async-storage": "1.18.2",
|
78
79
|
"@react-native-community/datetimepicker": "7.2.0",
|
@@ -84,7 +85,6 @@
|
|
84
85
|
"@shopify/flash-list": "1.4.3",
|
85
86
|
"apexcharts": "^3.45.0",
|
86
87
|
"commander": "^11.1.0",
|
87
|
-
"conf": "^10.2.0",
|
88
88
|
"expo": "^49.0.21",
|
89
89
|
"expo-camera": "~13.4.4",
|
90
90
|
"expo-clipboard": "~4.3.1",
|
@@ -102,7 +102,6 @@
|
|
102
102
|
"htmlparser2-without-node-native": "^3.9.2",
|
103
103
|
"is-plain-obj": "^4.1.0",
|
104
104
|
"js-base64": "^3.7.5",
|
105
|
-
"node-machine-id": "^1.1.12",
|
106
105
|
"pdfmake": "^0.2.8",
|
107
106
|
"process": "^0.11.10",
|
108
107
|
"prop-types": "^15.8.1",
|