psf-cli 0.2.1 → 0.2.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/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -28,6 +28,13 @@ program
|
|
|
28
28
|
program.option("-t, --template <string>", "template type", "node");
|
|
29
29
|
program.option("-d, --dir <path>", "Output directory", process.cwd());
|
|
30
30
|
|
|
31
|
+
program
|
|
32
|
+
.command("list")
|
|
33
|
+
.description("Templates list")
|
|
34
|
+
.action(() => {
|
|
35
|
+
console.log(chalk.blue("Avaible templates:\n- node\n"));
|
|
36
|
+
});
|
|
37
|
+
|
|
31
38
|
// Init command
|
|
32
39
|
program
|
|
33
40
|
.command("init <projectName>")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from "fs/promises";
|
|
2
|
-
import packageJsonCreator from "./packageJsonCreator";
|
|
3
|
-
import gitignoreCreator from "./gitignoreCreator";
|
|
2
|
+
import packageJsonCreator from "./packageJsonCreator/index.js";
|
|
3
|
+
import gitignoreCreator from "./gitignoreCreator/index.js";
|
|
4
4
|
import path from "path";
|
|
5
5
|
|
|
6
6
|
// Creating a Node Project
|
|
@@ -20,8 +20,8 @@ async function folderCreator(dir, projectName) {
|
|
|
20
20
|
path.join(pathFolder, "README.md"),
|
|
21
21
|
"# New Node Project",
|
|
22
22
|
);
|
|
23
|
-
packageJsonCreator();
|
|
24
|
-
gitignoreCreator();
|
|
23
|
+
packageJsonCreator(pathFolder, projectName);
|
|
24
|
+
gitignoreCreator(pathFolder);
|
|
25
25
|
} catch (err) {
|
|
26
26
|
console.error("Error creating folder:", err);
|
|
27
27
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from "fs/promises";
|
|
2
|
+
import path from "path";
|
|
2
3
|
|
|
3
|
-
export default async function packageJsonCreator(projectName) {
|
|
4
|
+
export default async function packageJsonCreator(pathFolder, projectName) {
|
|
4
5
|
const packageJson = {
|
|
5
6
|
name: projectName,
|
|
6
7
|
version: "1.0.0",
|