@fto-consult/expo-ui 6.19.0 → 6.19.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/bin/create-app.js CHANGED
@@ -1,14 +1,20 @@
1
- const {exec,thowError,copy,writeFile} = require("./utils");
1
+ const {exec,thowError,copy,writeFile,createDirSync} = require("./utils");
2
2
  const fs = require("fs"), path = require("path");
3
3
  const createAppDir = path.resolve(__dirname,"create-app");
4
4
  module.exports = function(parsedArgs,{projectRoot}){
5
5
  const packageObj = require("../package.json");
6
- const root = process.cwd(), mainPackagePath = path.resolve(root,"package.json");
6
+ let root = process.cwd(), mainPackagePath = path.resolve(root,"package.json");
7
7
  let mainPackage = fs.existsSync(mainPackagePath) && require(`${mainPackagePath}`) || null;
8
8
  const name = String(parsedArgs.name||parsedArgs.appName || mainPackage?.name).trim();
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){
13
+ const newDir = createDirSync(path.resolve(root,name.trim()));
14
+ projectRoot = newDir || projectRoot;
15
+ mainPackagePath = path.resolve(projectRoot,"package.json");
16
+ console.log(projectRoot," is new project root ",mainPackage);
17
+ }
12
18
  const cb = (pkg,)=>{
13
19
  mainPackage = pkg && typeof pkg =='object' && pkg || mainPackage;
14
20
  const devDpendencies = packageObj.devDependencies;
package/bin/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+
2
3
  /**
3
4
  toujours ajouter l'instruction ci-dessus à la première ligne de chaque script npx
4
5
  @see : https://blog.shahednasser.com/how-to-create-a-npx-tool/ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.19.0",
3
+ "version": "6.19.2",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {