sabalong-ui 0.0.4 → 2.0.0

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/package.json +1 -1
  2. package/scripts/welcome.js +25 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sabalong-ui",
3
- "version": "0.0.4",
3
+ "version": "2.0.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -1,24 +1,34 @@
1
1
  const loadingChars = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
2
- let i = 0;
2
+ const totalSteps = 20;
3
+ let currentStep = 0;
3
4
 
4
- console.log('\n');
5
- console.log('\x1b[36m%s\x1b[0m', 'Menginstall Sabalong-UI');
5
+ console.log('\n\x1b[36m%s\x1b[0m', ' Preparing SabalongUI...');
6
6
 
7
7
  const loader = setInterval(() => {
8
- process.stdout.write(`\r\x1b[34m${loadingChars[i++ % loadingChars.length]}\x1b[0m Finalizing installation...`);
8
+ const char = loadingChars[currentStep % loadingChars.length];
9
+ const progress = Math.round((currentStep / totalSteps) * 100);
10
+ const bar = '█'.repeat(Math.floor(currentStep / 2)) + '░'.repeat(10 - Math.floor(currentStep / 2));
11
+
12
+ process.stdout.write(`\r \x1b[34m${char}\x1b[0m [${bar}] ${progress}%`);
13
+
14
+ if (currentStep >= totalSteps) {
15
+ clearInterval(loader);
16
+ process.stdout.write('\r\x1b[K');
17
+ showFinalMessage();
18
+ }
19
+ currentStep++;
9
20
  }, 100);
10
21
 
11
- setTimeout(() => {
12
- clearInterval(loader);
13
- process.stdout.write('\r');
14
-
15
- console.log('\x1b[32m%s\x1b[0m', 'Installation Complete!');
16
- console.log('\x1b[1m\x1b[33m%s\x1b[0m', ' Silamo sia ngoding! 🚀');
22
+ function showFinalMessage() {
23
+ console.log(' \x1b[32m✔\x1b[0m \x1b[1mInstallation Complete!\x1b[0m');
24
+ console.log('\n \x1b[1m\x1b[33m"Lamen sate balong kenang sabalong"\x1b[0m');
25
+ console.log(' \x1b[35mSilamo sia ngoding! 🚀\x1b[0m');
17
26
 
18
- console.log('\x1b[37m%s\x1b[0m', 'Developer: Rzfan03');
19
- console.log('\x1b[36m%s\x1b[0m', 'GitHub: \x1b]8;;https://github.com/Rzfan03\x07https://github.com/Rzfan03\x1b]8;;\x07');
20
- console.log('\x1b[34m%s\x1b[0m', 'Docs: https://sabalong-ui.vercel.app');
27
+ console.log('\n \x1b[90m─────────────────────────────────────────\x1b[0m');
28
+ console.log(' \x1b[37mDeveloper :\x1b[0m \x1b[1mRzfan03\x1b[0m');
29
+ console.log(' \x1b[37mGitHub :\x1b[0m \x1b[36mhttps://github.com/Rzfan03\x1b[0m');
30
+ console.log(' \x1b[37mDocs :\x1b[0m \x1b[34mhttps://sabalong-ui.vercel.app\x1b[0m');
31
+ console.log(' \x1b[90m─────────────────────────────────────────\x1b[0m\n');
21
32
 
22
- console.log('\n');
23
33
  process.exit(0);
24
- }, 2000);
34
+ }