unictive-angular 1.0.31 → 1.0.36
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.
|
@@ -79,32 +79,34 @@ async function create_project() {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
// Pilih zoneless atau tidak
|
|
82
|
-
const rl = readline.createInterface({
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
function ask(q) {
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
let zoneless = false;
|
|
92
|
-
while (true) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
rl.close();
|
|
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
105
|
|
|
106
106
|
show_status(`Membuat project Angular: ${projectName}`, "info");
|
|
107
|
-
let cmd = `ng new ${projectName} ${zoneless ? "--zoneless" : ""} --ssr=false --skip-git --style=css`;
|
|
107
|
+
// let cmd = `ng new ${projectName} ${zoneless ? "--zoneless" : ""} --ssr=false --skip-git --style=css`;
|
|
108
|
+
let cmd = `ng new ${projectName} --zoneless --ssr=false --skip-git --style=css`;
|
|
109
|
+
// let cmd = `ng new ${projectName} --ssr=false --skip-git --style=css`;
|
|
108
110
|
execSync(cmd.trim(), { stdio: "inherit" });
|
|
109
111
|
process.chdir(projectName);
|
|
110
112
|
show_status("Project berhasil dibuat!", "success");
|
|
@@ -7,10 +7,16 @@ const path_template = path.join(__dirname, "resource");
|
|
|
7
7
|
// Bisa, Anda dapat menambahkan nama file ke dalam array folders_to_copy.
|
|
8
8
|
// Misal:
|
|
9
9
|
const folders_to_copy = [
|
|
10
|
-
"src",
|
|
10
|
+
"src/app/API",
|
|
11
|
+
"src/app/core",
|
|
12
|
+
"src/app/shared",
|
|
13
|
+
"src/app/app.config.ts",
|
|
14
|
+
"src/app/app.routes.ts",
|
|
15
|
+
"src/app/app.ts",
|
|
16
|
+
"src/environments",
|
|
17
|
+
// "package.json",
|
|
18
|
+
// "tailwind.config.js",
|
|
11
19
|
".postcssrc.json",
|
|
12
|
-
"package.json",
|
|
13
|
-
"tailwind.config.js",
|
|
14
20
|
"tsconfig.json",
|
|
15
21
|
];
|
|
16
22
|
|
|
@@ -91,7 +91,7 @@ function refactorAngularJson() {
|
|
|
91
91
|
}
|
|
92
92
|
];
|
|
93
93
|
|
|
94
|
-
// 5. Generate environment JSON di src/
|
|
94
|
+
// 5. Generate environment JSON di src/environments
|
|
95
95
|
envFiles.forEach(file => {
|
|
96
96
|
const jsonFileName = file.name;
|
|
97
97
|
const jsonPath = path.join(envPath, jsonFileName);
|
package/index.js
CHANGED
|
@@ -34,7 +34,12 @@ const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "./package.json"), "
|
|
|
34
34
|
|
|
35
35
|
// ===================== Cek argumen versi =====================
|
|
36
36
|
if (process.argv.includes("-v") || process.argv.includes("--version")) {
|
|
37
|
-
|
|
37
|
+
let versionInfo = `${pkg.name} v${pkg.version}`;
|
|
38
|
+
const notifier = updateNotifier({ pkg, updateCheckInterval: 0 });
|
|
39
|
+
if (notifier.update) {
|
|
40
|
+
versionInfo += ` (Versi terbaru: ${notifier.update.latest})`;
|
|
41
|
+
}
|
|
42
|
+
console.log(versionInfo);
|
|
38
43
|
process.exit(0);
|
|
39
44
|
}
|
|
40
45
|
|
|
@@ -183,6 +188,7 @@ async function main() {
|
|
|
183
188
|
const projectName = await create_project();
|
|
184
189
|
await sleep(1000);
|
|
185
190
|
copy_template();
|
|
191
|
+
|
|
186
192
|
await sleep(1000);
|
|
187
193
|
refactorAngularJson();
|
|
188
194
|
await sleep(1000);
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unictive-angular",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.36",
|
|
4
4
|
"description": "CLI untuk membuat project Angular dengan struktur kustom (Modules, Core, API, Shared).",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "npm version patch && npm publish
|
|
6
|
+
"build": "npm version patch && npm publish"
|
|
7
7
|
},
|
|
8
8
|
"bin": {
|
|
9
9
|
"unictive-angular": "./index.js"
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// tailwind.config.js
|
|
2
|
-
module.exports = {
|
|
3
|
-
content: ["./src/**/*.{html,ts,scss}"], // sesuaikan dengan proyekmu
|
|
4
|
-
|
|
5
|
-
theme: {
|
|
6
|
-
extend: {
|
|
7
|
-
colors: {
|
|
8
|
-
brand: '#1E40AF', // kamu bisa ganti nama dan nilainya
|
|
9
|
-
},
|
|
10
|
-
fontFamily: {
|
|
11
|
-
inter_bold: ['Inter-Bold', 'sans-serif'],
|
|
12
|
-
inter_semibold: ['Inter-Semibold', 'sans-serif'],
|
|
13
|
-
inter_regular: ['Inter-Regular', 'sans-serif'],
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
plugins: [],
|
|
18
|
-
}
|
|
19
|
-
|