create-fa-react 1.0.3 → 1.0.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.
- package/create-fa-react-1.0.3.tgz +0 -0
- package/index.js +3 -8
- package/package.json +1 -1
- package/removePlaceholders.js +22 -0
- package/template/src/app/.gitkeep +0 -0
|
Binary file
|
package/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import fs from "fs";
|
|
|
4
4
|
import path from "path";
|
|
5
5
|
import pc from "picocolors";
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
|
+
import { removePlaceholders } from "./removePlaceholders.js";
|
|
7
8
|
|
|
8
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
9
10
|
const __dirname = path.dirname(__filename);
|
|
@@ -27,15 +28,9 @@ console.log(pc.cyan("Creando proyecto...\n"));
|
|
|
27
28
|
|
|
28
29
|
fs.mkdirSync(projectPath);
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
fs.cpSync(templatePath, projectPath, { recursive: true });
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
fs.cpSync(
|
|
34
|
-
path.join(templatePath, file),
|
|
35
|
-
path.join(projectPath, file),
|
|
36
|
-
{ recursive: true }
|
|
37
|
-
);
|
|
38
|
-
}
|
|
33
|
+
removePlaceholders(projectPath);
|
|
39
34
|
|
|
40
35
|
console.log(pc.green("Proyecto creado correctamente!\n"));
|
|
41
36
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
export function removePlaceholders(dir) {
|
|
5
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
6
|
+
|
|
7
|
+
for (const entry of entries) {
|
|
8
|
+
const fullPath = path.join(dir, entry.name);
|
|
9
|
+
|
|
10
|
+
if (entry.isDirectory()) {
|
|
11
|
+
removePlaceholders(fullPath);
|
|
12
|
+
} else {
|
|
13
|
+
if (
|
|
14
|
+
entry.name === ".gitkeep" ||
|
|
15
|
+
entry.name === ".keep" ||
|
|
16
|
+
entry.name === ".placeholder"
|
|
17
|
+
) {
|
|
18
|
+
fs.unlinkSync(fullPath);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
File without changes
|