purvex-ui 1.0.2 → 1.0.3
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 +1 -1
- package/src/index.js +4 -21
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const { Command } = require('commander');
|
|
4
4
|
const chalk = require('chalk');
|
|
5
|
-
|
|
5
|
+
// Import boxen yang benar
|
|
6
|
+
const boxen = require('boxen').default;
|
|
6
7
|
const { readFileSync } = require('fs');
|
|
7
8
|
const { join } = require('path');
|
|
8
9
|
|
|
@@ -61,22 +62,9 @@ program
|
|
|
61
62
|
const path = require('path');
|
|
62
63
|
|
|
63
64
|
try {
|
|
64
|
-
|
|
65
|
-
const possiblePaths = [
|
|
66
|
-
path.join(__dirname, '..', 'registry', 'components.json'),
|
|
67
|
-
path.join(__dirname, 'registry', 'components.json'),
|
|
68
|
-
path.join(process.cwd(), 'node_modules', 'purvex-ui', 'registry', 'components.json')
|
|
69
|
-
];
|
|
65
|
+
const registryPath = path.join(__dirname, '..', 'registry', 'components.json');
|
|
70
66
|
|
|
71
|
-
|
|
72
|
-
for (const p of possiblePaths) {
|
|
73
|
-
if (fs.existsSync(p)) {
|
|
74
|
-
registryPath = p;
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (!registryPath) {
|
|
67
|
+
if (!fs.existsSync(registryPath)) {
|
|
80
68
|
console.log(chalk.red('❌ Registry tidak ditemukan'));
|
|
81
69
|
console.log(chalk.yellow('\nKomponen yang tersedia:'));
|
|
82
70
|
console.log(chalk.cyan(' • button'));
|
|
@@ -96,11 +84,6 @@ program
|
|
|
96
84
|
|
|
97
85
|
} catch (error) {
|
|
98
86
|
console.error(chalk.red('❌ Error:'), error.message);
|
|
99
|
-
// Fallback
|
|
100
|
-
console.log(chalk.blue.bold('\n📦 Komponen (fallback):\n'));
|
|
101
|
-
console.log(chalk.cyan(' • button'));
|
|
102
|
-
console.log(chalk.cyan(' • card'));
|
|
103
|
-
console.log(chalk.cyan(' • avatar'));
|
|
104
87
|
}
|
|
105
88
|
});
|
|
106
89
|
|