Skip to content

Commit 58bc89f

Browse files
committed
refactor: update VibeConfig to VSyncConfig across the codebase
1 parent 0909155 commit 58bc89f

22 files changed

Lines changed: 141 additions & 141 deletions

.claude/commands/do-task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ src/
210210
│ ├── opencode.ts # Target adapter
211211
│ └── registry.ts # Adapter factory
212212
├── types/ # TypeScript types (Phase 1)
213-
│ ├── config.ts # VibeConfig, SyncMode, etc.
213+
│ ├── config.ts # VSyncConfig, SyncMode, etc.
214214
│ ├── models.ts # Skill, MCPServer, etc.
215215
│ ├── manifest.ts # Manifest types
216216
│ └── plan.ts # SyncPlan, DiffResult, etc.

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"[mdx]": {
100100
"editor.defaultFormatter": "esbenp.prettier-vscode"
101101
},
102-
"cSpell.words": ["MCPO", "opencode"],
102+
"cSpell.words": ["MCPO", "opencode", "vsync"],
103103

104104
// i18n-ally Configuration for CLI workspace
105105
"i18n-ally.localesPaths": ["cli/src/locales"],

TASKS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ This document tracks all implementation tasks for vsync MVP. Each phase must be
6565
### 1.2 Core Type Definitions
6666

6767
- [x] Define `cli/src/types/config.ts`
68-
- [x] `VibeConfig` interface (`.vsync.json` structure)
68+
- [x] `VSyncConfig` interface (`.vsync.json` structure)
6969
- [x] `SyncMode` type (`"safe" | "prune"`)
7070
- [x] `ToolName` type (`"claude-code" | "cursor" | "opencode"`)
7171
- [x] `ConfigLevel` type (`"project" | "user"`)
@@ -660,7 +660,7 @@ This document tracks all implementation tasks for vsync MVP. Each phase must be
660660
### 9.1 Configuration Extension ✅
661661

662662
- [x] Extend `cli/src/types/config.ts`
663-
- [x] Add `use_symlinks_for_skills?: boolean` to `VibeConfig`
663+
- [x] Add `use_symlinks_for_skills?: boolean` to `VSyncConfig`
664664
- [x] ~~Add `symlink_source?: ToolName`~~ (Not needed - use `source_tool` instead)
665665
- [x] Update schema validation in `cli/src/core/config-manager.ts`
666666
- [x] Update `mergeConfigs()` to handle symlink configuration
@@ -810,7 +810,7 @@ This document tracks all implementation tasks for vsync MVP. Each phase must be
810810
### 10.2 Configuration Extension ✅
811811

812812
- [x] Extend user-level config
813-
- [x] Add `language?: 'en' | 'zh'` to user-level `VibeConfig`
813+
- [x] Add `language?: 'en' | 'zh'` to user-level `VSyncConfig`
814814
- [x] Update `cli/src/core/config-manager.ts`
815815
- [x] Validate language field in `validateConfig()`
816816
- [x] Merge language preference in `mergeConfigs()` (from user config only)

cli/src/commands/init.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import inquirer from "inquirer";
1212
import ora from "ora";
1313
import { getAllConfigDirs, getToolChoices } from "@src/adapters/registry.js";
1414
import { saveConfig as saveConfigToFile } from "@src/core/config-manager.js";
15-
import type { ToolName, VibeConfig, ConfigLevel } from "@src/types/config.js";
15+
import type { ToolName, VSyncConfig, ConfigLevel } from "@src/types/config.js";
1616
import { t } from "@src/utils/i18n.js";
1717

