@fto-consult/expo-ui 6.19.2 → 6.19.4

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.
Files changed (2) hide show
  1. package/bin/create-app.js +15 -17
  2. package/package.json +1 -1
package/bin/create-app.js CHANGED
@@ -9,19 +9,28 @@ module.exports = function(parsedArgs,{projectRoot}){
9
9
  if(!name){
10
10
  return thowError(name," nom de l'application invalide, veuillez spécifier un nom d'application valide");
11
11
  }
12
- if(!mainPackage){
12
+ let hasPackage = !!mainPackage && typeof mainPackage =='object';
13
+ if(!hasPackage){
14
+ mainPackage = {
15
+ name,
16
+ version : "1.0.0",
17
+ "description": "",
18
+ "main": "index.js",
19
+ scripts : {
20
+ start : "npx expo start -c",
21
+ }
22
+ }
13
23
  const newDir = createDirSync(path.resolve(root,name.trim()));
14
24
  projectRoot = newDir || projectRoot;
15
25
  mainPackagePath = path.resolve(projectRoot,"package.json");
16
26
  console.log(projectRoot," is new project root ",mainPackage);
17
27
  }
18
- const cb = (pkg,)=>{
19
- mainPackage = pkg && typeof pkg =='object' && pkg || mainPackage;
28
+ const cb = ()=>{
20
29
  const devDpendencies = packageObj.devDependencies;
21
30
  const deps = devDpendencies && typeof devDpendencies =="object" && Object.keys(devDpendencies).join(" ") || "";
22
31
  new Promise((resolve,reject)=>{
23
32
  console.log("installing dev dependencies ....");
24
- return exec(`npm i -D @expo/webpack-config @expo/metro-config ${typeof deps=="string" && deps||""}`).then(resolve).catch(reject);
33
+ return exec(`npm i -D @expo/webpack-config @expo/metro-config ${typeof deps=="string" && deps||""}`,{projectRoot}).then(resolve).catch(reject);
25
34
  }).then(()=>{}).finally(()=>{
26
35
  console.log("creating application .....");
27
36
  createEntryFile(projectRoot);
@@ -36,20 +45,9 @@ module.exports = function(parsedArgs,{projectRoot}){
36
45
  process.exit();
37
46
  });
38
47
  }
39
- if(!mainPackage){
40
- mainPackage = {
41
- name,
42
- version : "1.0.0",
43
- "description": "",
44
- "main": "index.js",
45
- scripts : {
46
- start : "npx expo start -c",
47
- }
48
- }
48
+ if(!hasPackage){
49
49
  writeFile(mainPackagePath,JSON.stringify(mainPackage,null,2));
50
- exec("npm i @fto-consult/expo-ui").finally(()=>{
51
- return cb(mainPackage);
52
- });
50
+ exec("npm i @fto-consult/expo-ui",{projectRoot}).finally(cb);
53
51
  } else {
54
52
  return cb();
55
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.19.2",
3
+ "version": "6.19.4",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {