unictive-angular 1.0.4 → 1.0.6

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.
Files changed (2) hide show
  1. package/bin/index.js +16 -2
  2. package/package.json +4 -3
package/bin/index.js CHANGED
@@ -15,7 +15,8 @@ const { show_status, run_with_spinner } = require('./utils/showStatus');
15
15
  const { setupAssets } = require('./utils/setupAssets');
16
16
  const { create_project } = require('./utils/createProject');
17
17
  const { update_package_json } = require('./utils/updatePackageJson');
18
- const updateNotifier = require("update-notifier")
18
+ const updateNotifier = require("update-notifier");
19
+ const chalk = require('chalk');
19
20
 
20
21
 
21
22
  // Baca versi dari package.json
@@ -28,7 +29,20 @@ if (process.argv.includes("-v") || process.argv.includes("--version")) {
28
29
  }
29
30
 
30
31
  // ===================== Notifikasi Update =====================
31
- updateNotifier({ pkg, updateCheckInterval: 1000 * 60 * 60 * 24 }).notify();
32
+ const notifier = updateNotifier({ pkg, updateCheckInterval: 1000 * 60 * 60 * 24 });
33
+
34
+ if (notifier.update) {
35
+ console.log(`
36
+ ${chalk.yellow('⚠ Update tersedia untuk unictive-angular CLI ini!')}
37
+ ${chalk.gray('Versi lokal ')} : ${chalk.red(notifier.update.current)}
38
+ ${chalk.gray('Versi terbaru')} : ${chalk.green(notifier.update.latest)}
39
+
40
+ ${chalk.gray('Jalankan perintah berikut untuk update:')}
41
+ ${chalk.cyan(`npm i -g ${pkg.name}`)}
42
+
43
+ ${chalk.gray('Catatan: Versi terbaru ini mungkin berisi fitur tambahan dan perbaikan bug.')}
44
+ `);
45
+ }
32
46
 
33
47
  // ===================== Utility =====================
34
48
  const sleep = (ms) => new Promise((res) => setTimeout(res, ms));
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "unictive-angular",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "CLI untuk membuat project Angular dengan struktur kustom (Modules, Core, API, Shared).",
5
5
  "scripts": {
6
- "build": "npm publish --access public"
6
+ "build": "npm version patch && npm publish --access public"
7
7
  },
8
8
  "bin": {
9
9
  "unictive-angular": "./bin/index.js"
@@ -17,6 +17,7 @@
17
17
  "author": "EkaHersada",
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
- "update-notifier": "^7.3.1"
20
+ "chalk": "^5.6.0",
21
+ "update-notifier": "^6.0.2"
21
22
  }
22
23
  }