@fto-consult/expo-ui 6.18.30 → 6.18.32
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/bin/create-app/registerApp.js +22 -7
- package/bin/create-app.js +22 -1
- package/package.json +1 -1
- package/src/index.js +1 -0
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
import registerApp from "$expo-ui-root-path";
|
|
2
2
|
registerApp({
|
|
3
|
+
/**** application navigation */
|
|
3
4
|
navigation : {
|
|
4
5
|
screens : [],//all application screeens
|
|
5
6
|
drawerItems : [], //application main drawer items
|
|
6
7
|
},
|
|
7
|
-
|
|
8
|
+
/**application components */
|
|
9
|
+
components : {
|
|
8
10
|
logo : null,//logo component's properties
|
|
9
11
|
loginPropsMutator : {},//login props mutator
|
|
10
12
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
/*** //for application initialization
|
|
14
|
+
@param {
|
|
15
|
+
appConfig : {object}, //application configuration manager imported from $capp/config
|
|
16
|
+
}
|
|
17
|
+
@return {Promise} if rejected, application is suposed to not be started, so we need to display getStarted Screen, il not, application logic is runned
|
|
18
|
+
*/
|
|
19
|
+
init : function({appConfig}){
|
|
20
|
+
return Promise.resolve("app is initialized");
|
|
13
21
|
},
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
/**
|
|
23
|
+
* //when main application component is mounted
|
|
24
|
+
*/
|
|
25
|
+
onMount : function(){
|
|
16
26
|
},
|
|
17
|
-
|
|
27
|
+
/****when main application component is unmounted*/
|
|
28
|
+
onUnmount : function(){
|
|
18
29
|
},
|
|
30
|
+
/**** called any time main application's component is rendered */
|
|
19
31
|
onRender : function(){
|
|
20
|
-
|
|
32
|
+
},
|
|
33
|
+
/*** if you need to wrap main application content with some custom react Provider */
|
|
34
|
+
render : ({children})=>{
|
|
35
|
+
return children;
|
|
21
36
|
}
|
|
22
37
|
});
|
package/bin/create-app.js
CHANGED
|
@@ -15,7 +15,6 @@ module.exports = function(parsedArgs,{projectRoot}){
|
|
|
15
15
|
}
|
|
16
16
|
const devDpendencies = packageObj.devDependencies;
|
|
17
17
|
const deps = devDpendencies && typeof devDpendencies =="object" && Object.keys(devDpendencies).join(" ");
|
|
18
|
-
console.log(projectRoot," is project root");
|
|
19
18
|
new Promise((resolve,reject)=>{
|
|
20
19
|
if(typeof deps =="string" && deps){
|
|
21
20
|
console.log("installing dev dependencies ....");
|
|
@@ -31,6 +30,7 @@ module.exports = function(parsedArgs,{projectRoot}){
|
|
|
31
30
|
writeFile(p,fs.readFileSync(`${path.join(createAppDir,file)}`));
|
|
32
31
|
}
|
|
33
32
|
});
|
|
33
|
+
createAPPJSONFile(projectRoot,{...mainPackage,name});
|
|
34
34
|
process.exit();
|
|
35
35
|
});
|
|
36
36
|
}
|
|
@@ -43,4 +43,25 @@ const createEntryFile = (projectRoot)=>{
|
|
|
43
43
|
return true;
|
|
44
44
|
}
|
|
45
45
|
return false;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const createAPPJSONFile = (projectRoot,{name,version})=>{
|
|
49
|
+
version = version ||"1.0.0";
|
|
50
|
+
const appJSONPath = path.join(projectRoot,"app.json");
|
|
51
|
+
if(!fs.existsSync(appJSONPath)){
|
|
52
|
+
writeFile(appJSONPath,`
|
|
53
|
+
{
|
|
54
|
+
"expo": {
|
|
55
|
+
"name": "${name}",
|
|
56
|
+
"slug": "${name.toLowerCase().replace(/\s\s+/g, '-')}",
|
|
57
|
+
"version":${version},
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
`)
|
|
61
|
+
} else {
|
|
62
|
+
const appJSON = require(`${appJSONPath}`);
|
|
63
|
+
appJSON.version = version;
|
|
64
|
+
writeFile(appJSONPath,JSON.stringify(appJSON,null, 2));
|
|
65
|
+
}
|
|
66
|
+
return fs.existsSync(appJSONPath);
|
|
46
67
|
}
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -40,6 +40,7 @@ import StatusBar from "$ecomponents/StatusBar";
|
|
|
40
40
|
import {Provider as PaperProvider } from 'react-native-paper';
|
|
41
41
|
import FontIcon from "$ecomponents/Icon/Font";
|
|
42
42
|
import useContext from "$econtext/hooks";
|
|
43
|
+
export * from "./context";
|
|
43
44
|
|
|
44
45
|
let MAX_BACK_COUNT = 1;
|
|
45
46
|
let countBack = 0;
|