Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions src/modules/context/interfaces/taptik-context.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ export interface ContextContent {
prompts?: PromptsContext;
/** MCP servers and custom tool configurations */
tools?: ToolsContext;
/** IDE-specific settings for each platform */
ide?: IdeContext;
/** Allow additional fields for flexibility */
[key: string]: unknown;
}
Expand Down Expand Up @@ -198,39 +196,6 @@ export interface ToolsContext {
}>;
}

export interface IdeContext {
/** Claude Code specific settings */
claudeCode?: {
settings?: Record<string, unknown>;
keybindings?: Record<string, unknown>;
extensions?: string[];
mcp_config?: Record<string, unknown>;
claude_md?: string;
};
'claude-code'?: {
settings?: Record<string, unknown>;
keybindings?: Record<string, unknown>;
extensions?: string[];
mcp_config?: Record<string, unknown>;
claude_md?: string;
};
/** Kiro IDE specific settings */
'kiro-ide'?: {
settings?: Record<string, unknown>;
specs?: Record<string, unknown>;
steering?: Record<string, unknown>;
hooks?: Record<string, unknown>;
};
/** Cursor IDE specific settings */
'cursor-ide'?: {
settings?: Record<string, unknown>;
keybindings?: Record<string, unknown>;
extensions?: string[];
};
/** Generic IDE settings for other platforms */
[ideId: string]: Record<string, unknown> | undefined;
}

export interface SecurityInfo {
/** Whether API keys or secrets were detected */
hasApiKeys: boolean;
Expand Down
7 changes: 4 additions & 3 deletions src/modules/deploy/commands/deploy.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {
ConflictStrategy,
} from '../interfaces/deploy-options.interface';
import { DeploymentResult } from '../interfaces/deployment-result.interface';
import { DeploymentReporterService } from '../services/deployment-reporter.service';
import { DeploymentService } from '../services/deployment.service';
import { ImportService } from '../services/import.service';
import { HelpDocumentationService } from '../services/help-documentation.service';
import { ErrorMessageHelperService } from '../services/error-message-helper.service';
import { DeploymentReporterService } from '../services/deployment-reporter.service';
import { HelpDocumentationService } from '../services/help-documentation.service';
import { ImportService } from '../services/import.service';

interface DeployCommandOptions {
platform?: SupportedPlatform;
Expand Down Expand Up @@ -188,6 +188,7 @@ export class DeployCommand extends CommandRunner {
components: options.components?.map((c) => c as ComponentType),
skipComponents: options.skipComponents?.map((c) => c as ComponentType),
// Task 7.2: Add Cursor-specific options to deployOptions
// FIXME: cursor specific options 점검
cursorPath: options.cursorPath,
workspacePath: options.workspacePath,
skipAiConfig: options.skipAiConfig,
Expand Down
8 changes: 4 additions & 4 deletions src/modules/deploy/interfaces/cursor-deployment.interface.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ComponentTypes } from './component-types.interface';
import { DeploymentOptions } from './deploy-options.interface';
import { DeploymentResult } from './deployment-result.interface';
import { CursorComponentType } from '../constants/cursor.constants';

import { DeploymentOptions, SupportedPlatform } from './deploy-options.interface';
import { DeploymentResult } from './deployment-result.interface';

export interface CursorDeploymentOptions extends DeploymentOptions {
platform: 'cursor';
platform: SupportedPlatform;
cursorPath?: string;
workspacePath?: string;
globalSettings?: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/modules/deploy/interfaces/kiro-deployment.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
/**
* Kiro-specific deployment options
*/
// FIXME: kiro 옵션 제거??
export interface KiroDeploymentOptions {
platform: Extract<SupportedPlatform, 'kiro-ide'>;
conflictStrategy: KiroConflictStrategy;
Expand Down
1 change: 1 addition & 0 deletions src/modules/deploy/services/backup.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface BackupInfo {

@Injectable()
export class BackupService {
// FIXME: 백업 경로 수정
protected readonly backupDir = path.join(os.homedir(), '.taptik', 'backups');

async createBackup(filePath: string): Promise<string> {
Expand Down
21 changes: 14 additions & 7 deletions src/modules/deploy/services/cursor-backup.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Injectable, Logger } from '@nestjs/common';
import * as fs from 'fs/promises';
import * as path from 'path';
import { CursorDeploymentOptions, CursorComponentType } from '../interfaces/cursor-deployment.interface';

import { Injectable, Logger } from '@nestjs/common';

import { CursorComponentType } from '../constants';
import { CursorDeploymentOptions } from '../interfaces/cursor-deployment.interface';
import { DeploymentError, DeploymentWarning } from '../interfaces/deployment-result.interface';

/**
Expand Down Expand Up @@ -51,6 +54,7 @@ export class CursorBackupService {
// Backup each component
for (const component of components) {
try {
// eslint-disable-next-line no-await-in-loop
const componentBackup = await this.backupComponent(component, options, backupPath);
backedUpFiles.push(...componentBackup.files);
warnings.push(...componentBackup.warnings);
Expand Down Expand Up @@ -267,6 +271,7 @@ export class CursorBackupService {
for (const filePath of filesToBackup) {
try {
// Check if file exists
// eslint-disable-next-line no-await-in-loop
const exists = await this.fileExists(filePath);
if (!exists) {
warnings.push({
Expand All @@ -279,10 +284,12 @@ export class CursorBackupService {
}

// Read and backup file
// eslint-disable-next-line no-await-in-loop
const content = await fs.readFile(filePath, 'utf8');
const backupFileName = this.sanitizeFileName(path.basename(filePath));
const backupFilePath = path.join(componentBackupPath, backupFileName);

// eslint-disable-next-line no-await-in-loop
await fs.writeFile(backupFilePath, content, 'utf8');

files.push({
Expand Down Expand Up @@ -328,7 +335,7 @@ export class CursorBackupService {
*/
private getComponentFilePaths(component: CursorComponentType, options: CursorDeploymentOptions): string[] {
const cursorPath = options.cursorPath || this.getDefaultCursorPath();
const workspacePath = options.workspacePath;
const {workspacePath} = options;

switch (component) {
case 'global-settings':
Expand Down Expand Up @@ -372,7 +379,7 @@ export class CursorBackupService {

case 'workspace-config':
return workspacePath ? [
path.join(workspacePath, path.basename(workspacePath) + '.code-workspace'),
path.join(workspacePath, `${path.basename(workspacePath) }.code-workspace`),
] : [];

default:
Expand Down Expand Up @@ -420,7 +427,7 @@ export class CursorBackupService {
* Get default Cursor path based on OS
*/
private getDefaultCursorPath(): string {
const platform = process.platform;
const {platform} = process;
const home = process.env.HOME || process.env.USERPROFILE || '/tmp';

switch (platform) {
Expand All @@ -439,14 +446,14 @@ export class CursorBackupService {
* Sanitize filename for backup
*/
private sanitizeFileName(fileName: string): string {
return fileName.replace(/[^a-zA-Z0-9.-]/g, '_');
return fileName.replace(/[^\d.A-Za-z-]/g, '_');
}

/**
* Generate backup ID
*/
private generateBackupId(deploymentId: string): string {
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
const timestamp = new Date().toISOString().replace(/[.:]/g, '-');
const shortDeploymentId = deploymentId.split('-').pop() || 'unknown';
return `backup-${timestamp}-${shortDeploymentId}`;
}
Expand Down
Loading