create-fa-react 1.0.1 → 1.0.3
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/index.js +17 -12
- package/package.json +1 -1
- package/template/src/features/.gitkeep +0 -0
- package/template/src/shared/.gitkeep +0 -0
- package/template/src/shared/components/.gitkeep +0 -0
- package/template/src/shared/hooks/.gitkeep +0 -0
- package/template/src/shared/services/.gitkeep +0 -0
- package/template/src/shared/utils/.gitkeep +0 -0
package/index.js
CHANGED
|
@@ -11,7 +11,7 @@ const __dirname = path.dirname(__filename);
|
|
|
11
11
|
const projectName = process.argv[2];
|
|
12
12
|
|
|
13
13
|
if (!projectName) {
|
|
14
|
-
console.log(pc.red("
|
|
14
|
+
console.log(pc.red("Debes proporcionar un nombre de proyecto."));
|
|
15
15
|
process.exit(1);
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -19,22 +19,27 @@ const projectPath = path.join(process.cwd(), projectName);
|
|
|
19
19
|
const templatePath = path.join(__dirname, "template");
|
|
20
20
|
|
|
21
21
|
if (fs.existsSync(projectPath)) {
|
|
22
|
-
console.log(pc.red("
|
|
22
|
+
console.log(pc.red("La carpeta ya existe."));
|
|
23
23
|
process.exit(1);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
console.log(pc.cyan("
|
|
26
|
+
console.log(pc.cyan("Creando proyecto...\n"));
|
|
27
27
|
|
|
28
|
-
// crear carpeta
|
|
29
28
|
fs.mkdirSync(projectPath);
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
fs.cpSync(templatePath, projectPath, { recursive: true });
|
|
30
|
+
const files = fs.readdirSync(templatePath);
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
for (const file of files) {
|
|
33
|
+
fs.cpSync(
|
|
34
|
+
path.join(templatePath, file),
|
|
35
|
+
path.join(projectPath, file),
|
|
36
|
+
{ recursive: true }
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
console.log(pc.green("Proyecto creado correctamente!\n"));
|
|
35
41
|
|
|
36
|
-
console.log(pc.
|
|
37
|
-
console.log(pc.
|
|
38
|
-
console.log(pc.
|
|
39
|
-
console.log(pc.
|
|
40
|
-
console.log("");
|
|
42
|
+
console.log(pc.yellow("Siguientes pasos:"));
|
|
43
|
+
console.log(pc.white(` cd ${projectName}`));
|
|
44
|
+
console.log(pc.white(" npm install"));
|
|
45
|
+
console.log(pc.white(" npm run dev"));
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|