unictive-angular 1.0.30 → 1.0.31
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/utils/createProject.js +27 -1
- package/package.json +1 -1
|
@@ -78,8 +78,34 @@ async function create_project() {
|
|
|
78
78
|
process.exit(1);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
// Pilih zoneless atau tidak
|
|
82
|
+
const rl = readline.createInterface({
|
|
83
|
+
input: process.stdin,
|
|
84
|
+
output: process.stdout,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
function ask(q) {
|
|
88
|
+
return new Promise((resolve) => rl.question(q, resolve));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
let zoneless = false;
|
|
92
|
+
while (true) {
|
|
93
|
+
const answer = (await ask("Gunakan zoneless? (y/n): ")).trim().toLowerCase();
|
|
94
|
+
if (answer === "y") {
|
|
95
|
+
zoneless = true;
|
|
96
|
+
break;
|
|
97
|
+
} else if (answer === "n") {
|
|
98
|
+
zoneless = false;
|
|
99
|
+
break;
|
|
100
|
+
} else {
|
|
101
|
+
show_status("Jawaban tidak valid! Ketik 'y' atau 'n'.", "error");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
rl.close();
|
|
105
|
+
|
|
81
106
|
show_status(`Membuat project Angular: ${projectName}`, "info");
|
|
82
|
-
|
|
107
|
+
let cmd = `ng new ${projectName} ${zoneless ? "--zoneless" : ""} --ssr=false --skip-git --style=css`;
|
|
108
|
+
execSync(cmd.trim(), { stdio: "inherit" });
|
|
83
109
|
process.chdir(projectName);
|
|
84
110
|
show_status("Project berhasil dibuat!", "success");
|
|
85
111
|
return projectName;
|
package/package.json
CHANGED