@fto-consult/expo-ui 6.18.3 → 6.18.5
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.js +6 -0
- package/index.js +1 -1
- package/metro.config.js +5 -2
- package/package.json +1 -1
- package/readMe.md +1 -1
- package/src/index.js +2 -1
- package/webpack.config.js +1 -13
package/babel.config.js
CHANGED
|
@@ -10,7 +10,12 @@ module.exports = function(api,opts) {
|
|
|
10
10
|
const fs = require("fs");
|
|
11
11
|
const dir = path.resolve(__dirname);
|
|
12
12
|
typeof api.cache =='function' && api.cache(true);
|
|
13
|
+
const inlineDovOptions = { unsafe: true};
|
|
13
14
|
const options = {base:dir,...opts,platform:"expo"};
|
|
15
|
+
const environmentPath = require("./copy-env-file")();
|
|
16
|
+
if(fs.existsSync(environmentPath)){
|
|
17
|
+
inlineDovOptions.path ='./.env';
|
|
18
|
+
}
|
|
14
19
|
/*** 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 */
|
|
15
20
|
const alias = require("./babel.config.alias")(options);
|
|
16
21
|
const $eelectron = alias.$eelectron || null;
|
|
@@ -75,6 +80,7 @@ module.exports = function(api,opts) {
|
|
|
75
80
|
['babel-preset-expo']
|
|
76
81
|
],
|
|
77
82
|
plugins : [
|
|
83
|
+
["inline-dotenv",inlineDovOptions],
|
|
78
84
|
["module-resolver", {"alias": alias}],
|
|
79
85
|
['react-native-reanimated/plugin'],
|
|
80
86
|
],
|
package/index.js
CHANGED
|
@@ -17,7 +17,7 @@ const isWeb = Platform.OS === "web";
|
|
|
17
17
|
* }
|
|
18
18
|
*/
|
|
19
19
|
export default function registerApp ({onMount,onUnmount,onRender,render,swrConfig,init,...rest}){
|
|
20
|
-
registerRootComponent(function(props){
|
|
20
|
+
return registerRootComponent(function(props){
|
|
21
21
|
return <Provider {...props} {...rest} swrConfig={isObj(swrConfig) && swrConfig || {}} children={<App init={init} render={render} onMount={onMount} onUnmount={onUnmount} onRender={onRender}/>}/>
|
|
22
22
|
});
|
|
23
23
|
}
|
package/metro.config.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const path = require("path");
|
|
2
2
|
const fs = require("fs");
|
|
3
|
-
require("./copy-env-file")();
|
|
4
3
|
module.exports = function(opts){
|
|
5
4
|
const nodeModulePath = `${process.cwd()}/node_modules`;
|
|
6
5
|
const mConfigPath = fs.existsSync(`${nodeModulePath}/@expo/metro-config`) && `${nodeModulePath}/@expo/metro-config` || "@expo/metro-config";
|
|
@@ -12,7 +11,11 @@ module.exports = function(opts){
|
|
|
12
11
|
sourceExts= Array.isArray(sourceExts)?sourceExts : [];
|
|
13
12
|
const projectRoot = process.cwd();
|
|
14
13
|
const localDir = path.resolve(__dirname);
|
|
15
|
-
|
|
14
|
+
//@see : https://docs.expo.dev/versions/latest/config/metro/
|
|
15
|
+
const config = getDefaultConfig(projectRoot,{
|
|
16
|
+
// Enable CSS support.,
|
|
17
|
+
isCSSEnabled: true,
|
|
18
|
+
});
|
|
16
19
|
config.watchFolders = Array.isArray(config.watchFolders) && config.watchFolders || [];
|
|
17
20
|
if(projectRoot !== localDir){
|
|
18
21
|
config.watchFolders.push(localDir);
|
package/package.json
CHANGED
package/readMe.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
## Installation des dépendences, packages de dévéloppement
|
|
2
2
|
|
|
3
3
|
```javascript
|
|
4
|
-
npm i --D babel-plugin-module-resolver
|
|
4
|
+
npm i --D babel-plugin-module-resolver babel-plugin-inline-dotenv @expo/metro-config @expo/webpack-config
|
|
5
5
|
```
|
|
6
6
|
|
|
7
7
|
## **#ELECTRON**
|
package/src/index.js
CHANGED
|
@@ -188,7 +188,8 @@ function App({init:initApp,initialRouteName:appInitialRouteName,render,onMount})
|
|
|
188
188
|
...state,hasGetStarted:true,...defaultObj(args && args?.state),isInitialized:true,isLoading : false,
|
|
189
189
|
});
|
|
190
190
|
}).catch((e)=>{
|
|
191
|
-
console.error(e," initializing app")
|
|
191
|
+
console.error(e," initializing app");
|
|
192
|
+
return;
|
|
192
193
|
setState({...state,isInitialized:true,isLoading : false,hasGetStarted:false});
|
|
193
194
|
})
|
|
194
195
|
});
|
package/webpack.config.js
CHANGED
|
@@ -63,7 +63,7 @@ module.exports = async function(env, argv,opts) {
|
|
|
63
63
|
config.performance.maxAssetSize = typeof config.performance.maxAssetSize =='number'? config.performance.maxAssetSize : 512000;
|
|
64
64
|
config.devtool = (config.mode === 'development') ? 'inline-source-map' : false;
|
|
65
65
|
require("./compiler.config.js")({config,...opts});
|
|
66
|
-
|
|
66
|
+
require("./copy-env-file")();
|
|
67
67
|
const extensions = config.resolve.extensions;
|
|
68
68
|
if(isElectron){
|
|
69
69
|
mainExtensions.map((ex)=>{
|
|
@@ -72,18 +72,6 @@ module.exports = async function(env, argv,opts) {
|
|
|
72
72
|
extensions.unshift(nExt);
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
|
-
//const electronPath = process.cwd();
|
|
76
|
-
//config.output = config.output || {};
|
|
77
|
-
//config.output.publicPath = "./";
|
|
78
|
-
//config.output.path = path.join(electronPath,"dist");
|
|
79
|
-
//writeFile(path.resolve(__dirname,"is-electron-platform.txt"),` ${JSON.stringify(extensions)} is extensions to resolve`)
|
|
80
75
|
}
|
|
81
|
-
//fix process is not defined
|
|
82
|
-
/*config.plugins.unshift(new webpack.ProvidePlugin({
|
|
83
|
-
process: 'process/browser',
|
|
84
|
-
}));*/
|
|
85
|
-
//config.resolve.alias.process = "process/browser";
|
|
86
|
-
//config.resolve.fallback = typeof config.resolve.fallback =="object" && config.resolve.fallback || {};
|
|
87
|
-
//config.resolve.fallback = {...config.resolve.fallback,process: require.resolve('process/browser')};
|
|
88
76
|
return config;
|
|
89
77
|
};;
|