@fto-consult/expo-ui 6.20.17 → 6.20.19

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.
@@ -3,12 +3,12 @@ const fs = require("fs");
3
3
  const writeFile = require("./electron/utils/writeFile");
4
4
  module.exports = (opts)=>{
5
5
  const dir = path.resolve(__dirname);
6
- const base = opts.base || process.cwd();
6
+ const projectRoot = typeof opts.projectRoot =='string' && fs.existsSync(opts.projectRoot.trim()) && opts.projectRoot.trim() || process.cwd();
7
7
  const assets = path.resolve(dir,"assets");
8
8
  opts = typeof opts =='object' && opts ? opts : {};
9
9
  opts.platform = "expo";
10
10
  opts.assets = opts.assets || opts.alias && typeof opts.alias =='object' && opts.alias.$assets || assets;
11
- opts.base = opts.base || base;
11
+ opts.projectRoot = opts.projectRoot || projectRoot;
12
12
  opts.withPouchDB = opts.withPouchDB !== false && opts.withPouchdb !== false ? true : false;
13
13
  delete opts.withPouchdb;
14
14
  const expoUI = require("./expo-ui-path")();
@@ -77,7 +77,7 @@ module.exports = (opts)=>{
77
77
  const HelpScreen = path.resolve(r["$escreens"],"Help");
78
78
  ///on génère les librairies open sources utilisées par l'application
79
79
  const root = path.resolve(r.$src,"..");
80
- const nModulePath = fs.existsSync(path.resolve(root,"node_modules")) && path.resolve(root,"node_modules") || fs.existsSync(path.resolve(r.$src,"node_modules")) && path.resolve(r.$src,"node_modules") || path.resolve(base,"node_modules");
80
+ const nModulePath = fs.existsSync(path.resolve(root,"node_modules")) && path.resolve(root,"node_modules") || fs.existsSync(path.resolve(r.$src,"node_modules")) && path.resolve(r.$src,"node_modules") || path.resolve(projectRoot,"node_modules");
81
81
  const nodeModulesPath = fs.existsSync(nModulePath) ? nModulePath : path.resolve(process.cwd(),"node_modules");
82
82
  const outputPath = path.resolve(HelpScreen,"openLibraries.js");
83
83
  r.$nodeModulesPath = r.$enodeModulesPath= nodeModulesPath;
@@ -93,12 +93,13 @@ module.exports = (opts)=>{
93
93
  sourceCode : r.$src,
94
94
  assets : $assets,
95
95
  images : r.$images,
96
- projectRoot : base,//la racine au projet
96
+ projectRoot : projectRoot,//la racine au projet
97
97
  electron : $electron,//le chemin racine electron
98
98
  };
99
99
  //le chemin ver le repertoire electron
100
100
  r.$eelectron = r["$e-electron"] = $electron;
101
101
  r.$electron = r.$electron || r.$eelectron;
102
+ r.$projectRoot = r.$eprojectRoot = projectRoot;
102
103
  r.$econtext = path.resolve(expo,"context");
103
104
  if(!r.$context){
104
105
  r.$context = r.$econtext;
@@ -113,7 +114,7 @@ module.exports = (opts)=>{
113
114
  electronPaths.logo = logoPath;
114
115
  }
115
116
  }
116
- const jsonPath = path.resolve(base,'package.json');
117
+ const jsonPath = path.resolve(projectRoot,'package.json');
117
118
  if(fs.existsSync(jsonPath)){
118
119
  require("./electron/utils/copy")(jsonPath,path.resolve(dir,"electron","package.app.json"));
119
120
  }
package/bin/create-app.js CHANGED
@@ -31,6 +31,8 @@ module.exports = function(parsedArgs,{projectRoot:root}){
31
31
  "main": "index.js",
32
32
  "scripts" : {
33
33
  start : "npx expo start -c",
34
+ "serve-web" : "npx serve web-build --single",
35
+ "build-web" : "npx expo export:web",
34
36
  },
35
37
  "dependencies" : {
36
38
  [euModule] : "latest",
@@ -117,7 +119,8 @@ const createAPPJSONFile = (projectRoot,{name,version})=>{
117
119
  }
118
120
  },
119
121
  "web": {
120
- "favicon": "./assets/favicon.png"
122
+ "favicon": "./assets/favicon.png",
123
+ "bundler": "metro"
121
124
  }
122
125
  }
123
126
  }
package/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { registerRootComponent } from "expo";
2
- import {Platform } from 'react-native';
2
+ import {Platform,AppRegistry } from 'react-native';
3
+ import apConfig from '$capp/config';
3
4
  import App from "./src/App";
4
5
  import Provider from "$econtext/Provider";
5
6
  const isWeb = Platform.OS === "web";
@@ -17,10 +18,14 @@ const isWeb = Platform.OS === "web";
17
18
  * }
18
19
  */
19
20
  export default function registerApp ({onMount,onUnmount,onRender,render,swrConfig,init,...rest}){
21
+ console.log("will register heeein ",appConfing.name);
22
+ return AppRegistry.registerComponent('main',()=>{
23
+ return <Provider {...rest} swrConfig={isObj(swrConfig) && swrConfig || {}} children={<App init={init} render={render} onMount={onMount} onUnmount={onUnmount} onRender={onRender}/>}/>
24
+ });
20
25
  return registerRootComponent(function(props){
21
26
  return <Provider {...props} {...rest} swrConfig={isObj(swrConfig) && swrConfig || {}} children={<App init={init} render={render} onMount={onMount} onUnmount={onUnmount} onRender={onRender}/>}/>
22
27
  });
23
28
  }
24
29
 
25
30
  ///fix bug lié au fait que l'application stuck on splashscreen en environnement mobile
26
- !isWeb && registerRootComponent(x=>null);
31
+ //!isWeb && registerRootComponent(x=>null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.20.17",
3
+ "version": "6.20.19",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {