@fto-consult/expo-ui 6.36.0 → 6.37.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 CHANGED
@@ -1,11 +1,11 @@
1
- //les paramètres d'environnement utilse :
2
-
3
- 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
4
- pour que ce soit possible, la variable TABLES_DATA_PATH doit exister et doit pointer sur le repertoire des tables de données de l'application
5
-
6
- TABLES_DATAS_PATH = //path, chemin vers le dossier des tables de données de l'application
7
-
8
-
9
- STRUCTS_DATA_PATH = //path, chemin vers le dossiers des structs data des données de l'application
10
-
11
-
1
+ //les paramètres d'environnement utilse :
2
+
3
+ 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
4
+ pour que ce soit possible, la variable TABLES_DATA_PATH doit exister et doit pointer sur le repertoire des tables de données de l'application
5
+
6
+ TABLES_DATAS_PATH = //path, chemin vers le dossier des tables de données de l'application
7
+
8
+
9
+ STRUCTS_DATA_PATH = //path, chemin vers le dossiers des structs data des données de l'application
10
+
11
+
package/App.js ADDED
@@ -0,0 +1 @@
1
+ export {default} from "./src";
package/app.config.json CHANGED
@@ -1,11 +1,11 @@
1
- {
2
- "name": "@FTO-CONSULT/EXPO-UI",
3
- "version": "6.31.7",
4
- "description": "Bibliothèque de composants UI Expo,react-native",
5
- "bin": {
6
- "expo-ui": "./bin/index.js"
7
- },
8
- "author": "Boris Fouomene",
9
- "license": "ISC",
10
- "homepage": "https://github.com/borispipo/expo-ui#readme"
1
+ {
2
+ "name": "@FTO-CONSULT/EXPO-UI",
3
+ "version": "6.31.7",
4
+ "description": "Bibliothèque de composants UI Expo,react-native",
5
+ "bin": {
6
+ "expo-ui": "./bin/index.js"
7
+ },
8
+ "author": "Boris Fouomene",
9
+ "license": "ISC",
10
+ "homepage": "https://github.com/borispipo/expo-ui#readme"
11
11
  }
package/app.json CHANGED
@@ -1,12 +1,12 @@
1
- {
2
- "expo": {
3
- "name": "@fto-consult/expo-ui",
4
- "slug": "fto-consult-expo-ui",
5
- "version": "1.0.0",
6
- "orientation": "portrait",
7
- "web": {
8
- "bundler": "metro"
9
- }
10
- },
11
- "userInterfaceStyle": "automatic"
1
+ {
2
+ "expo": {
3
+ "name": "@fto-consult/expo-ui",
4
+ "slug": "fto-consult-expo-ui",
5
+ "version": "1.0.0",
6
+ "orientation": "portrait",
7
+ "web": {
8
+ "bundler": "metro"
9
+ }
10
+ },
11
+ "userInterfaceStyle": "automatic"
12
12
  }
@@ -0,0 +1,40 @@
1
+ import ExpoUIProvider from "$expo-ui";
2
+ import screens from "./src/screens";
3
+ import drawerItems from "./src/navigation/drawerItems";
4
+ import Logo from "./src/components/Logo";
5
+
6
+ export default function AppMainEntry(){
7
+ return <ExpoUIProvider
8
+ navigation = { {
9
+ //all application screeens
10
+ screens,
11
+ drawerItems, //application main drawer items
12
+ }}
13
+ components = {{
14
+ logo : Logo,//logo component's properties
15
+ loginPropsMutator : {},//login props mutator
16
+ authEnabled : true,//si le module d'authentification sera requis
17
+ }}
18
+ /*** //for application initialization
19
+ @param {
20
+ appConfig : {object}, //application configuration manager imported from $capp/config
21
+ }
22
+ @return {Promise} if rejected, application is suposed to not be started, so we need to display getStarted Screen, il not, application logic is runned
23
+ */
24
+ init = {function({appConfig}){
25
+ return Promise.resolve("app is initialized");
26
+ }}
27
+ /**
28
+ * //when main application component is mounted
29
+ */
30
+ onMount = {function(){}}
31
+ /****when main application component is unmounted*/
32
+ onUnmount = {function(){}}
33
+ /**** called any time main application's component is rendered */
34
+ onRender = {function(){}}
35
+ /*** if you need to wrap main application content with some custom react Provider*/
36
+ children = {function({children}){
37
+ return children;
38
+ }}
39
+ />
40
+ }
package/bin/create-app.js CHANGED
@@ -31,6 +31,7 @@ module.exports = function(parsedArgs,{projectRoot:root}){
31
31
  version : "1.0.0",
32
32
  "description": "",
33
33
  "main": "index.js",
34
+ "main": "node_modules/expo/AppEntry.js",
34
35
  "scripts" : {
35
36
  start : "npx expo start -c",
36
37
  "serve-web" : "npx serve web-build --single",
@@ -50,6 +51,7 @@ module.exports = function(parsedArgs,{projectRoot:root}){
50
51
  mainPackage.dependencies = typeof mainPackage.dependencies ==="object" && mainPackage.dependencies || {};
51
52
  mainPackage.dependencies["react-native"] = reactNativeVersion;
52
53
  mainPackage.dependencies["expo"] = expoVersion;
54
+ mainPackage.main = mainPackage.main || "node_modules/expo/AppEntry.js";
53
55
  for(let i in devDeps){
54
56
  if(!(i in mainPackage.devDependencies)){
55
57
  hasUpdateDeps = true;
@@ -1,80 +1,80 @@
1
- import chalk from 'chalk';
2
-
3
- /**
4
- * Validate the environment options and apply default values.
5
- *
6
- * @param env
7
- * @category env
8
- */
9
- export function validateEnvironment(env){
10
- if (typeof env.projectRoot !== 'string') {
11
- throw new Error(
12
- `@expo/webpack-config requires a valid projectRoot string value which points to the root of your project`
13
- );
14
- }
15
- warnEnvironmentDeprecation(env, true);
16
- const validModes = ['development', 'production', 'none'];
17
- if (!env.mode || !validModes.includes(env.mode)) {
18
- throw new Error(
19
- `@expo/webpack-config requires a valid \`mode\` string which should be one of: ${validModes.join(
20
- ', '
21
- )}`
22
- );
23
- }
24
-
25
- // Default to web. Allow any arbitrary platform.
26
- if (typeof env.platform === 'undefined') {
27
- env.platform = 'web';
28
- }
29
- // No https by default since it doesn't work well across different browsers and devices.
30
- if (typeof env.https === 'undefined') {
31
- env.https = false;
32
- }
33
-
34
- return env;
35
- }
36
-
37
- let warned= {};
38
-
39
- function shouldWarnDeprecated(
40
- config,
41
- key,
42
- warnOnce
43
- ) {
44
- return (!warnOnce || !(key in warned)) && typeof config[key] !== 'undefined';
45
- }
46
-
47
- /**
48
- *
49
- * @param env
50
- * @param warnOnce
51
- * @category env
52
- * @internal
53
- */
54
- export function warnEnvironmentDeprecation(env, warnOnce) {
55
- const warnings = {
56
- production: 'Please use `mode: "production"` instead.',
57
- development: 'Please use `mode: "development"` instead.',
58
- polyfill: 'Please include polyfills manually in your project.',
59
- };
60
-
61
- for (const warning of Object.keys(warnings)) {
62
- if (shouldWarnDeprecated(env, warning, warnOnce)) {
63
- warned[warning] = true;
64
- console.warn(
65
- chalk.bgYellow.black(
66
- `The environment property \`${warning}\` is deprecated. ${warnings[warning]}`.trim()
67
- )
68
- );
69
- }
70
- }
71
- }
72
-
73
- /**
74
- * Used for testing
75
- * @category env
76
- * @internal
77
- */
78
- export function _resetWarnings() {
79
- warned = {};
1
+ import chalk from 'chalk';
2
+
3
+ /**
4
+ * Validate the environment options and apply default values.
5
+ *
6
+ * @param env
7
+ * @category env
8
+ */
9
+ export function validateEnvironment(env){
10
+ if (typeof env.projectRoot !== 'string') {
11
+ throw new Error(
12
+ `@expo/webpack-config requires a valid projectRoot string value which points to the root of your project`
13
+ );
14
+ }
15
+ warnEnvironmentDeprecation(env, true);
16
+ const validModes = ['development', 'production', 'none'];
17
+ if (!env.mode || !validModes.includes(env.mode)) {
18
+ throw new Error(
19
+ `@expo/webpack-config requires a valid \`mode\` string which should be one of: ${validModes.join(
20
+ ', '
21
+ )}`
22
+ );
23
+ }
24
+
25
+ // Default to web. Allow any arbitrary platform.
26
+ if (typeof env.platform === 'undefined') {
27
+ env.platform = 'web';
28
+ }
29
+ // No https by default since it doesn't work well across different browsers and devices.
30
+ if (typeof env.https === 'undefined') {
31
+ env.https = false;
32
+ }
33
+
34
+ return env;
35
+ }
36
+
37
+ let warned= {};
38
+
39
+ function shouldWarnDeprecated(
40
+ config,
41
+ key,
42
+ warnOnce
43
+ ) {
44
+ return (!warnOnce || !(key in warned)) && typeof config[key] !== 'undefined';
45
+ }
46
+
47
+ /**
48
+ *
49
+ * @param env
50
+ * @param warnOnce
51
+ * @category env
52
+ * @internal
53
+ */
54
+ export function warnEnvironmentDeprecation(env, warnOnce) {
55
+ const warnings = {
56
+ production: 'Please use `mode: "production"` instead.',
57
+ development: 'Please use `mode: "development"` instead.',
58
+ polyfill: 'Please include polyfills manually in your project.',
59
+ };
60
+
61
+ for (const warning of Object.keys(warnings)) {
62
+ if (shouldWarnDeprecated(env, warning, warnOnce)) {
63
+ warned[warning] = true;
64
+ console.warn(
65
+ chalk.bgYellow.black(
66
+ `The environment property \`${warning}\` is deprecated. ${warnings[warning]}`.trim()
67
+ )
68
+ );
69
+ }
70
+ }
71
+ }
72
+
73
+ /**
74
+ * Used for testing
75
+ * @category env
76
+ * @internal
77
+ */
78
+ export function _resetWarnings() {
79
+ warned = {};
80
80
  }
package/env.js CHANGED
@@ -1,11 +1,11 @@
1
-
2
- //permet de retourner le contenu de la variable d'environnement .env de l'application//
3
- module.exports = function(){
4
- const fs = require("fs");
5
- const path = require("path");
6
- try {
7
- const envPath = path.resolve(process.cwd(),".env");
8
- return fs.existsSync(envPath)? require("./parse-env")(fs.readFileSync(envPath,'utf8')) : {};
9
- } catch{}
10
- return {};
1
+
2
+ //permet de retourner le contenu de la variable d'environnement .env de l'application//
3
+ module.exports = function(){
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+ try {
7
+ const envPath = path.resolve(process.cwd(),".env");
8
+ return fs.existsSync(envPath)? require("./parse-env")(fs.readFileSync(envPath,'utf8')) : {};
9
+ } catch{}
10
+ return {};
11
11
  }
package/index.js CHANGED
@@ -1,68 +1 @@
1
- import { registerRootComponent } from "expo";
2
- import Provider from "$econtext/Provider";
3
- const REGISTER_EVENT = "REGISTER-APP-COMPONENT-ROOT";
4
- import {useState,useEffect} from "react";
5
- const propsRef = {current:null};
6
- import APP from "$capp/instance";
7
- import {isObj,uniqid} from "$cutils";
8
- import {View} from "react-native";
9
- const isLOCALDEV = uniqid("is-expo-ui-local-DEV...");
10
-
11
- /****
12
- * les options sont de la forme :
13
- * {
14
- * @param init {function} ()=>Promise<{}>, initialise l'application, lorsque la promèsse n'est pas résolue, alors l'application considère qu'il s'agit d'une étape pour l'écran de GetStarted dans ce cas,
15
- * l'option la route getStartedRouteName est utilisée comme route par défaut de l'application
16
- * @param initialRouteName {string} la route initiale, par d'afaut Home, valide lorsque la promèsse résultat de la fonction init est résolue
17
- * @param getStartedRouteName {string} la route de l'écran de GetStarted, valide lorsque la promèsse résultat de la fonction init n'est pas résolue
18
- * L'écran de route getStartedRouteName prend en paramètre onGetStarted {function}, qui est appelée lorsque le contenu de l'écran GetStarted est affiché à l'utilisateur
19
- * @maram {swrConfig}, les options supplémentaires à passer au gestinnaire swr
20
- * les écrans d'initialisation doivent garder la propriété Start à true ou doivent avoir le groupe INTALL, pour spécifier que ce sont es écrans qui apparaissent lorsque l'application n'est pas initialisée
21
- * }
22
- */
23
-
24
-
25
- const MainAppEntry = function(mProps){
26
- const [props,setProps] = useState(propsRef.current);
27
- const onRegisterProps = (props)=>{
28
- if(isObj(propsRef.current) || !isObj(props)) return;
29
- propsRef.current = props;
30
- setProps({...props});
31
- }
32
- useEffect(()=>{
33
- APP.on(REGISTER_EVENT,onRegisterProps);
34
- return ()=>{
35
- APP.off(REGISTER_EVENT,onRegisterProps);
36
- }
37
- },[]);
38
- const cProps = isObj(props) ? props : propsRef.current;
39
- if(!isObj(cProps)) {
40
- return <View/>;
41
- }
42
- const {onMount,onUnmount,onRender,render,swrConfig,init,...rest} = {...mProps,...cProps};
43
- const App = require("./src/App").default;
44
- return <Provider {...rest} swrConfig={isObj(swrConfig) && swrConfig || {}} children={<App init={init} render={render} onMount={onMount} onUnmount={onUnmount} onRender={onRender}/>}/>
45
- };
46
-
47
- registerRootComponent(MainAppEntry);
48
-
49
- export default function registerApp (opts){
50
- propsRef.current = opts;
51
- APP.trigger(REGISTER_EVENT,opts);
52
- }
53
-
54
- if(typeof __DEV__ !=='boolean' && window?.__DEV__){
55
- //c'est uniquement en environnement développement que ceci est valide
56
- //si après 5 secondes, l'application n'a pas été registrer, alors il s'agit d'un test en mode local
57
- registerApp({
58
- isLOCALDEV,
59
- navigation : {
60
- screens : require("./src/test-screens").default
61
- },
62
- init : ({appConfig})=>{
63
- appConfig.set("isAuthSingleUserAllowed",true);
64
- appConfig.set("authDefaultUser",{code:"root",password:"admin123",label:"Master admin"})
65
- return Promise.resolve("test ted")
66
- }
67
- });
68
- }
1
+ export {default} from "./App";