@cyber-harbour/ui 1.0.76 → 1.0.77
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/switch-ui-lib.js +22 -4
- package/package.json +1 -1
package/bin/switch-ui-lib.js
CHANGED
|
@@ -94,7 +94,7 @@ async function main() {
|
|
|
94
94
|
message: 'Що підключити?',
|
|
95
95
|
choices: [
|
|
96
96
|
{ title: `Локальну бібліотеку (${localPath})`, value: 'local' },
|
|
97
|
-
{ title: '
|
|
97
|
+
{ title: 'Версію з NPM (latest, next, або конкретну версію)', value: 'npm' },
|
|
98
98
|
],
|
|
99
99
|
});
|
|
100
100
|
|
|
@@ -148,6 +148,24 @@ async function main() {
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
if (mode === 'npm') {
|
|
151
|
+
const versionResponse = await prompts({
|
|
152
|
+
type: 'text',
|
|
153
|
+
name: 'version',
|
|
154
|
+
message: 'Введіть версію або тег (latest, next, 2.0.0, alpha, beta):',
|
|
155
|
+
initial: 'latest',
|
|
156
|
+
validate: value => value.length > 0 ? true : 'Версія не може бути пустою'
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
if (!versionResponse.version) {
|
|
160
|
+
console.log('❌ Операція скасована.');
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const version = versionResponse.version.startsWith('@')
|
|
165
|
+
? versionResponse.version.substring(1)
|
|
166
|
+
: versionResponse.version;
|
|
167
|
+
const packageToInstall = `${packageName}@${version}`;
|
|
168
|
+
|
|
151
169
|
if (isUsingNpmVersion()) {
|
|
152
170
|
console.log('✅ Вже використовується версія з NPM.');
|
|
153
171
|
return;
|
|
@@ -176,9 +194,9 @@ async function main() {
|
|
|
176
194
|
}
|
|
177
195
|
|
|
178
196
|
// Встановлюємо пакет з NPM
|
|
179
|
-
console.log(
|
|
180
|
-
execSync(`npm install ${
|
|
181
|
-
console.log(
|
|
197
|
+
console.log(`🔄 Встановлюємо ${packageToInstall}...`);
|
|
198
|
+
execSync(`npm install ${packageToInstall}`, { stdio: 'inherit', cwd: projectRoot });
|
|
199
|
+
console.log(`✅ Успішно підключено ${packageToInstall}.`);
|
|
182
200
|
} catch (error) {
|
|
183
201
|
console.error('❌ Помилка при підключенні версії з NPM:', error.message);
|
|
184
202
|
}
|