vectorvesper 0.2.0 → 0.2.1
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 +29 -29
- 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
|
}
|
|
@@ -908,7 +908,7 @@ async function addCommand(slug, options = {}) {
|
|
|
908
908
|
if (!config) {
|
|
909
909
|
console.error(
|
|
910
910
|
`${pc6.red(pc6.bold("Error:"))} No ${pc6.cyan("vv.config.json")} found in this directory.
|
|
911
|
-
\u{1F449} Run ${pc6.bold(pc6.cyan("
|
|
911
|
+
\u{1F449} Run ${pc6.bold(pc6.cyan("npx vectorvesper init"))} first to set up your project.`
|
|
912
912
|
);
|
|
913
913
|
process.exit(1);
|
|
914
914
|
return;
|
|
@@ -995,7 +995,7 @@ async function addCommand(slug, options = {}) {
|
|
|
995
995
|
} catch (error) {
|
|
996
996
|
const message = error instanceof Error ? error.message : String(error);
|
|
997
997
|
logger.warn(`Failed to update vv-manifest.json: ${message}`);
|
|
998
|
-
logger.warn("Component was installed but may not appear in '
|
|
998
|
+
logger.warn("Component was installed but may not appear in 'npx vectorvesper info' or 'npx vectorvesper diff'.");
|
|
999
999
|
}
|
|
1000
1000
|
spinner.succeed(pc6.green("Files written successfully!"));
|
|
1001
1001
|
console.log(pc6.dim("\nCreated files:"));
|
|
@@ -1033,7 +1033,7 @@ async function updateCommand(slug, options = {}) {
|
|
|
1033
1033
|
if (!config) {
|
|
1034
1034
|
console.error(
|
|
1035
1035
|
`${pc7.red(pc7.bold("Error:"))} No ${pc7.cyan("vv.config.json")} found.
|
|
1036
|
-
\u{1F449} Run ${pc7.bold(pc7.cyan("
|
|
1036
|
+
\u{1F449} Run ${pc7.bold(pc7.cyan("npx vectorvesper init"))} first.`
|
|
1037
1037
|
);
|
|
1038
1038
|
process.exit(1);
|
|
1039
1039
|
return;
|
|
@@ -1045,7 +1045,7 @@ async function updateCommand(slug, options = {}) {
|
|
|
1045
1045
|
if (installedSlugs.length === 0) {
|
|
1046
1046
|
console.log(pc7.yellow(`
|
|
1047
1047
|
\u26A0\uFE0F No components are installed in this project.`));
|
|
1048
|
-
console.log(`\u{1F449} Add one with ${pc7.bold(pc7.cyan("
|
|
1048
|
+
console.log(`\u{1F449} Add one with ${pc7.bold(pc7.cyan("npx vectorvesper add <slug>"))}
|
|
1049
1049
|
`);
|
|
1050
1050
|
return;
|
|
1051
1051
|
}
|
|
@@ -1064,7 +1064,7 @@ async function updateCommand(slug, options = {}) {
|
|
|
1064
1064
|
if (!manifest.components[slug]) {
|
|
1065
1065
|
console.log(pc7.red(`
|
|
1066
1066
|
\u274C Component "${slug}" is not installed in this project.`));
|
|
1067
|
-
console.log(`\u{1F449} Run ${pc7.cyan(`
|
|
1067
|
+
console.log(`\u{1F449} Run ${pc7.cyan(`npx vectorvesper add ${slug}`)} to install it.
|
|
1068
1068
|
`);
|
|
1069
1069
|
return;
|
|
1070
1070
|
}
|
|
@@ -1143,7 +1143,7 @@ async function removeCommand(slug, options = {}) {
|
|
|
1143
1143
|
if (!config) {
|
|
1144
1144
|
console.error(
|
|
1145
1145
|
`${pc8.red(pc8.bold("Error:"))} No ${pc8.cyan("vv.config.json")} found.
|
|
1146
|
-
\u{1F449} Run ${pc8.bold(pc8.cyan("
|
|
1146
|
+
\u{1F449} Run ${pc8.bold(pc8.cyan("npx vectorvesper init"))} first.`
|
|
1147
1147
|
);
|
|
1148
1148
|
process.exit(1);
|
|
1149
1149
|
return;
|
|
@@ -1153,7 +1153,7 @@ async function removeCommand(slug, options = {}) {
|
|
|
1153
1153
|
if (!entry) {
|
|
1154
1154
|
console.log(pc8.yellow(`
|
|
1155
1155
|
\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("
|
|
1156
|
+
console.log(`\u{1F449} See installed components with ${pc8.bold(pc8.cyan("npx vectorvesper info"))}
|
|
1157
1157
|
`);
|
|
1158
1158
|
return;
|
|
1159
1159
|
}
|
|
@@ -1217,7 +1217,7 @@ Remove ${slug}
|
|
|
1217
1217
|
import fs9 from "fs";
|
|
1218
1218
|
import path9 from "path";
|
|
1219
1219
|
import pc9 from "picocolors";
|
|
1220
|
-
var CLI_VERSION = true ? "0.2.
|
|
1220
|
+
var CLI_VERSION = true ? "0.2.1" : "0.0.0-dev";
|
|
1221
1221
|
async function infoCommand() {
|
|
1222
1222
|
console.log(pc9.bold(pc9.cyan("\nVector Vesper Diagnostics\n")));
|
|
1223
1223
|
const projectInfo = detectProject();
|
|
@@ -1245,7 +1245,7 @@ async function infoCommand() {
|
|
|
1245
1245
|
console.log(` \u2022 Key: ${pc9.cyan(maskedKey)}`);
|
|
1246
1246
|
} else {
|
|
1247
1247
|
console.log(` \u2022 Status: ${pc9.yellow("Anonymous (free tier)")}`);
|
|
1248
|
-
console.log(` ${pc9.dim(" Run")} ${pc9.cyan("
|
|
1248
|
+
console.log(` ${pc9.dim(" Run")} ${pc9.cyan("npx vectorvesper login <key>")} ${pc9.dim("to unlock pro components")}`);
|
|
1249
1249
|
}
|
|
1250
1250
|
console.log("");
|
|
1251
1251
|
console.log(pc9.bold(pc9.white("Configuration (vv.config.json):")));
|
|
@@ -1298,7 +1298,7 @@ async function diffCommand(slug) {
|
|
|
1298
1298
|
if (!fs10.existsSync(manifestPath)) {
|
|
1299
1299
|
console.log(pc10.yellow(`
|
|
1300
1300
|
\u26A0\uFE0F No vv-manifest.json found in this directory.`));
|
|
1301
|
-
console.log(`\u{1F449} Add components first using ${pc10.bold(pc10.cyan("
|
|
1301
|
+
console.log(`\u{1F449} Add components first using ${pc10.bold(pc10.cyan("npx vectorvesper add <slug>"))}
|
|
1302
1302
|
`);
|
|
1303
1303
|
return;
|
|
1304
1304
|
}
|
|
@@ -1315,7 +1315,7 @@ async function diffCommand(slug) {
|
|
|
1315
1315
|
if (installedSlugs.length === 0) {
|
|
1316
1316
|
console.log(pc10.yellow(`
|
|
1317
1317
|
\u26A0\uFE0F No components are registered as installed in vv-manifest.json.`));
|
|
1318
|
-
console.log(`\u{1F449} Add components using ${pc10.bold(pc10.cyan("
|
|
1318
|
+
console.log(`\u{1F449} Add components using ${pc10.bold(pc10.cyan("npx vectorvesper add <slug>"))}
|
|
1319
1319
|
`);
|
|
1320
1320
|
return;
|
|
1321
1321
|
}
|
|
@@ -1332,7 +1332,7 @@ async function diffCommand(slug) {
|
|
|
1332
1332
|
if (!installedComponents[slug]) {
|
|
1333
1333
|
console.log(pc10.red(`
|
|
1334
1334
|
\u274C Component "${slug}" is not installed in this project.`));
|
|
1335
|
-
console.log(`\u{1F449} Run ${pc10.cyan(`
|
|
1335
|
+
console.log(`\u{1F449} Run ${pc10.cyan(`npx vectorvesper add ${slug}`)} to install it.
|
|
1336
1336
|
`);
|
|
1337
1337
|
return;
|
|
1338
1338
|
}
|
|
@@ -1355,7 +1355,7 @@ Component Diff: ${slug}`)));
|
|
|
1355
1355
|
`);
|
|
1356
1356
|
} else {
|
|
1357
1357
|
console.log(` \u2022 Status: ${pc10.bold(pc10.yellow("\u26A0\uFE0F Update available!"))}`);
|
|
1358
|
-
console.log(` \u2022 Run ${pc10.bold(pc10.cyan(`
|
|
1358
|
+
console.log(` \u2022 Run ${pc10.bold(pc10.cyan(`npx vectorvesper add ${slug} --overwrite`))} to update.
|
|
1359
1359
|
`);
|
|
1360
1360
|
}
|
|
1361
1361
|
} catch (error) {
|
|
@@ -1416,7 +1416,7 @@ Component Diff: ${slug}`)));
|
|
|
1416
1416
|
`
|
|
1417
1417
|
\u{1F4E2} ${pc10.bold(pc10.yellow(String(updatesAvailableCount)))} component(s) have updates available.`
|
|
1418
1418
|
);
|
|
1419
|
-
console.log(`\u{1F449} Run ${pc10.bold(pc10.cyan("
|
|
1419
|
+
console.log(`\u{1F449} Run ${pc10.bold(pc10.cyan("npx vectorvesper add <slug> --overwrite"))} to update a component.
|
|
1420
1420
|
`);
|
|
1421
1421
|
} else {
|
|
1422
1422
|
console.log(`
|
|
@@ -1437,7 +1437,7 @@ async function loginCommand(key) {
|
|
|
1437
1437
|
if (!key || key.trim().length === 0) {
|
|
1438
1438
|
logger.error("Please provide a license key.");
|
|
1439
1439
|
console.log(`
|
|
1440
|
-
Usage: ${pc11.cyan("
|
|
1440
|
+
Usage: ${pc11.cyan("npx vectorvesper login <your-license-key>")}`);
|
|
1441
1441
|
console.log(` \u{1F511} Get a key at ${pc11.cyan("https://vectorvesper.dev/pricing")}
|
|
1442
1442
|
`);
|
|
1443
1443
|
process.exit(1);
|
|
@@ -1466,8 +1466,8 @@ async function loginCommand(key) {
|
|
|
1466
1466
|
console.log(` ${pc11.green(pc11.bold("\u2714"))} License key saved successfully!`);
|
|
1467
1467
|
console.log(` ${pc11.dim("Stored at:")} ${pc11.cyan(getGlobalConfigPath())}`);
|
|
1468
1468
|
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("
|
|
1469
|
+
console.log(` ${pc11.dim("Pro components are now available when you run")} ${pc11.cyan("npx vectorvesper add <slug>")}`);
|
|
1470
|
+
console.log(` ${pc11.dim("To verify your account:")} ${pc11.cyan("npx vectorvesper whoami")}`);
|
|
1471
1471
|
console.log("");
|
|
1472
1472
|
}
|
|
1473
1473
|
async function logoutCommand() {
|
|
@@ -1519,14 +1519,14 @@ async function whoamiCommand() {
|
|
|
1519
1519
|
console.log(` ${pc11.bold("Access:")} ${pc11.dim("Free components only")}`);
|
|
1520
1520
|
console.log("");
|
|
1521
1521
|
console.log(` ${pc11.dim("To unlock pro components:")}`);
|
|
1522
|
-
console.log(` ${pc11.cyan("
|
|
1522
|
+
console.log(` ${pc11.cyan("npx vectorvesper login <your-license-key>")}`);
|
|
1523
1523
|
console.log(` \u{1F511} ${pc11.dim("Get a key at")} ${pc11.cyan("https://vectorvesper.dev/pricing")}`);
|
|
1524
1524
|
}
|
|
1525
1525
|
console.log("");
|
|
1526
1526
|
}
|
|
1527
1527
|
|
|
1528
1528
|
// src/index.ts
|
|
1529
|
-
var version = true ? "0.2.
|
|
1529
|
+
var version = true ? "0.2.1" : "0.0.0-dev";
|
|
1530
1530
|
var program = new Command();
|
|
1531
1531
|
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
1532
|
const opts = thisCommand.opts();
|