@vocoder/cli 0.1.23 → 0.1.25
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 +12 -13
- package/dist/bin.mjs.map +1 -1
- package/package.json +1 -1
package/dist/bin.mjs
CHANGED
|
@@ -3294,15 +3294,25 @@ async function sync(options = {}) {
|
|
|
3294
3294
|
const startTime = Date.now();
|
|
3295
3295
|
const projectRoot = process.cwd();
|
|
3296
3296
|
p8.intro("Vocoder Sync");
|
|
3297
|
+
const mergedConfig = await getMergedConfig(options, options.verbose);
|
|
3298
|
+
if (!mergedConfig.apiKey) {
|
|
3299
|
+
p8.log.warn("No API key found. Run init to get started:");
|
|
3300
|
+
p8.log.info(" npx @vocoder/cli init");
|
|
3301
|
+
p8.log.info("");
|
|
3302
|
+
p8.log.info(
|
|
3303
|
+
" Or add your key to .env: VOCODER_API_KEY=vcp_..."
|
|
3304
|
+
);
|
|
3305
|
+
p8.outro("Run `npx @vocoder/cli init` to set up your project.");
|
|
3306
|
+
return 1;
|
|
3307
|
+
}
|
|
3297
3308
|
const spinner4 = p8.spinner();
|
|
3298
3309
|
try {
|
|
3299
3310
|
spinner4.start("Detecting branch");
|
|
3300
3311
|
const branch = detectBranch(options.branch);
|
|
3301
3312
|
spinner4.stop(`Branch: ${chalk8.cyan(branch)}`);
|
|
3302
3313
|
spinner4.start("Loading project configuration");
|
|
3303
|
-
const mergedConfig = await getMergedConfig(options, options.verbose);
|
|
3304
3314
|
const localConfig = {
|
|
3305
|
-
apiKey: mergedConfig.apiKey
|
|
3315
|
+
apiKey: mergedConfig.apiKey,
|
|
3306
3316
|
apiUrl: mergedConfig.apiUrl || "https://vocoder.app"
|
|
3307
3317
|
};
|
|
3308
3318
|
validateLocalConfig(localConfig);
|
|
@@ -3608,17 +3618,6 @@ async function sync(options = {}) {
|
|
|
3608
3618
|
p8.log.info(
|
|
3609
3619
|
" Run `npx @vocoder/cli init` to create a new project and key."
|
|
3610
3620
|
);
|
|
3611
|
-
} else if (error.message.includes("VOCODER_API_KEY")) {
|
|
3612
|
-
p8.log.warn(
|
|
3613
|
-
"VOCODER_API_KEY is only needed for `vocoder sync` (CLI push)."
|
|
3614
|
-
);
|
|
3615
|
-
p8.log.info(" Create one at: https://vocoder.app/dashboard");
|
|
3616
|
-
p8.log.info(' Then: export VOCODER_API_KEY="vc_..." or add it to .env');
|
|
3617
|
-
p8.log.info("");
|
|
3618
|
-
p8.log.info(
|
|
3619
|
-
" Note: If you use @vocoder/unplugin, `vocoder sync` is optional."
|
|
3620
|
-
);
|
|
3621
|
-
p8.log.info(" Translations are fetched automatically at build time.");
|
|
3622
3621
|
} else if (error.message.includes("git branch")) {
|
|
3623
3622
|
p8.log.warn("Run from a git repository, or use:");
|
|
3624
3623
|
p8.log.info(" vocoder sync --branch main");
|