vectorvesper 0.2.0 → 0.3.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.
- package/dist/index.js +118 -44
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -231,7 +231,7 @@ function loadConfig(cwd = process.cwd()) {
|
|
|
231
231
|
raw = JSON.parse(content);
|
|
232
232
|
} catch {
|
|
233
233
|
throw new Error(
|
|
234
|
-
`Failed to parse vv.config.json \u2014 the file contains invalid JSON. Delete it and run "
|
|
234
|
+
`Failed to parse vv.config.json \u2014 the file contains invalid JSON. Delete it and run "npx vectorvesper init" to regenerate.`
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
237
|
const result = VVConfigSchema.safeParse(raw);
|
|
@@ -240,7 +240,7 @@ function loadConfig(cwd = process.cwd()) {
|
|
|
240
240
|
throw new Error(
|
|
241
241
|
`Invalid vv.config.json \u2014 schema validation failed:
|
|
242
242
|
${issues}
|
|
243
|
-
Delete the file and run "
|
|
243
|
+
Delete the file and run "npx vectorvesper init" to regenerate.`
|
|
244
244
|
);
|
|
245
245
|
}
|
|
246
246
|
return result.data;
|
|
@@ -398,7 +398,7 @@ async function initCommand(options = {}) {
|
|
|
398
398
|
\u2022 Target directory created at ${pc2.cyan(targetLocalDir)}
|
|
399
399
|
\u2022 Manifest created at ${pc2.cyan("vv-manifest.json")}
|
|
400
400
|
|
|
401
|
-
\u{1F449} Next, run: ${pc2.bold(pc2.cyan("
|
|
401
|
+
\u{1F449} Next, run: ${pc2.bold(pc2.cyan("npx vectorvesper add <slug>"))} to add a component.`
|
|
402
402
|
);
|
|
403
403
|
} catch (error) {
|
|
404
404
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -427,25 +427,25 @@ function handleHttpError(status, url) {
|
|
|
427
427
|
case 401:
|
|
428
428
|
throw new Error(
|
|
429
429
|
`Authentication required. This component requires a valid license key.
|
|
430
|
-
\u{1F449} Run "
|
|
430
|
+
\u{1F449} Run "npx vectorvesper login <your-license-key>" to authenticate.
|
|
431
431
|
\u{1F511} Get a license at https://vectorvesper.dev/pricing`
|
|
432
432
|
);
|
|
433
433
|
case 402:
|
|
434
434
|
throw new Error(
|
|
435
435
|
`This is a Pro component and requires a license.
|
|
436
436
|
\u{1F449} Get lifetime access at https://vectorvesper.dev/pricing
|
|
437
|
-
\u{1F4A1} Run "
|
|
437
|
+
\u{1F4A1} Run "npx vectorvesper list" to see all free components.`
|
|
438
438
|
);
|
|
439
439
|
case 403:
|
|
440
440
|
throw new Error(
|
|
441
441
|
`Access denied. Your license doesn't include this component.
|
|
442
442
|
\u{1F449} Check your account at https://vectorvesper.dev/account
|
|
443
|
-
\u{1F4A1} Run "
|
|
443
|
+
\u{1F4A1} Run "npx vectorvesper whoami" to see your current access.`
|
|
444
444
|
);
|
|
445
445
|
case 404:
|
|
446
446
|
throw new Error(
|
|
447
447
|
`Component not found in the registry.
|
|
448
|
-
\u{1F449} Run "
|
|
448
|
+
\u{1F449} Run "npx vectorvesper list" to see all available components.`
|
|
449
449
|
);
|
|
450
450
|
case 429:
|
|
451
451
|
throw new Error(
|
|
@@ -599,10 +599,10 @@ async function listCommand() {
|
|
|
599
599
|
console.log(`
|
|
600
600
|
${pc3.green(String(freeCount))} free components${proCount > 0 ? ` \xB7 ${pc3.magenta(String(proCount))} pro components` : ""}`);
|
|
601
601
|
if (proCount > 0 && !hasAuth) {
|
|
602
|
-
console.log(` \u{1F511} ${pc3.dim("Unlock pro components:")} ${pc3.cyan("
|
|
602
|
+
console.log(` \u{1F511} ${pc3.dim("Unlock pro components:")} ${pc3.cyan("npx vectorvesper login <key>")} ${pc3.dim("\xB7")} ${pc3.cyan("https://vectorvesper.dev/pricing")}`);
|
|
603
603
|
}
|
|
604
604
|
console.log(`
|
|
605
|
-
\u{1F449} Run ${pc3.bold(pc3.cyan("
|
|
605
|
+
\u{1F449} Run ${pc3.bold(pc3.cyan("npx vectorvesper add <slug>"))} to add a component to your project.
|
|
606
606
|
`);
|
|
607
607
|
} catch (error) {
|
|
608
608
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -641,7 +641,7 @@ async function resolveComponentTree(slug) {
|
|
|
641
641
|
if (component.tier === "pro" && !getAuthToken()) {
|
|
642
642
|
throw new Error(
|
|
643
643
|
`"${componentSlug}" is a Pro component and requires a license.
|
|
644
|
-
\u{1F449} Run ${pc4.cyan("
|
|
644
|
+
\u{1F449} Run ${pc4.cyan("npx vectorvesper login <your-license-key>")} to unlock pro components.
|
|
645
645
|
\u{1F511} Get a license at ${pc4.cyan("https://vectorvesper.dev/pricing")}`
|
|
646
646
|
);
|
|
647
647
|
}
|
|
@@ -714,6 +714,37 @@ function recordInstall(components, installDir, projectRoot) {
|
|
|
714
714
|
}
|
|
715
715
|
writeManifest(projectRoot, manifest);
|
|
716
716
|
}
|
|
717
|
+
function findOrphanedFiles(components, installDir, projectRoot, previousManifest) {
|
|
718
|
+
const compDir = path5.join(projectRoot, installDir);
|
|
719
|
+
const currentTargets = /* @__PURE__ */ new Set();
|
|
720
|
+
for (const component of components) {
|
|
721
|
+
for (const file of component.files) currentTargets.add(file.target);
|
|
722
|
+
}
|
|
723
|
+
const orphans = [];
|
|
724
|
+
const seen = /* @__PURE__ */ new Set();
|
|
725
|
+
for (const component of components) {
|
|
726
|
+
const entry = previousManifest.components[component.slug];
|
|
727
|
+
if (!entry) continue;
|
|
728
|
+
for (const target of entry.files) {
|
|
729
|
+
if (currentTargets.has(target)) continue;
|
|
730
|
+
if (seen.has(target)) continue;
|
|
731
|
+
seen.add(target);
|
|
732
|
+
const absolutePath = path5.resolve(compDir, target);
|
|
733
|
+
const relativeFromRoot = path5.relative(projectRoot, absolutePath);
|
|
734
|
+
if (relativeFromRoot.startsWith("..") || path5.isAbsolute(relativeFromRoot)) continue;
|
|
735
|
+
if (!fs5.existsSync(absolutePath)) continue;
|
|
736
|
+
orphans.push({ absolutePath, relativePath: relativeFromRoot, target });
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
return orphans;
|
|
740
|
+
}
|
|
741
|
+
function removeFiles(files) {
|
|
742
|
+
for (const file of files) {
|
|
743
|
+
if (fs5.existsSync(file.absolutePath)) {
|
|
744
|
+
fs5.rmSync(file.absolutePath, { force: true });
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
717
748
|
|
|
718
749
|
// src/utils/install.ts
|
|
719
750
|
import fs6 from "fs";
|
|
@@ -889,6 +920,39 @@ Installing dependencies with ${projectInfo.packageManager}...`));
|
|
|
889
920
|
console.log(` Run manually: ${pc6.bold(pc6.cyan(installCmd))}`);
|
|
890
921
|
}
|
|
891
922
|
}
|
|
923
|
+
async function handlePrune(orphans, slug, options) {
|
|
924
|
+
if (orphans.length === 0) return;
|
|
925
|
+
const list = orphans.map((o) => ` ${pc6.dim("\u2022")} ${pc6.cyan(o.relativePath)}`).join("\n");
|
|
926
|
+
let shouldPrune = options.prune === true;
|
|
927
|
+
if (!shouldPrune) {
|
|
928
|
+
console.log(
|
|
929
|
+
pc6.yellow(
|
|
930
|
+
`
|
|
931
|
+
\u{1F9F9} ${orphans.length} file(s) from a previous version of ${pc6.cyan(slug)} are no longer part of it:`
|
|
932
|
+
)
|
|
933
|
+
);
|
|
934
|
+
console.log(list);
|
|
935
|
+
if (options.yes) {
|
|
936
|
+
console.log(pc6.dim(` Re-run with ${pc6.cyan("--prune")} to remove them.`));
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
const answer = await confirm2({
|
|
940
|
+
message: "Remove these orphaned files?",
|
|
941
|
+
initialValue: true
|
|
942
|
+
});
|
|
943
|
+
if (isCancel2(answer) || !answer) {
|
|
944
|
+
console.log(pc6.dim(` Left in place. Run with ${pc6.cyan("--prune")} later to remove them.`));
|
|
945
|
+
return;
|
|
946
|
+
}
|
|
947
|
+
shouldPrune = true;
|
|
948
|
+
}
|
|
949
|
+
removeFiles(orphans);
|
|
950
|
+
console.log(pc6.green(`
|
|
951
|
+
\u{1F9F9} Removed ${orphans.length} orphaned file(s):`));
|
|
952
|
+
for (const o of orphans) {
|
|
953
|
+
console.log(` ${pc6.red("\u2212")} ${pc6.cyan(o.relativePath)}`);
|
|
954
|
+
}
|
|
955
|
+
}
|
|
892
956
|
async function addCommand(slug, options = {}) {
|
|
893
957
|
try {
|
|
894
958
|
validateSlug(slug);
|
|
@@ -908,7 +972,7 @@ async function addCommand(slug, options = {}) {
|
|
|
908
972
|
if (!config) {
|
|
909
973
|
console.error(
|
|
910
974
|
`${pc6.red(pc6.bold("Error:"))} No ${pc6.cyan("vv.config.json")} found in this directory.
|
|
911
|
-
\u{1F449} Run ${pc6.bold(pc6.cyan("
|
|
975
|
+
\u{1F449} Run ${pc6.bold(pc6.cyan("npx vectorvesper init"))} first to set up your project.`
|
|
912
976
|
);
|
|
913
977
|
process.exit(1);
|
|
914
978
|
return;
|
|
@@ -959,6 +1023,13 @@ async function addCommand(slug, options = {}) {
|
|
|
959
1023
|
}
|
|
960
1024
|
const targetComponent = resolvedComponents[resolvedComponents.length - 1];
|
|
961
1025
|
const installPath = toForwardSlash(path7.join(componentInstallDir, targetComponent.slug));
|
|
1026
|
+
let orphans = [];
|
|
1027
|
+
try {
|
|
1028
|
+
const previousManifest = readManifest(projectRoot);
|
|
1029
|
+
orphans = findOrphanedFiles(resolvedComponents, componentInstallDir, projectRoot, previousManifest);
|
|
1030
|
+
} catch {
|
|
1031
|
+
orphans = [];
|
|
1032
|
+
}
|
|
962
1033
|
if (options.dryRun) {
|
|
963
1034
|
spinner.succeed(pc6.yellow("Dry-run: simulation completed. No files were written."));
|
|
964
1035
|
console.log(pc6.bold(pc6.yellow("\n[Dry Run] Files that would be created/modified:")));
|
|
@@ -966,6 +1037,13 @@ async function addCommand(slug, options = {}) {
|
|
|
966
1037
|
const status = fs7.existsSync(file.absolutePath) ? pc6.yellow("(exists, would overwrite)") : pc6.green("(new)");
|
|
967
1038
|
console.log(` ${pc6.cyan(file.relativePath)} ${status}`);
|
|
968
1039
|
}
|
|
1040
|
+
if (orphans.length > 0) {
|
|
1041
|
+
console.log(pc6.bold(pc6.yellow("\n[Dry Run] Orphaned files from a previous version:")));
|
|
1042
|
+
for (const o of orphans) {
|
|
1043
|
+
const note = options.prune ? pc6.red("(would remove)") : pc6.dim("(use --prune to remove)");
|
|
1044
|
+
console.log(` ${pc6.cyan(o.relativePath)} ${note}`);
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
969
1047
|
const missing = getMissingDependencies(resolvedComponents, projectRoot);
|
|
970
1048
|
if (missing.length > 0) {
|
|
971
1049
|
console.log(pc6.yellow(`
|
|
@@ -979,6 +1057,7 @@ async function addCommand(slug, options = {}) {
|
|
|
979
1057
|
}
|
|
980
1058
|
if (filesToWrite.length === 0) {
|
|
981
1059
|
spinner.succeed(pc6.green("All files skipped (already up to date)."));
|
|
1060
|
+
await handlePrune(orphans, targetComponent.slug, options);
|
|
982
1061
|
return;
|
|
983
1062
|
}
|
|
984
1063
|
spinner.text = "Writing component files...";
|
|
@@ -995,13 +1074,14 @@ async function addCommand(slug, options = {}) {
|
|
|
995
1074
|
} catch (error) {
|
|
996
1075
|
const message = error instanceof Error ? error.message : String(error);
|
|
997
1076
|
logger.warn(`Failed to update vv-manifest.json: ${message}`);
|
|
998
|
-
logger.warn("Component was installed but may not appear in '
|
|
1077
|
+
logger.warn("Component was installed but may not appear in 'npx vectorvesper info' or 'npx vectorvesper diff'.");
|
|
999
1078
|
}
|
|
1000
1079
|
spinner.succeed(pc6.green("Files written successfully!"));
|
|
1001
1080
|
console.log(pc6.dim("\nCreated files:"));
|
|
1002
1081
|
for (const file of filesToWrite) {
|
|
1003
1082
|
console.log(` ${pc6.green("\u2714")} ${pc6.cyan(file.relativePath)}`);
|
|
1004
1083
|
}
|
|
1084
|
+
await handlePrune(orphans, targetComponent.slug, options);
|
|
1005
1085
|
await handleDependencies(resolvedComponents, projectRoot, projectInfo, options);
|
|
1006
1086
|
printGuidance(targetComponent, {
|
|
1007
1087
|
alias: config.aliases.vv,
|
|
@@ -1033,7 +1113,7 @@ async function updateCommand(slug, options = {}) {
|
|
|
1033
1113
|
if (!config) {
|
|
1034
1114
|
console.error(
|
|
1035
1115
|
`${pc7.red(pc7.bold("Error:"))} No ${pc7.cyan("vv.config.json")} found.
|
|
1036
|
-
\u{1F449} Run ${pc7.bold(pc7.cyan("
|
|
1116
|
+
\u{1F449} Run ${pc7.bold(pc7.cyan("npx vectorvesper init"))} first.`
|
|
1037
1117
|
);
|
|
1038
1118
|
process.exit(1);
|
|
1039
1119
|
return;
|
|
@@ -1045,7 +1125,7 @@ async function updateCommand(slug, options = {}) {
|
|
|
1045
1125
|
if (installedSlugs.length === 0) {
|
|
1046
1126
|
console.log(pc7.yellow(`
|
|
1047
1127
|
\u26A0\uFE0F No components are installed in this project.`));
|
|
1048
|
-
console.log(`\u{1F449} Add one with ${pc7.bold(pc7.cyan("
|
|
1128
|
+
console.log(`\u{1F449} Add one with ${pc7.bold(pc7.cyan("npx vectorvesper add <slug>"))}
|
|
1049
1129
|
`);
|
|
1050
1130
|
return;
|
|
1051
1131
|
}
|
|
@@ -1064,7 +1144,7 @@ async function updateCommand(slug, options = {}) {
|
|
|
1064
1144
|
if (!manifest.components[slug]) {
|
|
1065
1145
|
console.log(pc7.red(`
|
|
1066
1146
|
\u274C Component "${slug}" is not installed in this project.`));
|
|
1067
|
-
console.log(`\u{1F449} Run ${pc7.cyan(`
|
|
1147
|
+
console.log(`\u{1F449} Run ${pc7.cyan(`npx vectorvesper add ${slug}`)} to install it.
|
|
1068
1148
|
`);
|
|
1069
1149
|
return;
|
|
1070
1150
|
}
|
|
@@ -1076,6 +1156,7 @@ async function updateCommand(slug, options = {}) {
|
|
|
1076
1156
|
const updated = [];
|
|
1077
1157
|
const upToDate = [];
|
|
1078
1158
|
const failed = [];
|
|
1159
|
+
const updatedComponents = [];
|
|
1079
1160
|
for (const target of targets) {
|
|
1080
1161
|
spinner.text = `Updating ${pc7.cyan(target)}...`;
|
|
1081
1162
|
try {
|
|
@@ -1090,6 +1171,7 @@ async function updateCommand(slug, options = {}) {
|
|
|
1090
1171
|
writeFiles(planned.map((f) => ({ absolutePath: f.absolutePath, content: f.content })));
|
|
1091
1172
|
recordInstall(components, installDir, projectRoot);
|
|
1092
1173
|
updated.push(`${target} \u2192 ${remote.version}`);
|
|
1174
|
+
updatedComponents.push(...components);
|
|
1093
1175
|
} catch (error) {
|
|
1094
1176
|
const message = error instanceof Error ? error.message : String(error);
|
|
1095
1177
|
failed.push({ slug: target, reason: message });
|
|
@@ -1113,6 +1195,9 @@ async function updateCommand(slug, options = {}) {
|
|
|
1113
1195
|
for (const f of failed) console.log(` ${pc7.red("\u2716")} ${f.slug}: ${pc7.dim(f.reason)}`);
|
|
1114
1196
|
}
|
|
1115
1197
|
console.log("");
|
|
1198
|
+
if (updatedComponents.length > 0) {
|
|
1199
|
+
await handleDependencies(updatedComponents, projectRoot, projectInfo, options);
|
|
1200
|
+
}
|
|
1116
1201
|
if (failed.length > 0) process.exit(1);
|
|
1117
1202
|
}
|
|
1118
1203
|
|
|
@@ -1143,7 +1228,7 @@ async function removeCommand(slug, options = {}) {
|
|
|
1143
1228
|
if (!config) {
|
|
1144
1229
|
console.error(
|
|
1145
1230
|
`${pc8.red(pc8.bold("Error:"))} No ${pc8.cyan("vv.config.json")} found.
|
|
1146
|
-
\u{1F449} Run ${pc8.bold(pc8.cyan("
|
|
1231
|
+
\u{1F449} Run ${pc8.bold(pc8.cyan("npx vectorvesper init"))} first.`
|
|
1147
1232
|
);
|
|
1148
1233
|
process.exit(1);
|
|
1149
1234
|
return;
|
|
@@ -1153,7 +1238,7 @@ async function removeCommand(slug, options = {}) {
|
|
|
1153
1238
|
if (!entry) {
|
|
1154
1239
|
console.log(pc8.yellow(`
|
|
1155
1240
|
\u26A0\uFE0F Component "${slug}" is not installed (not in vv-manifest.json).`));
|
|
1156
|
-
console.log(`\u{1F449} See installed components with ${pc8.bold(pc8.cyan("
|
|
1241
|
+
console.log(`\u{1F449} See installed components with ${pc8.bold(pc8.cyan("npx vectorvesper info"))}
|
|
1157
1242
|
`);
|
|
1158
1243
|
return;
|
|
1159
1244
|
}
|
|
@@ -1217,7 +1302,7 @@ Remove ${slug}
|
|
|
1217
1302
|
import fs9 from "fs";
|
|
1218
1303
|
import path9 from "path";
|
|
1219
1304
|
import pc9 from "picocolors";
|
|
1220
|
-
var CLI_VERSION = true ? "0.
|
|
1305
|
+
var CLI_VERSION = true ? "0.3.0" : "0.0.0-dev";
|
|
1221
1306
|
async function infoCommand() {
|
|
1222
1307
|
console.log(pc9.bold(pc9.cyan("\nVector Vesper Diagnostics\n")));
|
|
1223
1308
|
const projectInfo = detectProject();
|
|
@@ -1237,17 +1322,6 @@ async function infoCommand() {
|
|
|
1237
1322
|
console.log(` \u2022 Has src/ folder: ${pc9.cyan(projectInfo.hasSrcDir ? "Yes" : "No")}`);
|
|
1238
1323
|
console.log(` \u2022 Tailwind CSS: ${pc9.cyan(projectInfo.hasTailwind ? "Yes" : "No")}`);
|
|
1239
1324
|
console.log("");
|
|
1240
|
-
console.log(pc9.bold(pc9.white("Authentication:")));
|
|
1241
|
-
const token = getAuthToken();
|
|
1242
|
-
if (token) {
|
|
1243
|
-
const maskedKey = token.slice(0, 6) + "\u2026" + token.slice(-4);
|
|
1244
|
-
console.log(` \u2022 Status: ${pc9.green("Authenticated")}`);
|
|
1245
|
-
console.log(` \u2022 Key: ${pc9.cyan(maskedKey)}`);
|
|
1246
|
-
} else {
|
|
1247
|
-
console.log(` \u2022 Status: ${pc9.yellow("Anonymous (free tier)")}`);
|
|
1248
|
-
console.log(` ${pc9.dim(" Run")} ${pc9.cyan("vv login <key>")} ${pc9.dim("to unlock pro components")}`);
|
|
1249
|
-
}
|
|
1250
|
-
console.log("");
|
|
1251
1325
|
console.log(pc9.bold(pc9.white("Configuration (vv.config.json):")));
|
|
1252
1326
|
if (config) {
|
|
1253
1327
|
console.log(` \u2022 Framework Set: ${pc9.cyan(config.framework)}`);
|
|
@@ -1298,7 +1372,7 @@ async function diffCommand(slug) {
|
|
|
1298
1372
|
if (!fs10.existsSync(manifestPath)) {
|
|
1299
1373
|
console.log(pc10.yellow(`
|
|
1300
1374
|
\u26A0\uFE0F No vv-manifest.json found in this directory.`));
|
|
1301
|
-
console.log(`\u{1F449} Add components first using ${pc10.bold(pc10.cyan("
|
|
1375
|
+
console.log(`\u{1F449} Add components first using ${pc10.bold(pc10.cyan("npx vectorvesper add <slug>"))}
|
|
1302
1376
|
`);
|
|
1303
1377
|
return;
|
|
1304
1378
|
}
|
|
@@ -1315,7 +1389,7 @@ async function diffCommand(slug) {
|
|
|
1315
1389
|
if (installedSlugs.length === 0) {
|
|
1316
1390
|
console.log(pc10.yellow(`
|
|
1317
1391
|
\u26A0\uFE0F No components are registered as installed in vv-manifest.json.`));
|
|
1318
|
-
console.log(`\u{1F449} Add components using ${pc10.bold(pc10.cyan("
|
|
1392
|
+
console.log(`\u{1F449} Add components using ${pc10.bold(pc10.cyan("npx vectorvesper add <slug>"))}
|
|
1319
1393
|
`);
|
|
1320
1394
|
return;
|
|
1321
1395
|
}
|
|
@@ -1332,7 +1406,7 @@ async function diffCommand(slug) {
|
|
|
1332
1406
|
if (!installedComponents[slug]) {
|
|
1333
1407
|
console.log(pc10.red(`
|
|
1334
1408
|
\u274C Component "${slug}" is not installed in this project.`));
|
|
1335
|
-
console.log(`\u{1F449} Run ${pc10.cyan(`
|
|
1409
|
+
console.log(`\u{1F449} Run ${pc10.cyan(`npx vectorvesper add ${slug}`)} to install it.
|
|
1336
1410
|
`);
|
|
1337
1411
|
return;
|
|
1338
1412
|
}
|
|
@@ -1355,7 +1429,7 @@ Component Diff: ${slug}`)));
|
|
|
1355
1429
|
`);
|
|
1356
1430
|
} else {
|
|
1357
1431
|
console.log(` \u2022 Status: ${pc10.bold(pc10.yellow("\u26A0\uFE0F Update available!"))}`);
|
|
1358
|
-
console.log(` \u2022 Run ${pc10.bold(pc10.cyan(`
|
|
1432
|
+
console.log(` \u2022 Run ${pc10.bold(pc10.cyan(`npx vectorvesper add ${slug} --overwrite`))} to update.
|
|
1359
1433
|
`);
|
|
1360
1434
|
}
|
|
1361
1435
|
} catch (error) {
|
|
@@ -1416,7 +1490,7 @@ Component Diff: ${slug}`)));
|
|
|
1416
1490
|
`
|
|
1417
1491
|
\u{1F4E2} ${pc10.bold(pc10.yellow(String(updatesAvailableCount)))} component(s) have updates available.`
|
|
1418
1492
|
);
|
|
1419
|
-
console.log(`\u{1F449} Run ${pc10.bold(pc10.cyan("
|
|
1493
|
+
console.log(`\u{1F449} Run ${pc10.bold(pc10.cyan("npx vectorvesper add <slug> --overwrite"))} to update a component.
|
|
1420
1494
|
`);
|
|
1421
1495
|
} else {
|
|
1422
1496
|
console.log(`
|
|
@@ -1437,7 +1511,7 @@ async function loginCommand(key) {
|
|
|
1437
1511
|
if (!key || key.trim().length === 0) {
|
|
1438
1512
|
logger.error("Please provide a license key.");
|
|
1439
1513
|
console.log(`
|
|
1440
|
-
Usage: ${pc11.cyan("
|
|
1514
|
+
Usage: ${pc11.cyan("npx vectorvesper login <your-license-key>")}`);
|
|
1441
1515
|
console.log(` \u{1F511} Get a key at ${pc11.cyan("https://vectorvesper.dev/pricing")}
|
|
1442
1516
|
`);
|
|
1443
1517
|
process.exit(1);
|
|
@@ -1466,8 +1540,8 @@ async function loginCommand(key) {
|
|
|
1466
1540
|
console.log(` ${pc11.green(pc11.bold("\u2714"))} License key saved successfully!`);
|
|
1467
1541
|
console.log(` ${pc11.dim("Stored at:")} ${pc11.cyan(getGlobalConfigPath())}`);
|
|
1468
1542
|
console.log("");
|
|
1469
|
-
console.log(` ${pc11.dim("Pro components are now available when you run")} ${pc11.cyan("
|
|
1470
|
-
console.log(` ${pc11.dim("To verify your account:")} ${pc11.cyan("
|
|
1543
|
+
console.log(` ${pc11.dim("Pro components are now available when you run")} ${pc11.cyan("npx vectorvesper add <slug>")}`);
|
|
1544
|
+
console.log(` ${pc11.dim("To verify your account:")} ${pc11.cyan("npx vectorvesper whoami")}`);
|
|
1471
1545
|
console.log("");
|
|
1472
1546
|
}
|
|
1473
1547
|
async function logoutCommand() {
|
|
@@ -1519,14 +1593,14 @@ async function whoamiCommand() {
|
|
|
1519
1593
|
console.log(` ${pc11.bold("Access:")} ${pc11.dim("Free components only")}`);
|
|
1520
1594
|
console.log("");
|
|
1521
1595
|
console.log(` ${pc11.dim("To unlock pro components:")}`);
|
|
1522
|
-
console.log(` ${pc11.cyan("
|
|
1596
|
+
console.log(` ${pc11.cyan("npx vectorvesper login <your-license-key>")}`);
|
|
1523
1597
|
console.log(` \u{1F511} ${pc11.dim("Get a key at")} ${pc11.cyan("https://vectorvesper.dev/pricing")}`);
|
|
1524
1598
|
}
|
|
1525
1599
|
console.log("");
|
|
1526
1600
|
}
|
|
1527
1601
|
|
|
1528
1602
|
// src/index.ts
|
|
1529
|
-
var version = true ? "0.
|
|
1603
|
+
var version = true ? "0.3.0" : "0.0.0-dev";
|
|
1530
1604
|
var program = new Command();
|
|
1531
1605
|
program.name("vv").description("Vector Vesper CLI \u2014 add visual components to your React project").version(version).option("--verbose", "Show detailed debug output").hook("preAction", (thisCommand) => {
|
|
1532
1606
|
const opts = thisCommand.opts();
|
|
@@ -1540,10 +1614,10 @@ program.command("init").description("Initialize Vector Vesper configuration in y
|
|
|
1540
1614
|
program.command("list").description("List all available components in the registry").action(async () => {
|
|
1541
1615
|
await listCommand();
|
|
1542
1616
|
});
|
|
1543
|
-
program.command("add <slug>").description("Add a component to your project").option("-o, --overwrite", "Overwrite existing files without prompting").option("-y, --yes", "Accept all default prompts").option("-d, --dry-run", "Simulate the installation without writing files").option("--no-install", "Skip auto-installing missing dependencies").action(async (slug, options) => {
|
|
1617
|
+
program.command("add <slug>").description("Add a component to your project").option("-o, --overwrite", "Overwrite existing files without prompting").option("-y, --yes", "Accept all default prompts").option("-d, --dry-run", "Simulate the installation without writing files").option("--no-install", "Skip auto-installing missing dependencies").option("--prune", "Remove files left over from a previous version of the component").action(async (slug, options) => {
|
|
1544
1618
|
await addCommand(slug, options);
|
|
1545
1619
|
});
|
|
1546
|
-
program.command("update [slug]").description("Update installed components to the latest registry version").option("-f, --force", "Re-write files even if the version already matches").action(async (slug, options) => {
|
|
1620
|
+
program.command("update [slug]").description("Update installed components to the latest registry version").option("-f, --force", "Re-write files even if the version already matches").option("-y, --yes", "Accept all prompts (auto-install missing dependencies)").option("--no-install", "Skip auto-installing missing dependencies").action(async (slug, options) => {
|
|
1547
1621
|
await updateCommand(slug, options);
|
|
1548
1622
|
});
|
|
1549
1623
|
program.command("remove <slug>").alias("rm").description("Remove an installed component and its files").option("-y, --yes", "Skip the confirmation prompt").action(async (slug, options) => {
|
|
@@ -1555,13 +1629,13 @@ program.command("info").description("Show project diagnostics and list installed
|
|
|
1555
1629
|
program.command("diff [slug]").description("Check for updates against the component registry").action(async (slug) => {
|
|
1556
1630
|
await diffCommand(slug);
|
|
1557
1631
|
});
|
|
1558
|
-
program.command("login <key>").description("Authenticate with a license key for pro components").action(async (key) => {
|
|
1632
|
+
program.command("login <key>", { hidden: true }).description("Authenticate with a license key for pro components").action(async (key) => {
|
|
1559
1633
|
await loginCommand(key);
|
|
1560
1634
|
});
|
|
1561
|
-
program.command("logout").description("Clear stored license credentials").action(async () => {
|
|
1635
|
+
program.command("logout", { hidden: true }).description("Clear stored license credentials").action(async () => {
|
|
1562
1636
|
await logoutCommand();
|
|
1563
1637
|
});
|
|
1564
|
-
program.command("whoami").description("Show current authentication status").action(async () => {
|
|
1638
|
+
program.command("whoami", { hidden: true }).description("Show current authentication status").action(async () => {
|
|
1565
1639
|
await whoamiCommand();
|
|
1566
1640
|
});
|
|
1567
1641
|
process.on("unhandledRejection", (error) => {
|