@vocoder/cli 0.13.1 → 0.13.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/dist/bin.mjs CHANGED
@@ -2150,14 +2150,9 @@ function validateLocalConfig(config) {
2150
2150
  if (!config.apiKey || config.apiKey.length === 0) {
2151
2151
  throw new Error("VOCODER_API_KEY is required. Set it in your .env file.");
2152
2152
  }
2153
- if (!config.apiKey.startsWith("vcp_")) {
2154
- if (config.apiKey.startsWith("vco_") || config.apiKey.startsWith("vcu_")) {
2155
- throw new Error(
2156
- "VOCODER_API_KEY must be a project-scoped key (starts with vcp_). Got an org or user key."
2157
- );
2158
- }
2153
+ if (!config.apiKey.startsWith("vca_")) {
2159
2154
  throw new Error(
2160
- "Invalid API key format. Expected a project API key starting with vcp_."
2155
+ "Invalid API key format. Expected an app API key starting with vca_."
2161
2156
  );
2162
2157
  }
2163
2158
  if (!config.apiUrl || !config.apiUrl.startsWith("http")) {
@@ -2558,14 +2553,14 @@ async function fetchApiSnapshot(api, params) {
2558
2553
  async function sync(options = {}) {
2559
2554
  const startTime = Date.now();
2560
2555
  const projectRoot = process.cwd();
2561
- p7.intro("Vocoder Sync");
2556
+ p7.intro(chalk6.bold("Vocoder Sync"));
2562
2557
  const mergedConfig = await getMergedConfig(options, options.verbose);
2563
2558
  if (!mergedConfig.apiKey) {
2564
2559
  p7.log.warn("No API key found. Run init to get started:");
2565
2560
  p7.log.info(" npx @vocoder/cli init");
2566
2561
  p7.log.info("");
2567
2562
  p7.log.info(
2568
- " Or add your key to .env: VOCODER_API_KEY=vcp_..."
2563
+ " Or add your key to .env: VOCODER_API_KEY=vca_..."
2569
2564
  );
2570
2565
  p7.outro("Run `npx @vocoder/cli init` to set up your project.");
2571
2566
  return 1;
@@ -2602,7 +2597,7 @@ async function sync(options = {}) {
2602
2597
  p7.log.warn(
2603
2598
  `Skipping translations (${highlight(branch)} is not a target branch)`
2604
2599
  );
2605
- p7.log.info(`Target branches: ${config.targetBranches.join(", ")}`);
2600
+ p7.log.info(`Target branches: ${config.targetBranches.map((b) => highlight(b)).join(", ")}`);
2606
2601
  p7.log.info("Use --force to translate anyway");
2607
2602
  p7.outro("");
2608
2603
  return 0;
@@ -2638,7 +2633,7 @@ async function sync(options = {}) {
2638
2633
  [
2639
2634
  `Strings: ${extractedStrings.length}`,
2640
2635
  `Branch: ${branch}`,
2641
- `Target locales: ${config.targetLocales.join(", ")}`,
2636
+ `Target locales: ${config.targetLocales.map((l) => highlight(l)).join(", ")}`,
2642
2637
  `Requested mode: ${requestedMode}`,
2643
2638
  `Max wait: ${waitTimeoutMs}ms`,
2644
2639
  `No fallback: ${mergedConfig.noFallback ? "yes" : "no"}`
@@ -2718,7 +2713,7 @@ async function sync(options = {}) {
2718
2713
  statParts.push(`${chalk6.yellow(batchResponse.deletedStrings)} archived`);
2719
2714
  }
2720
2715
  const estTime = batchResponse.estimatedTime ? ` (~${batchResponse.estimatedTime}s)` : "";
2721
- p7.log.info(`${statParts.join(", ")} \u2192 syncing to ${config.targetLocales.join(", ")}${estTime}`);
2716
+ p7.log.info(`${statParts.join(", ")} \u2192 syncing to ${config.targetLocales.map((l) => highlight(l)).join(", ")}${estTime}`);
2722
2717
  }
2723
2718
  let artifacts = null;
2724
2719
  if (batchResponse.translations) {
@@ -2821,7 +2816,7 @@ async function sync(options = {}) {
2821
2816
  });
2822
2817
  const cachePath = writeCache({ projectRoot, fingerprint, data });
2823
2818
  if (options.verbose) {
2824
- p7.log.info(`Cache written: ${cachePath}`);
2819
+ p7.log.info(`Cache written: ${highlight(cachePath)}`);
2825
2820
  }
2826
2821
  } catch (error) {
2827
2822
  if (options.verbose) {