@vocoder/cli 0.13.0 → 0.13.2
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 +14 -19
- package/dist/bin.mjs.map +1 -1
- package/package.json +3 -3
package/dist/bin.mjs
CHANGED
|
@@ -1552,7 +1552,7 @@ async function runAuthFlow(api, options, reauth = false, repoCanonical) {
|
|
|
1552
1552
|
}
|
|
1553
1553
|
async function init(options = {}) {
|
|
1554
1554
|
const apiUrl = options.apiUrl || process.env.VOCODER_API_URL || "https://vocoder.app";
|
|
1555
|
-
p5.intro(
|
|
1555
|
+
p5.intro(chalk5.bold("Vocoder Setup"));
|
|
1556
1556
|
try {
|
|
1557
1557
|
const gitContext = resolveGitContext();
|
|
1558
1558
|
const identity = gitContext.identity;
|
|
@@ -1608,7 +1608,7 @@ async function init(options = {}) {
|
|
|
1608
1608
|
const isTs = detectLocalEcosystem().isTypeScript;
|
|
1609
1609
|
const written = writeVocoderConfig({ targetBranches: exactMatch.targetBranches ?? ["main"], useTypeScript: isTs });
|
|
1610
1610
|
if (written) p5.log.success(`Created ${highlight(written)}`);
|
|
1611
|
-
p5.outro(
|
|
1611
|
+
p5.outro("Vocoder is already set up for this repository.");
|
|
1612
1612
|
return 0;
|
|
1613
1613
|
}
|
|
1614
1614
|
if (lookup.hasWholeRepoApp) {
|
|
@@ -1618,7 +1618,7 @@ async function init(options = {}) {
|
|
|
1618
1618
|
const isTs = detectLocalEcosystem().isTypeScript;
|
|
1619
1619
|
const written = writeVocoderConfig({ targetBranches: ["main"], useTypeScript: isTs });
|
|
1620
1620
|
if (written) p5.log.success(`Created ${highlight(written)}`);
|
|
1621
|
-
p5.outro(
|
|
1621
|
+
p5.outro("Vocoder is already set up for this repository.");
|
|
1622
1622
|
return 0;
|
|
1623
1623
|
}
|
|
1624
1624
|
}
|
|
@@ -1945,7 +1945,7 @@ async function init(options = {}) {
|
|
|
1945
1945
|
targetBranches: appResult.targetBranches,
|
|
1946
1946
|
appDir: identity?.repoAppDir
|
|
1947
1947
|
});
|
|
1948
|
-
p5.outro(
|
|
1948
|
+
p5.outro("You're all set.");
|
|
1949
1949
|
return 0;
|
|
1950
1950
|
}
|
|
1951
1951
|
try {
|
|
@@ -2011,7 +2011,7 @@ async function init(options = {}) {
|
|
|
2011
2011
|
p5.log.error(`Failed to create app binding: ${msg}`);
|
|
2012
2012
|
return 1;
|
|
2013
2013
|
}
|
|
2014
|
-
p5.outro(
|
|
2014
|
+
p5.outro("You're all set.");
|
|
2015
2015
|
return 0;
|
|
2016
2016
|
}
|
|
2017
2017
|
} catch {
|
|
@@ -2048,7 +2048,7 @@ Translations won't run automatically until you grant access.
|
|
|
2048
2048
|
appDir: identity?.repoAppDir
|
|
2049
2049
|
});
|
|
2050
2050
|
printApiKey(projectResult.apiKey);
|
|
2051
|
-
p5.outro(
|
|
2051
|
+
p5.outro("You're all set.");
|
|
2052
2052
|
return 0;
|
|
2053
2053
|
} catch (error) {
|
|
2054
2054
|
if (error instanceof Error) {
|
|
@@ -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("
|
|
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
|
|
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,16 +2553,16 @@ 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(
|
|
2556
|
+
p7.intro("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=
|
|
2563
|
+
" Or add your key to .env: VOCODER_API_KEY=vca_..."
|
|
2569
2564
|
);
|
|
2570
|
-
p7.outro(
|
|
2565
|
+
p7.outro("Run `npx @vocoder/cli init` to set up your project.");
|
|
2571
2566
|
return 1;
|
|
2572
2567
|
}
|
|
2573
2568
|
const spinner7 = p7.spinner();
|
|
@@ -2645,7 +2640,7 @@ async function sync(options = {}) {
|
|
|
2645
2640
|
].join("\n"),
|
|
2646
2641
|
"Dry run - would translate"
|
|
2647
2642
|
);
|
|
2648
|
-
p7.outro(
|
|
2643
|
+
p7.outro("No API calls made.");
|
|
2649
2644
|
return 0;
|
|
2650
2645
|
}
|
|
2651
2646
|
const repoIdentity = resolveGitRepositoryIdentity();
|
|
@@ -2670,7 +2665,7 @@ async function sync(options = {}) {
|
|
|
2670
2665
|
p7.log.info(`Cache hit: ${chalk6.dim(cacheFile)} (fingerprint ${highlight(fingerprint)})`);
|
|
2671
2666
|
}
|
|
2672
2667
|
const duration2 = ((Date.now() - startTime) / 1e3).toFixed(1);
|
|
2673
|
-
p7.outro(
|
|
2668
|
+
p7.outro(`Up to date (${duration2}s)`);
|
|
2674
2669
|
return 0;
|
|
2675
2670
|
}
|
|
2676
2671
|
if (options.verbose) {
|
|
@@ -2836,7 +2831,7 @@ async function sync(options = {}) {
|
|
|
2836
2831
|
);
|
|
2837
2832
|
}
|
|
2838
2833
|
const duration = ((Date.now() - startTime) / 1e3).toFixed(1);
|
|
2839
|
-
p7.outro(
|
|
2834
|
+
p7.outro(`Sync complete! (${duration}s)`);
|
|
2840
2835
|
return 0;
|
|
2841
2836
|
} catch (error) {
|
|
2842
2837
|
spinner7.stop();
|