@fto-consult/expo-ui 6.67.0 → 6.67.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/.env.readMe.txt +2 -0
- package/babel.config.js +1 -1
- package/bin/generate-tables.js +1 -1
- package/copy-env-file.js +2 -0
- package/package.json +1 -1
package/.env.readMe.txt
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
Pour ignorer la variable d'environnement locale, il suffit de passer la variable d'environnement système IGNORE_ENV à n'importe quoi lors de la compilation
|
2
|
+
|
1
3
|
//les paramètres d'environnement utilse :
|
2
4
|
|
3
5
|
GENERATE_GET_TABLE_JS_FILE = 1|0|true|false //si le fichier getTable.js sera généré dans le dossier des tables de données de l'application
|
package/babel.config.js
CHANGED
@@ -9,7 +9,7 @@ module.exports = function(api,opts) {
|
|
9
9
|
const inlineDovOptions = { unsafe: true};
|
10
10
|
const options = {...opts,platform:"expo"};
|
11
11
|
const environmentPath = require("./copy-env-file")();
|
12
|
-
if(fs.existsSync(environmentPath)){
|
12
|
+
if(environmentPath && fs.existsSync(environmentPath)){
|
13
13
|
inlineDovOptions.path ='./.env';
|
14
14
|
}
|
15
15
|
/*** par défaut, les variables d'environnements sont stockés dans le fichier .env situé à la racine du projet, référencée par la prop base */
|
package/bin/generate-tables.js
CHANGED
@@ -51,7 +51,7 @@ const generateTableOrStructDataStr = (tableDataPath)=>{
|
|
51
51
|
if(!indexContent || (!indexContent.includes("table") && !indexContent.includes("tableName"))){
|
52
52
|
return;
|
53
53
|
}
|
54
|
-
getTableJSContent+=`\
|
54
|
+
getTableJSContent+=`\tif(tableName === "${tableName}"){return require("./${table}").default;}\n`;
|
55
55
|
});
|
56
56
|
//on génère le fichier getTable des tables data de l'application
|
57
57
|
if(getTableJSContent){
|
package/copy-env-file.js
CHANGED
@@ -6,6 +6,8 @@ const writeFile = require("./electron/utils/writeFile");
|
|
6
6
|
*
|
7
7
|
*/
|
8
8
|
module.exports = (projectRoot,forceCreate)=>{
|
9
|
+
const isDevEnv = 'development' === process.env.NODE_ENV;
|
10
|
+
if(!isDevEnv && process.env.IGNORE_ENV) return null;
|
9
11
|
projectRoot = projectRoot && typeof projectRoot =="string" && fs.existsSync(projectRoot) && projectRoot || process.cwd();
|
10
12
|
const environmentPath = path.resolve(projectRoot,".env");
|
11
13
|
const localEnv = path.resolve(__dirname,".env");
|