1818
/**
@@ -57,7 +57,7 @@ export async function detectTools(projectDir: string): Promise<ToolName[]> {
5757
*/
5858
export async function generateConfig(
5959
options: ConfigOptions,
60-
): Promise<VibeConfig> {
60+
): Promise<VSyncConfig> {
6161
// Validate inputs
6262
if (options.tools.length === 0) {
6363
throw new Error("At least one tool must be selected");
@@ -74,7 +74,7 @@ export async function generateConfig(
7474
// Build config
7575
const level: ConfigLevel = options.isUserLevel ? "user" : "project";
7676

77-
const config: VibeConfig = {
77+
const config: VSyncConfig = {
7878
version: "1.0.0",
7979
level,
8080
source_tool: options.source,
@@ -98,7 +98,7 @@ export async function generateConfig(
9898
* @param dir - Directory to save config in (project dir or user home dir based on config.level)
9999
*/
100100
export async function saveConfig(
101-
config: VibeConfig,
101+
config: VSyncConfig,
102102
dir: string,
103103
): Promise<void> {
104104
// Pass dir as both projectDir and userDir since this function doesn't

cli/src/commands/status.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import chalk from "chalk";
1010
import { Command } from "commander";
1111
import ora from "ora";
1212
import { loadManifest, getManifestPath } from "@src/core/manifest-manager.js";
13-
import type { VibeConfig } from "@src/types/config.js";
13+
import type { VSyncConfig } from "@src/types/config.js";
1414
import type { Manifest } from "@src/types/manifest.js";
1515
import { ensureConfig } from "@src/utils/config-initializer.js";
1616
import { t } from "@src/utils/i18n.js";
@@ -30,7 +30,7 @@ const TIME_THRESHOLDS = {
3030
* Status display data
3131
*/
3232
export interface StatusData {
33-
config: VibeConfig;
33+
config: VSyncConfig;
3434
manifest: Manifest;
3535
skillCount: number;
3636
mcpCount: number;

cli/src/commands/sync.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import type {
3636
ConfigLevel,
3737
SyncMode,
3838
ToolName,
39-
VibeConfig,
39+
VSyncConfig,
4040
} from "@src/types/config.js";
4141
import type { Manifest, ItemType } from "@src/types/manifest.js";
4242
import type {
@@ -154,7 +154,7 @@ export function detectFirstTimeSkillsSync(manifest: Manifest): boolean {
154154
* @returns True if should prompt for symlink preference
155155
*/
156156
export function shouldPromptForSymlinks(
157-
config: VibeConfig,
157+
config: VSyncConfig,
158158
manifest: Manifest,
159159
targetTools: ToolName[],
160160
): boolean {
@@ -325,7 +325,7 @@ export async function calculateSyncDiff(
325325
targetTools: ToolName[],
326326
manifest: Manifest,
327327
mode: SyncMode,
328-
syncConfig: VibeConfig["sync_config"],
328+
syncConfig: VSyncConfig["sync_config"],
329329
projectDir: string,
330330
level: ConfigLevel,
331331
): Promise<SyncPlan> {
@@ -529,7 +529,7 @@ export async function updateManifestAfterSync(
529529
* @param projectDir - Project directory
530530
*/
531531
export async function syncWithSymlinks(
532-
config: VibeConfig,
532+
config: VSyncConfig,
533533
plan: SyncPlan,
534534
projectDir: string,
535535
): Promise<void> {
@@ -598,7 +598,7 @@ export async function syncWithSymlinks(
598598
* Updates config with user's choice and saves
599599
*/
600600
async function promptForSymlinkUsage(
601-
config: VibeConfig,
601+
config: VSyncConfig,
602602
projectDir: string,
603603
): Promise<void> {
604604
const useSymlinks = await SyncUI.promptForSymlinkUsage(config);
@@ -617,7 +617,7 @@ async function promptForSymlinkUsage(
617617
interface SyncContext {
618618
projectDir: string;
619619
mode: SyncMode;
620-
config: VibeConfig;
620+
config: VSyncConfig;
621621
sourceData: SourceData;
622622
manifest: Manifest;
623623
}

cli/src/core/config-manager.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import { join } from "node:path";
1313
import { cwd } from "node:process";
1414
import { ZodError, type ZodIssue } from "zod";
1515
import { getAvailableTools } from "@src/adapters/registry.js";
16-
import type { VibeConfig, ConfigLevel } from "@src/types/config.js";
17-
import { createVibeConfigSchema } from "@src/types/config.js";
16+
import type { VSyncConfig, ConfigLevel } from "@src/types/config.js";
17+
import { createVSyncConfigSchema } from "@src/types/config.js";
1818
import { atomicWrite } from "@src/utils/atomic-write.js";
1919

2020
/**
@@ -60,12 +60,12 @@ export async function loadConfig(
6060
level: ConfigLevel,
6161
projectDir?: string,
6262
userDir?: string,
63-
): Promise<VibeConfig> {
63+
): Promise<VSyncConfig> {
6464
const configPath = getConfigPath(level, projectDir, userDir);
6565

6666
try {
6767
const content = await readFile(configPath, "utf-8");
68-
const config = JSON.parse(content) as VibeConfig;
68+
const config = JSON.parse(content) as VSyncConfig;
6969

7070
// Validate loaded config
7171
const validation = validateConfig(config);
@@ -97,7 +97,7 @@ export async function loadConfig(
9797
* @param userDir - User home directory (optional)
9898
*/
9999
export async function saveConfig(
100-
config: VibeConfig,
100+
config: VSyncConfig,
101101
level: ConfigLevel,
102102
projectDir?: string,
103103
userDir?: string,
@@ -128,9 +128,9 @@ export async function saveConfig(
128128
* @throws Error if both configs are undefined
129129
*/
130130
export function mergeConfigs(
131-
userConfig?: VibeConfig,
132-
projectConfig?: VibeConfig,
133-
): VibeConfig {
131+
userConfig?: VSyncConfig,
132+
projectConfig?: VSyncConfig,
133+
): VSyncConfig {
134134
if (!userConfig && !projectConfig) {
135135
throw new Error("At least one config must be provided");
136136
}
@@ -140,7 +140,7 @@ export function mergeConfigs(
140140
if (!projectConfig) return userConfig;
141141

142142
// Merge with project taking precedence
143-
const merged: VibeConfig = {
143+
const merged: VSyncConfig = {
144144
version: projectConfig.version || userConfig.version,
145145
level: projectConfig.level, // Always use project level when merging
146146
};
@@ -209,9 +209,9 @@ export function mergeConfigs(
209209
export async function loadMergedConfig(
210210
projectDir: string,
211211
userDir?: string,
212-
): Promise<VibeConfig> {
213-
let userConfig: VibeConfig | undefined;
214-
let projectConfig: VibeConfig | undefined;
212+
): Promise<VSyncConfig> {
213+
let userConfig: VSyncConfig | undefined;
214+
let projectConfig: VSyncConfig | undefined;
215215

216216
// Try to load user config
217217
try {
@@ -296,13 +296,13 @@ function extractZodErrors(issues: ZodIssue[]): string[] {
296296
* @param config - Configuration to validate
297297
* @returns Validation result with errors if any
298298
*/
299-
export function validateConfig(config: VibeConfig): ValidationResult {
299+
export function validateConfig(config: VSyncConfig): ValidationResult {
300300
try {
301301
// Get valid tools from registry (dynamic validation)
302302
const validTools = getAvailableTools();
303303

304304
// Create schema with current valid tools
305-
const schema = createVibeConfigSchema(validTools);
305+
const schema = createVSyncConfigSchema(validTools);
306306

307307
// Validate config
308308
schema.parse(config);

cli/src/core/symlink-sync.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
access,
2020
} from "node:fs/promises";
2121
import { join, dirname, basename } from "node:path";
22-
import type { VibeConfig } from "@src/types/config.js";
22+
import type { VSyncConfig } from "@src/types/config.js";
2323
import {
2424
isSymlink,
2525
createSymlink,
@@ -55,7 +55,7 @@ export interface DirectoryBackupInfo {
5555
* @param config - vsync configuration
5656
* @returns True if symlinks should be used
5757
*/
58-
export function shouldUseSymlinks(config: VibeConfig): boolean {
58+
export function shouldUseSymlinks(config: VSyncConfig): boolean {
5959
return config.use_symlinks_for_skills === true;
6060
}
6161

cli/src/types/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface SyncConfig {
4747
* Main vsync configuration
4848
* Stored in .vsync.json (project) or ~/.vsync.json (user)
4949
*/
50-
export interface VibeConfig {
50+
export interface VSyncConfig {
5151
/** JSON schema URL (optional) */
5252
$schema?: string;
5353
/** Config version */
@@ -178,7 +178,7 @@ export function createUserConfigSchema(validTools: string[]) {
178178
* Create complete config schema
179179
* Uses union to support both project-level and user-level configs
180180
*/
181-
export function createVibeConfigSchema(validTools: string[]) {
181+
export function createVSyncConfigSchema(validTools: string[]) {
182182
return z.union([
183183
createProjectConfigSchema(validTools),
184184
createUserConfigSchema(validTools),

cli/src/utils/config-initializer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
saveConfig,
1717
type RequiredConfigField,
1818
} from "@src/core/config-manager.js";
19-
import type { VibeConfig } from "@src/types/config.js";
19+
import type { VSyncConfig } from "@src/types/config.js";
2020
import {
2121
detectSystemLanguage,
2222
setLanguage,
@@ -64,7 +64,7 @@ export async function ensureLanguageConfig(): Promise<Language> {
6464
existingConfig.language = language;
6565
await saveConfig(existingConfig, "user", homedir());
6666
} catch {
67-
const minimalConfig: VibeConfig = {
67+
const minimalConfig: VSyncConfig = {
6868
version: "1.0.0",
6969
level: "user",
7070
language,
@@ -89,7 +89,7 @@ export async function ensureConfig(
8989
projectDir: string,
9090
isUserLevel: boolean,
9191
options?: EnsureConfigOptions,
92-
): Promise<VibeConfig> {
92+
): Promise<VSyncConfig> {
9393
await ensureLanguageConfig();
9494

9595
const level = isUserLevel ? "user" : "project";
@@ -166,7 +166,7 @@ export async function ensureConfig(
166166
async function runInitFlow(
167167
projectDir: string,
168168
isUserLevel: boolean,
169-
): Promise<VibeConfig> {
169+
): Promise<VSyncConfig> {
170170
console.log(chalk.bold("\n🚀 Let's set up vsync!\n"));
171171

172172
const {

0 commit comments

Comments
 (0)