@fto-consult/expo-ui 6.64.5 → 6.64.7
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/App.js
CHANGED
@@ -2,13 +2,22 @@ import ExpoUIProvider from "$expo-ui";
|
|
2
2
|
import screens from "./src/screens";
|
3
3
|
import drawerItems from "./src/navigation/drawerItems";
|
4
4
|
import Logo from "./src/components/Logo";
|
5
|
+
import drawerSections from "./src/navigation/drawerSections";
|
5
6
|
|
6
7
|
export default function AppMainEntry(){
|
7
|
-
return <ExpoUIProvider
|
8
|
+
return <ExpoUIProvider
|
8
9
|
navigation = { {
|
9
10
|
//all application screeens
|
10
11
|
screens,
|
11
12
|
drawerItems, //application main drawer items,
|
13
|
+
drawerSections,
|
14
|
+
/***** mutate drawerItems before rendering
|
15
|
+
@param {object : {[drawerSection1]:{ label:section1Label,items:<Array>},[drawerSection2]:{}, ...[drawerSectionN]:{}}} drawerItems
|
16
|
+
@return {object}
|
17
|
+
*/
|
18
|
+
drawerItemsMutator : (drawerItems)=>{
|
19
|
+
return drawerItems;
|
20
|
+
},
|
12
21
|
screenOptions : {},//les options du composant Stack.Navigator de react-navigation, voir https://reactnavigation.org/docs/native-stack-navigator/
|
13
22
|
}}
|
14
23
|
components = {{
|
package/bin/create-app.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
const {exec,thowError,copy,writeFile,createDirSync,getDependencyVersion} = require("./utils");
|
2
2
|
const fs = require("fs"), path = require("path");
|
3
|
-
const createAppDir = path.resolve(
|
3
|
+
const createAppDir = path.resolve("./create-app");
|
4
4
|
module.exports = function(parsedArgs,{projectRoot:root}){
|
5
5
|
const argvName = process.argv[3];
|
6
6
|
const packageObj = require("../package.json");
|
@@ -76,6 +76,7 @@ module.exports = function(parsedArgs,{projectRoot:root}){
|
|
76
76
|
}
|
77
77
|
});
|
78
78
|
createAPPJSONFile(projectRoot,{...mainPackage,name});
|
79
|
+
createEntryFile(projectRoot);
|
79
80
|
copy(path.resolve(createAppDir,"src"),path.resolve(projectRoot,"src"),{recursive:true,overwrite:false});
|
80
81
|
console.log("intalling dependencies ...");
|
81
82
|
return exec(`npm install`,{projectRoot}).finally(()=>{
|
@@ -90,10 +91,9 @@ const defaultDevDependencies = {
|
|
90
91
|
"@expo/metro-config" : "latest",
|
91
92
|
}
|
92
93
|
const createEntryFile = (projectRoot)=>{
|
93
|
-
|
94
|
-
const mainEntry = path.join(projectRoot,"index.js");
|
94
|
+
const mainEntry = path.join(projectRoot,"App.js");
|
95
95
|
if(!fs.existsSync(mainEntry)){
|
96
|
-
writeFile(mainEntry,fs.readFileSync(path.join(createAppDir,"
|
96
|
+
writeFile(mainEntry,fs.readFileSync(path.join(createAppDir,"App.js")));
|
97
97
|
return true;
|
98
98
|
}
|
99
99
|
return false;
|
@@ -101,8 +101,8 @@ const createEntryFile = (projectRoot)=>{
|
|
101
101
|
|
102
102
|
const createAPPJSONFile = (projectRoot,{name,version})=>{
|
103
103
|
version = version ||"1.0.0";
|
104
|
-
copy(path.join(createAppDir,"assets"),path.resolve(projectRoot,"assets"),{overwrite:false});
|
105
|
-
copy(path.join(createAppDir,".gitignore"),path.resolve(projectRoot,".gitignore"),{overwrite:false});
|
104
|
+
copy(path.join(createAppDir,"assets"),path.resolve(projectRoot,"assets"),{overwrite:false}).catch((e)=>{});
|
105
|
+
copy(path.join(createAppDir,".gitignore"),path.resolve(projectRoot,".gitignore"),{overwrite:false}).catch((e)=>{});
|
106
106
|
const appJSONPath = path.join(projectRoot,"app.json");
|
107
107
|
if(!fs.existsSync(appJSONPath)){
|
108
108
|
writeFile(appJSONPath,`
|