diff --git a/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json b/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json index 62d4426..0406230 100644 --- a/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +++ b/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json @@ -1 +1 @@ -{"version":"3.2.4","results":[[":test/release.test.ts",{"duration":5.687064999999961,"failed":false}],[":test/github.test.ts",{"duration":6.335995999999966,"failed":false}],[":test/validator.test.ts",{"duration":3.6110199999999963,"failed":false}]]} \ No newline at end of file +{"version":"3.2.4","results":[[":test/release.test.ts",{"duration":6.6153189999999995,"failed":false}],[":test/github.test.ts",{"duration":7.541957000000025,"failed":false}],[":test/validator.test.ts",{"duration":3.747600000000034,"failed":false}]]} \ No newline at end of file diff --git a/packages/i18n/src/locales/en.json b/packages/i18n/src/locales/en.json index 3204ce5..ec4bba2 100644 --- a/packages/i18n/src/locales/en.json +++ b/packages/i18n/src/locales/en.json @@ -143,7 +143,9 @@ "info_github_token_instructions": "1. Create a token here: https://github.com/settings/tokens/new\n 2. Give it the 'repo' scope.\n 3. Copy the token (it starts with ghp_...) and paste it below.", "prompt_github_token": "Paste your GitHub PAT here:", "prompt_save_token": "Do you want to save this token securely for future use?", - "success_github_release_created": "✅ GitHub release created successfully!" + "success_github_release_created": "✅ GitHub release created successfully!", + "error_parse_github_url": "Could not parse GitHub owner/repo from remote URL.", + "error_invalid_token": "Your saved GitHub token was invalid and has been cleared." }, "validate": { "command_description": "Validates if a string is a conventional commit message.", @@ -159,5 +161,162 @@ "required": "required", "Show help": "Show help", "Show version number": "Show version number" + }, + "ui": { + "branch_name_required": "Branch name cannot be empty.", + "project_description_default": "A new project generated by StackCode.", + "short_description_required": "A short description is required." + }, + "vscode": { + "common": { + "no_workspace_folder": "No workspace folder found", + "unknown_error": "Unknown error", + "git_extension_error": "Git extension error:", + "failed_setup_git_monitoring": "Failed to setup git monitoring:", + "error_checking_current_branch": "Error checking current branch:", + "error_checking_project_structure": "Error checking project structure:", + "project_missing_files": "📁 Your project is missing some important files: {missingFiles}. Would you like to generate them?", + "generate_files": "Generate Files", + "not_now": "Not Now", + "dont_show_again": "Don't Show Again", + "file_generation_available_soon": "File generation will be available soon!" + }, + "config": { + "open_stackcode_settings": "Open StackCode Settings", + "open_stackcode_settings_description": "Configure StackCode extension settings", + "open_project_config": "Open Project Config", + "open_project_config_description": "Edit .stackcoderc.json file", + "create_project_config": "Create Project Config", + "create_project_config_description": "Create a new .stackcoderc.json file", + "what_would_you_like_configure": "What would you like to configure?", + "stackcoderc_not_found": ".stackcoderc.json file not found. Use \"Create Project Config\" to create one.", + "project_configuration_initialized": "Project configuration initialized!", + "failed_open_configuration": "Failed to open configuration:" + }, + "commit": { + "commit_dialog_opened": "Commit dialog opened in terminal!", + "failed_open_commit_dialog": "Failed to open commit dialog:" + }, + "release": { + "release_process_started": "Release process started! Check terminal for progress.", + "failed_create_release": "Failed to create release:", + "are_you_sure_create_release": "Are you sure you want to create a new release? This will tag the current commit and publish the release.", + "create_release": "Create Release", + "creating_release": "Creating release", + "preparing_release": "Preparing release...", + "creating_release_message": "Creating release...", + "release_created": "Release created!" + }, + "validate": { + "failed_validate_project": "Failed to validate project:", + "validating_project_structure": "Validating project structure", + "running_validation": "Running validation...", + "checking_project_structure": "Checking project structure...", + "validation_completed": "Validation completed!", + "project_validation_completed": "Project validation completed! Check terminal for results." + }, + "init": { + "enter_project_name": "Enter project name", + "enter_project_description": "Enter project description", + "enter_author_name": "Enter author name", + "project_initialized_successfully": "Project initialized successfully!", + "project_created_successfully": "Project {projectName} has been created successfully! Would you like to open it?", + "failed_initialize_project": "Failed to initialize project:", + "my_awesome_project": "my-awesome-project", + "project_name_required": "Project name is required", + "project_name_invalid": "Project name can only contain letters, numbers, hyphens and underscores", + "brief_description": "A brief description of your project", + "your_name": "Your Name", + "select_project_stack": "Select project stack", + "select_project_location": "Select Project Location", + "directory_exists_overwrite": "Directory {projectName} already exists. Do you want to overwrite it?", + "overwrite": "Overwrite", + "initializing_project": "Initializing project {projectName}", + "setting_up_structure": "Setting up project structure...", + "running_stackcode_cli": "Running StackCode CLI...", + "open_project": "Open Project", + "later": "Later", + "stacks": { + "node_ts": "Node.js with TypeScript", + "react": "React application", + "vue": "Vue.js application", + "angular": "Angular application", + "python": "Python project", + "java": "Java project", + "go": "Go project", + "php": "PHP project" + } + }, + "generate": { + "readme_generated_successfully": "README.md generated successfully!", + "readme_has_been_generated": "README.md has been generated successfully!", + "failed_generate_readme": "Failed to generate README.md:", + "gitignore_generated_successfully": ".gitignore generated successfully!", + "gitignore_has_been_generated": ".gitignore has been generated successfully!", + "failed_generate_gitignore": "Failed to generate .gitignore:", + "what_would_you_like_generate": "What would you like to generate?", + "readme_description": "Generate a comprehensive README file", + "gitignore_description": "Generate a .gitignore file based on project type", + "both_description": "Generate both README.md and .gitignore", + "readme_exists_overwrite": "README.md already exists. Do you want to overwrite it?", + "gitignore_exists_overwrite": ".gitignore already exists. Do you want to overwrite it?", + "overwrite": "Overwrite", + "generating_readme": "Generating README.md", + "setting_up_readme": "Setting up README structure...", + "running_generator": "Running generator...", + "readme_created": "README.md created!", + "generating_gitignore": "Generating .gitignore", + "setting_up_gitignore": "Setting up .gitignore structure...", + "gitignore_created": ".gitignore created!", + "both": "Both", + "would_you_like_open_readme": "Would you like to open the generated README.md?", + "would_you_like_open_gitignore": "Would you like to open the generated .gitignore?", + "open_file": "Open File", + "select_project_type_gitignore": "Select project type for .gitignore", + "stacks": { + "flutter": "Flutter project", + "swift": "Swift project", + "android": "Android project" + } + }, + "git": { + "enter_branch_name": "Enter the name for the new branch", + "branch_created_successfully": "Branch created successfully!", + "new_branch_created": "New branch '{branchName}' has been created and checked out!", + "failed_create_branch": "Failed to create branch:", + "branch_finished_successfully": "Branch finished successfully!", + "branch_has_been_finished": "Branch {currentBranch} has been finished and merged!", + "failed_finish_branch": "Failed to finish branch:", + "enter_scope_optional": "Enter scope (optional)", + "enter_commit_description": "Enter commit description", + "select_git_action": "Select Git action", + "start_description": "Start a new feature branch", + "finish_description": "Finish current branch", + "new_feature": "new-feature", + "branch_name_required": "Branch name is required", + "branch_name_invalid": "Branch name can only contain letters, numbers, hyphens, underscores and slashes", + "select_branch_type": "Select branch type", + "feature_description": "A new feature branch", + "hotfix_description": "A hotfix branch", + "bugfix_description": "A bug fix branch", + "chore_description": "A chore/maintenance branch", + "creating_branch": "Creating branch {branchName}", + "switching_to_develop": "Switching to develop...", + "pulling_latest_changes": "Pulling latest changes...", + "creating_new_branch": "Creating new branch...", + "finishing_branch": "Finishing branch {branchName}", + "pushing_branch": "Pushing branch...", + "opening_pr": "Opening pull request...", + "are_you_sure_finish_branch": "Are you sure you want to finish {currentBranch}? This will merge it back to the base branch.", + "finish_branch": "Finish Branch" + }, + "dashboard": { + "received_command_from_webview": "[StackCode] Received command from webview:", + "error_executing_command": "[StackCode] Error executing command", + "command_error": "commandError", + "no_view_available_stats_update": "[StackCode] No view available for stats update", + "workspace_name": "[StackCode] Workspace name:", + "workspace_folders": "[StackCode] Workspace folders:" + } } } diff --git a/packages/i18n/src/locales/pt.json b/packages/i18n/src/locales/pt.json index aca4641..8941361 100644 --- a/packages/i18n/src/locales/pt.json +++ b/packages/i18n/src/locales/pt.json @@ -113,20 +113,20 @@ } }, "release": { - "command_description": "Ajuda com o versionamento e o lançamento do projeto.", + "command_description": "Auxilia com versionamento e release do projeto.", "start": "🚀 Iniciando processo de release...", "error_structure": "✖ Não foi possível determinar a estrutura do projeto. Você está na raiz de um monorepo com um diretório `packages`?", "detected_strategy": "ℹ️ Estratégia de versionamento detectada: {strategy}", - "prompt_confirm_release": "A versão atual é {currentVersion}. A próxima versão recomendada é {newVersion}. Confirma o release?", - "error_calculating_version": "✖ Erro ao calcular a próxima versão.", - "step_updating_versions": "-> Atualizando a versão em todos os arquivos package.json...", + "prompt_confirm_release": "A versão atual é {currentVersion}. A próxima versão recomendada é {newVersion}. Confirmar release?", + "error_calculating_version": "✖ Erro ao calcular próxima versão.", + "step_updating_versions": "-> Atualizando versão em todos os arquivos package.json...", "step_generating_changelog": "-> Gerando CHANGELOG.md...", "success_ready_to_commit": "✅ Sucesso! Versão atualizada e CHANGELOG.md gerado.", - "next_steps_commit": "Próximos passos: Revise as alterações, depois execute 'git commit' e 'git tag'.", - "independent_mode_start": "🚀 Iniciando análise para o modo independente...", + "next_steps_commit": "Próximos passos: Revise as mudanças, então execute 'git commit' e 'git tag'.", + "independent_mode_start": "🚀 Iniciando análise para modo independente...", "independent_mode_no_changes": "✅ Nenhum pacote alterado detectado. Tudo está atualizado!", "independent_mode_no_bumps": "ℹ️ Mudanças detectadas, mas nenhuma requer uma nova versão (ex: apenas chores ou refactors).", - "independent_prompt_confirm": "Confirma o release dos pacotes listados acima?", + "independent_prompt_confirm": "Confirmar o release dos pacotes listados acima?", "independent_success": "✅ Release independente concluído com sucesso!", "next_steps_push": "Próximos passos: Execute 'git push --follow-tags' para publicar.", "independent_mode_packages_to_update": "Os seguintes pacotes serão atualizados:", @@ -136,14 +136,16 @@ "table_header_new_version": "Nova Versão", "info_releasing_package": "Iniciando release para {pkgName}...", "step_updating_version": "-> Atualizando versão...", - "step_committing_and_tagging": "-> Criando commit e tag...", + "step_committing_and_tagging": "-> Commitando e tagueando...", "step_done": "✔", - "prompt_create_github_release": "Deseja criar um release no GitHub para esta versão?", - "info_github_token_needed": "Para criar um release no GitHub, o StackCode precisa de um Personal Access Token (PAT).", - "info_github_token_instructions": "1. Crie um token aqui: https://github.com/settings/tokens/new\n 2. Dê a ele a permissão (scope) de 'repo'.\n 3. Copie o token (ele começa com ghp_...) e cole-o abaixo.", + "prompt_create_github_release": "Deseja criar um GitHub release para esta versão?", + "info_github_token_needed": "Para criar um GitHub release, o StackCode precisa de um Personal Access Token (PAT).", + "info_github_token_instructions": "1. Crie um token aqui: https://github.com/settings/tokens/new\\n 2. Dê a ele o escopo 'repo'.\\n 3. Copie o token (começa com ghp_...) e cole abaixo.", "prompt_github_token": "Cole seu GitHub PAT aqui:", - "prompt_save_token": "Deseja salvar este token de forma segura para uso futuro?", - "success_github_release_created": "✅ Release criada com sucesso no GitHub!" + "prompt_save_token": "Deseja salvar este token com segurança para uso futuro?", + "success_github_release_created": "✅ GitHub release criado com sucesso!", + "error_parse_github_url": "Não foi possível analisar proprietário/repo GitHub da URL remota.", + "error_invalid_token": "Seu token GitHub salvo era inválido e foi limpo." }, "validate": { "command_description": "Valida se uma string é uma mensagem de commit convencional.", @@ -159,5 +161,162 @@ "required": "obrigatório", "Show help": "Exibir ajuda", "Show version number": "Exibir número da versão" + }, + "ui": { + "branch_name_required": "O nome da branch não pode ser vazio.", + "project_description_default": "Um novo projeto gerado pelo StackCode.", + "short_description_required": "Uma descrição curta é obrigatória." + }, + "vscode": { + "common": { + "no_workspace_folder": "Nenhuma pasta de workspace encontrada", + "unknown_error": "Erro desconhecido", + "git_extension_error": "Erro na extensão Git:", + "failed_setup_git_monitoring": "Falha ao configurar monitoramento do Git:", + "error_checking_current_branch": "Erro ao verificar branch atual:", + "error_checking_project_structure": "Erro ao verificar estrutura do projeto:", + "project_missing_files": "📁 Seu projeto está faltando alguns arquivos importantes: {missingFiles}. Gostaria de gerá-los?", + "generate_files": "Gerar Arquivos", + "not_now": "Agora Não", + "dont_show_again": "Não Mostrar Novamente", + "file_generation_available_soon": "Geração de arquivos estará disponível em breve!" + }, + "config": { + "open_stackcode_settings": "Abrir Configurações do StackCode", + "open_stackcode_settings_description": "Configurar as definições da extensão StackCode", + "open_project_config": "Abrir Configuração do Projeto", + "open_project_config_description": "Editar arquivo .stackcoderc.json", + "create_project_config": "Criar Configuração do Projeto", + "create_project_config_description": "Criar um novo arquivo .stackcoderc.json", + "what_would_you_like_configure": "O que você gostaria de configurar?", + "stackcoderc_not_found": "Arquivo .stackcoderc.json não encontrado. Use \"Criar Configuração do Projeto\" para criar um.", + "project_configuration_initialized": "Configuração do projeto inicializada!", + "failed_open_configuration": "Falha ao abrir configuração:" + }, + "commit": { + "commit_dialog_opened": "Diálogo de commit aberto no terminal!", + "failed_open_commit_dialog": "Falha ao abrir diálogo de commit:" + }, + "release": { + "release_process_started": "Processo de release iniciado! Verifique o terminal para progresso.", + "failed_create_release": "Falha ao criar release:", + "are_you_sure_create_release": "Tem certeza de que deseja criar um novo release? Isso irá marcar o commit atual e publicar o release.", + "create_release": "Criar Release", + "creating_release": "Criando release", + "preparing_release": "Preparando release...", + "creating_release_message": "Criando release...", + "release_created": "Release criado!" + }, + "validate": { + "failed_validate_project": "Falha ao validar projeto:", + "validating_project_structure": "Validando estrutura do projeto", + "running_validation": "Executando validação...", + "checking_project_structure": "Verificando estrutura do projeto...", + "validation_completed": "Validação concluída!", + "project_validation_completed": "Validação do projeto concluída! Verifique o terminal para resultados." + }, + "init": { + "enter_project_name": "Digite o nome do projeto", + "enter_project_description": "Digite a descrição do projeto", + "enter_author_name": "Digite o nome do autor", + "project_initialized_successfully": "Projeto inicializado com sucesso!", + "project_created_successfully": "Projeto {projectName} foi criado com sucesso! Gostaria de abri-lo?", + "failed_initialize_project": "Falha ao inicializar projeto:", + "my_awesome_project": "meu-projeto-incrivel", + "project_name_required": "Nome do projeto é obrigatório", + "project_name_invalid": "Nome do projeto pode conter apenas letras, números, hífens e sublinhados", + "brief_description": "Uma breve descrição do seu projeto", + "your_name": "Seu Nome", + "select_project_stack": "Selecione a stack do projeto", + "select_project_location": "Selecionar Local do Projeto", + "directory_exists_overwrite": "Diretório {projectName} já existe. Deseja sobrescrever?", + "overwrite": "Sobrescrever", + "initializing_project": "Inicializando projeto {projectName}", + "setting_up_structure": "Configurando estrutura do projeto...", + "running_stackcode_cli": "Executando StackCode CLI...", + "open_project": "Abrir Projeto", + "later": "Mais tarde", + "stacks": { + "node_ts": "Node.js com TypeScript", + "react": "Aplicação React", + "vue": "Aplicação Vue.js", + "angular": "Aplicação Angular", + "python": "Projeto Python", + "java": "Projeto Java", + "go": "Projeto Go", + "php": "Projeto PHP" + } + }, + "generate": { + "readme_generated_successfully": "README.md gerado com sucesso!", + "readme_has_been_generated": "README.md foi gerado com sucesso!", + "failed_generate_readme": "Falha ao gerar README.md:", + "gitignore_generated_successfully": ".gitignore gerado com sucesso!", + "gitignore_has_been_generated": ".gitignore foi gerado com sucesso!", + "failed_generate_gitignore": "Falha ao gerar .gitignore:", + "what_would_you_like_generate": "O que você gostaria de gerar?", + "readme_description": "Gerar um arquivo README abrangente", + "gitignore_description": "Gerar um arquivo .gitignore baseado no tipo de projeto", + "both_description": "Gerar tanto README.md quanto .gitignore", + "readme_exists_overwrite": "README.md já existe. Deseja sobrescrever?", + "gitignore_exists_overwrite": ".gitignore já existe. Deseja sobrescrever?", + "overwrite": "Sobrescrever", + "generating_readme": "Gerando README.md", + "setting_up_readme": "Configurando estrutura do README...", + "running_generator": "Executando gerador...", + "readme_created": "README.md criado!", + "generating_gitignore": "Gerando .gitignore", + "setting_up_gitignore": "Configurando estrutura do .gitignore...", + "gitignore_created": ".gitignore criado!", + "both": "Ambos", + "would_you_like_open_readme": "Gostaria de abrir o README.md gerado?", + "would_you_like_open_gitignore": "Gostaria de abrir o .gitignore gerado?", + "open_file": "Abrir Arquivo", + "select_project_type_gitignore": "Selecionar tipo de projeto para .gitignore", + "stacks": { + "flutter": "Projeto Flutter", + "swift": "Projeto Swift", + "android": "Projeto Android" + } + }, + "git": { + "enter_branch_name": "Digite o nome da nova branch", + "branch_created_successfully": "Branch criada com sucesso!", + "new_branch_created": "Nova branch '{branchName}' foi criada e selecionada!", + "failed_create_branch": "Falha ao criar branch:", + "branch_finished_successfully": "Branch finalizada com sucesso!", + "branch_has_been_finished": "Branch {currentBranch} foi finalizada e mesclada!", + "failed_finish_branch": "Falha ao finalizar branch:", + "enter_scope_optional": "Digite o escopo (opcional)", + "enter_commit_description": "Digite a descrição do commit", + "select_git_action": "Selecionar ação do Git", + "start_description": "Iniciar uma nova branch de feature", + "finish_description": "Finalizar branch atual", + "new_feature": "nova-feature", + "branch_name_required": "Nome da branch é obrigatório", + "branch_name_invalid": "Nome da branch pode conter apenas letras, números, hífens, sublinhados e barras", + "select_branch_type": "Selecionar tipo de branch", + "feature_description": "Uma nova branch de feature", + "hotfix_description": "Uma branch de hotfix", + "bugfix_description": "Uma branch de correção de bug", + "chore_description": "Uma branch de manutenção/chore", + "creating_branch": "Criando branch {branchName}", + "switching_to_develop": "Mudando para develop...", + "pulling_latest_changes": "Puxando últimas mudanças...", + "creating_new_branch": "Criando nova branch...", + "finishing_branch": "Finalizando branch {branchName}", + "pushing_branch": "Enviando branch...", + "opening_pr": "Abrindo pull request...", + "are_you_sure_finish_branch": "Tem certeza de que deseja finalizar {currentBranch}? Isso irá mesclá-la de volta para a branch base.", + "finish_branch": "Finalizar Branch" + }, + "dashboard": { + "received_command_from_webview": "[StackCode] Comando recebido do webview:", + "error_executing_command": "[StackCode] Erro ao executar comando", + "command_error": "erroComando", + "no_view_available_stats_update": "[StackCode] Nenhuma visualização disponível para atualização de estatísticas", + "workspace_name": "[StackCode] Nome do workspace:", + "workspace_folders": "[StackCode] Pastas do workspace:" + } } } diff --git a/packages/vscode-extension/out/commands/CommitCommand.js b/packages/vscode-extension/out/commands/CommitCommand.js index 48be7bb..10c3563 100644 --- a/packages/vscode-extension/out/commands/CommitCommand.js +++ b/packages/vscode-extension/out/commands/CommitCommand.js @@ -2,20 +2,25 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.CommitCommand = void 0; const BaseCommand_1 = require("./BaseCommand"); +const i18n_1 = require("@stackcode/i18n"); class CommitCommand extends BaseCommand_1.BaseCommand { async execute() { try { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError((0, i18n_1.t)("vscode.common.no_workspace_folder")); return; } // Use StackCode CLI for commit const command = `npx @stackcode/cli commit`; await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); - this.showSuccess("Commit dialog opened in terminal!"); + this.showSuccess((0, i18n_1.t)("vscode.commit.commit_dialog_opened")); } catch (error) { - this.showError(`Failed to open commit dialog: ${error}`); + this.showError( + (0, i18n_1.t)("vscode.commit.failed_open_commit_dialog", { + error: String(error), + }), + ); } } } diff --git a/packages/vscode-extension/out/commands/CommitCommand.js.map b/packages/vscode-extension/out/commands/CommitCommand.js.map index c1707cd..b842826 100644 --- a/packages/vscode-extension/out/commands/CommitCommand.js.map +++ b/packages/vscode-extension/out/commands/CommitCommand.js.map @@ -1 +1 @@ -{"version":3,"file":"CommitCommand.js","sourceRoot":"","sources":["../../src/commands/CommitCommand.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAE5C,MAAa,aAAc,SAAQ,yBAAW;IAC5C,KAAK,CAAC,OAAO;QACX,IAAI;YACF,MAAM,eAAe,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAC;YACzD,IAAI,CAAC,eAAe,EAAE;gBACpB,IAAI,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC;gBAC5C,OAAO;aACR;YAED,+BAA+B;YAC/B,MAAM,OAAO,GAAG,2BAA2B,CAAC;YAE5C,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAEnE,IAAI,CAAC,WAAW,CAAC,mCAAmC,CAAC,CAAC;SACvD;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,iCAAiC,KAAK,EAAE,CAAC,CAAC;SAC1D;IACH,CAAC;CACF;AAnBD,sCAmBC"} \ No newline at end of file +{"version":3,"file":"CommitCommand.js","sourceRoot":"","sources":["../../src/commands/CommitCommand.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,0CAAoC;AAEpC,MAAa,aAAc,SAAQ,yBAAW;IAC5C,KAAK,CAAC,OAAO;QACX,IAAI;YACF,MAAM,eAAe,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAC;YACzD,IAAI,CAAC,eAAe,EAAE;gBACpB,IAAI,CAAC,SAAS,CAAC,IAAA,QAAC,EAAC,mCAAmC,CAAC,CAAC,CAAC;gBACvD,OAAO;aACR;YAED,+BAA+B;YAC/B,MAAM,OAAO,GAAG,2BAA2B,CAAC;YAE5C,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAEnE,IAAI,CAAC,WAAW,CAAC,IAAA,QAAC,EAAC,oCAAoC,CAAC,CAAC,CAAC;SAC3D;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,IAAA,QAAC,EAAC,yCAAyC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;SACxF;IACH,CAAC;CACF;AAnBD,sCAmBC"} \ No newline at end of file diff --git a/packages/vscode-extension/out/commands/ConfigCommand.js b/packages/vscode-extension/out/commands/ConfigCommand.js index e7e74aa..3f2e5a2 100644 --- a/packages/vscode-extension/out/commands/ConfigCommand.js +++ b/packages/vscode-extension/out/commands/ConfigCommand.js @@ -47,42 +47,55 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.ConfigCommand = void 0; const vscode = __importStar(require("vscode")); const BaseCommand_1 = require("./BaseCommand"); +const i18n_1 = require("@stackcode/i18n"); class ConfigCommand extends BaseCommand_1.BaseCommand { async execute() { try { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError((0, i18n_1.t)("vscode.common.no_workspace_folder")); return; } const action = await vscode.window.showQuickPick( [ { - label: "Open StackCode Settings", - description: "Configure StackCode extension settings", + label: (0, i18n_1.t)("vscode.config.open_stackcode_settings"), + description: (0, i18n_1.t)( + "vscode.config.open_stackcode_settings_description", + ), }, { - label: "Open Project Config", - description: "Edit .stackcoderc.json file", + label: (0, i18n_1.t)("vscode.config.open_project_config"), + description: (0, i18n_1.t)( + "vscode.config.open_project_config_description", + ), }, { - label: "Create Project Config", - description: "Create a new .stackcoderc.json file", + label: (0, i18n_1.t)("vscode.config.create_project_config"), + description: (0, i18n_1.t)( + "vscode.config.create_project_config_description", + ), }, ], { - placeHolder: "What would you like to configure?", + placeHolder: (0, i18n_1.t)( + "vscode.config.what_would_you_like_configure", + ), }, ); if (!action) { return; } - if (action.label === "Open StackCode Settings") { + if ( + action.label === (0, i18n_1.t)("vscode.config.open_stackcode_settings") + ) { vscode.commands.executeCommand( "workbench.action.openSettings", "stackcode", ); - } else if (action.label === "Open Project Config") { + } else if ( + action.label === (0, i18n_1.t)("vscode.config.open_project_config") + ) { const configPath = vscode.Uri.joinPath( workspaceFolder.uri, ".stackcoderc.json", @@ -91,18 +104,24 @@ class ConfigCommand extends BaseCommand_1.BaseCommand { const document = await vscode.workspace.openTextDocument(configPath); await vscode.window.showTextDocument(document); } catch { - this.showError( - '.stackcoderc.json file not found. Use "Create Project Config" to create one.', - ); + this.showError((0, i18n_1.t)("vscode.config.stackcoderc_not_found")); } - } else if (action.label === "Create Project Config") { + } else if ( + action.label === (0, i18n_1.t)("vscode.config.create_project_config") + ) { // Use StackCode CLI for config creation const command = `npx @stackcode/cli config init`; await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); - this.showSuccess("Project configuration initialized!"); + this.showSuccess( + (0, i18n_1.t)("vscode.config.project_configuration_initialized"), + ); } } catch (error) { - this.showError(`Failed to open configuration: ${error}`); + this.showError( + (0, i18n_1.t)("vscode.config.failed_open_configuration", { + error: String(error), + }), + ); } } } diff --git a/packages/vscode-extension/out/commands/ConfigCommand.js.map b/packages/vscode-extension/out/commands/ConfigCommand.js.map index 9dc1b12..038444e 100644 --- a/packages/vscode-extension/out/commands/ConfigCommand.js.map +++ b/packages/vscode-extension/out/commands/ConfigCommand.js.map @@ -1 +1 @@ -{"version":3,"file":"ConfigCommand.js","sourceRoot":"","sources":["../../src/commands/ConfigCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;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AE;gBACnD,wCAAwC;gBACxC,MAAM,OAAO,GAAG,gCAAgC,CAAC;gBACjD,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACnE,IAAI,CAAC,WAAW,CAAC,oCAAoC,CAAC,CAAC;aACxD;SACF;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,iCAAiC,KAAK,EAAE,CAAC,CAAC;SAC1D;IACH,CAAC;CACF;AA7DD,sCA6DC"} \ No newline at end of file +{"version":3,"file":"ConfigCommand.js","sourceRoot":"","sources":["../../src/commands/ConfigCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,+CAA4C;AAC5C,0CAAoC;AAEpC,MAAa,aAAc,SAAQ,yBAAW;IAC5C,KAAK,CAAC,OAAO;QACX,IAAI;YACF,MAAM,eAAe,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAC;YACzD,IAAI,CAAC,eAAe,EAAE;gBACpB,IAAI,CAAC,SAAS,CAAC,IAAA,QAAC,EAAC,mCAAmC,CAAC,CAAC,CAAC;gBACvD,OAAO;aACR;YAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,CAC9C;gBACE;oBACE,KAAK,EAAE,IAAA,QAAC,EAAC,uCAAuC,CAAC;oBACjD,WAAW,EAAE,IAAA,QAAC,EAAC,mDAAmD,CAAC;iBACpE;gBACD;oBACE,KAAK,EAAE,IAAA,QAAC,EAAC,mCAAmC,CAAC;oBAC7C,WAAW,EAAE,IAAA,QAAC,EAAC,+CAA+C,CAAC;iBAChE;gBACD;oBACE,KAAK,EAAE,IAAA,QAAC,EAAC,qCAAqC,CAAC;oBAC/C,WAAW,EAAE,IAAA,QAAC,EAAC,iDAAiD,CAAC;iBAClE;aACF,EACD;gBACE,WAAW,EAAE,IAAA,QAAC,EAAC,6CAA6C,CAAC;aAC9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/vscode-extension/out/commands/GenerateCommand.js index 48af343..1c19a50 100644 --- a/packages/vscode-extension/out/commands/GenerateCommand.js +++ b/packages/vscode-extension/out/commands/GenerateCommand.js @@ -47,6 +47,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.GenerateCommand = void 0; const vscode = __importStar(require("vscode")); const BaseCommand_1 = require("./BaseCommand"); +const i18n_1 = require("@stackcode/i18n"); const path = __importStar(require("path")); class GenerateCommand extends BaseCommand_1.BaseCommand { async execute() { @@ -54,19 +55,21 @@ class GenerateCommand extends BaseCommand_1.BaseCommand { [ { label: "README.md", - description: "Generate a comprehensive README file", + description: (0, i18n_1.t)("vscode.generate.readme_description"), }, { label: ".gitignore", - description: "Generate a .gitignore file based on project type", + description: (0, i18n_1.t)("vscode.generate.gitignore_description"), }, { - label: "Both", - description: "Generate both README.md and .gitignore", + label: (0, i18n_1.t)("vscode.generate.both"), + description: (0, i18n_1.t)("vscode.generate.both_description"), }, ], { - placeHolder: "What would you like to generate?", + placeHolder: (0, i18n_1.t)( + "vscode.generate.what_would_you_like_generate", + ), }, ); if (!option) { @@ -76,7 +79,7 @@ class GenerateCommand extends BaseCommand_1.BaseCommand { await this.generateReadme(); } else if (option.label === ".gitignore") { await this.generateGitignore(); - } else if (option.label === "Both") { + } else if (option.label === (0, i18n_1.t)("vscode.generate.both")) { await this.generateReadme(); await this.generateGitignore(); } @@ -85,7 +88,7 @@ class GenerateCommand extends BaseCommand_1.BaseCommand { try { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError((0, i18n_1.t)("vscode.common.no_workspace_folder")); return; } const readmePath = path.join(workspaceFolder.uri.fsPath, "README.md"); @@ -93,8 +96,8 @@ class GenerateCommand extends BaseCommand_1.BaseCommand { try { await vscode.workspace.fs.stat(vscode.Uri.file(readmePath)); const overwrite = await this.confirmAction( - "README.md already exists. Do you want to overwrite it?", - "Overwrite", + (0, i18n_1.t)("vscode.generate.readme_exists_overwrite"), + (0, i18n_1.t)("vscode.generate.overwrite"), ); if (!overwrite) { return; @@ -105,43 +108,52 @@ class GenerateCommand extends BaseCommand_1.BaseCommand { vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: "Generating README.md", + title: (0, i18n_1.t)("vscode.generate.generating_readme"), cancellable: false, }, async (progress) => { progress.report({ increment: 0, - message: "Analyzing project structure...", + message: (0, i18n_1.t)("vscode.generate.setting_up_readme"), }); // Use StackCode CLI for generation const command = `npx @stackcode/cli generate readme`; - progress.report({ increment: 50, message: "Generating content..." }); + progress.report({ + increment: 50, + message: (0, i18n_1.t)("vscode.generate.running_generator"), + }); await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); progress.report({ increment: 100, - message: "README.md generated successfully!", + message: (0, i18n_1.t)("vscode.generate.readme_created"), }); }, ); - this.showSuccess("README.md has been generated successfully!"); + this.showSuccess( + (0, i18n_1.t)("vscode.generate.readme_has_been_generated"), + ); // Ask if user wants to open the file const openFile = await vscode.window.showInformationMessage( - "Would you like to open the generated README.md?", - "Open File", + (0, i18n_1.t)("vscode.generate.would_you_like_open_readme"), + (0, i18n_1.t)("vscode.generate.open_file"), ); - if (openFile === "Open File") { + if (openFile === (0, i18n_1.t)("vscode.generate.open_file")) { const document = await vscode.workspace.openTextDocument(readmePath); await vscode.window.showTextDocument(document); } } catch (error) { - this.showError(`Failed to generate README.md: ${error}`); + this.showError( + (0, i18n_1.t)("vscode.generate.failed_generate_readme", { + error: String(error), + }), + ); } } async generateGitignore() { try { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError((0, i18n_1.t)("vscode.common.no_workspace_folder")); return; } const gitignorePath = path.join(workspaceFolder.uri.fsPath, ".gitignore"); @@ -149,8 +161,8 @@ class GenerateCommand extends BaseCommand_1.BaseCommand { try { await vscode.workspace.fs.stat(vscode.Uri.file(gitignorePath)); const overwrite = await this.confirmAction( - ".gitignore already exists. Do you want to overwrite it?", - "Overwrite", + (0, i18n_1.t)("vscode.generate.gitignore_exists_overwrite"), + (0, i18n_1.t)("vscode.generate.overwrite"), ); if (!overwrite) { return; @@ -161,20 +173,52 @@ class GenerateCommand extends BaseCommand_1.BaseCommand { // Ask for project type const projectType = await vscode.window.showQuickPick( [ - { label: "node-ts", description: "Node.js with TypeScript" }, - { label: "react", description: "React application" }, - { label: "vue", description: "Vue.js application" }, - { label: "angular", description: "Angular application" }, - { label: "python", description: "Python project" }, - { label: "java", description: "Java project" }, - { label: "go", description: "Go project" }, - { label: "php", description: "PHP project" }, - { label: "flutter", description: "Flutter project" }, - { label: "swift", description: "Swift project" }, - { label: "android", description: "Android project" }, + { + label: "node-ts", + description: (0, i18n_1.t)("vscode.init.stacks.node_ts"), + }, + { + label: "react", + description: (0, i18n_1.t)("vscode.init.stacks.react"), + }, + { + label: "vue", + description: (0, i18n_1.t)("vscode.init.stacks.vue"), + }, + { + label: "angular", + description: (0, i18n_1.t)("vscode.init.stacks.angular"), + }, + { + label: "python", + description: (0, i18n_1.t)("vscode.init.stacks.python"), + }, + { + label: "java", + description: (0, i18n_1.t)("vscode.init.stacks.java"), + }, + { label: "go", description: (0, i18n_1.t)("vscode.init.stacks.go") }, + { + label: "php", + description: (0, i18n_1.t)("vscode.init.stacks.php"), + }, + { + label: "flutter", + description: (0, i18n_1.t)("vscode.generate.stacks.flutter"), + }, + { + label: "swift", + description: (0, i18n_1.t)("vscode.generate.stacks.swift"), + }, + { + label: "android", + description: (0, i18n_1.t)("vscode.generate.stacks.android"), + }, ], { - placeHolder: "Select project type for .gitignore", + placeHolder: (0, i18n_1.t)( + "vscode.generate.select_project_type_gitignore", + ), }, ); if (!projectType) { @@ -183,36 +227,45 @@ class GenerateCommand extends BaseCommand_1.BaseCommand { vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: "Generating .gitignore", + title: (0, i18n_1.t)("vscode.generate.generating_gitignore"), cancellable: false, }, async (progress) => { progress.report({ increment: 0, - message: "Generating .gitignore content...", + message: (0, i18n_1.t)("vscode.generate.setting_up_gitignore"), }); // Use StackCode CLI for generation const command = `npx @stackcode/cli generate gitignore --type="${projectType.label}"`; - progress.report({ increment: 50, message: "Creating file..." }); + progress.report({ + increment: 50, + message: (0, i18n_1.t)("vscode.generate.running_generator"), + }); await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); progress.report({ increment: 100, - message: ".gitignore generated successfully!", + message: (0, i18n_1.t)("vscode.generate.gitignore_created"), }); }, ); - this.showSuccess(".gitignore has been generated successfully!"); + this.showSuccess( + (0, i18n_1.t)("vscode.generate.gitignore_has_been_generated"), + ); // Ask if user wants to open the file const openFile = await vscode.window.showInformationMessage( - "Would you like to open the generated .gitignore?", - "Open File", + (0, i18n_1.t)("vscode.generate.would_you_like_open_gitignore"), + (0, i18n_1.t)("vscode.generate.open_file"), ); - if (openFile === "Open File") { + if (openFile === (0, i18n_1.t)("vscode.generate.open_file")) { const document = await vscode.workspace.openTextDocument(gitignorePath); await vscode.window.showTextDocument(document); } } catch (error) { - this.showError(`Failed to generate .gitignore: ${error}`); + this.showError( + (0, i18n_1.t)("vscode.generate.failed_generate_gitignore", { + error: String(error), + }), + ); } } } diff --git a/packages/vscode-extension/out/commands/GenerateCommand.js.map b/packages/vscode-extension/out/commands/GenerateCommand.js.map index 8ed223e..8379b7b 100644 --- a/packages/vscode-extension/out/commands/GenerateCommand.js.map +++ b/packages/vscode-extension/out/commands/GenerateCommand.js.map @@ -1 +1 @@ -{"version":3,"file":"GenerateCommand.js","sourceRoot":"","sources":["../../src/commands/GenerateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,+CAA4C;AAE5C,2CAA6B;AAE7B,MAAa,eAAgB,SAAQ,yBAAW;IAC9C,KAAK,CAAC,OAAO;QACX,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,CAC9C;YACE;gBACE,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE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,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,kCAAkC,KAAK,EAAE,CAAC,CAAC;SAC3D;IACH,CAAC;CACF;AAjMD,0CAiMC"} \ No newline at end of file +{"version":3,"file":"GenerateCommand.js","sourceRoot":"","sources":["../../src/commands/GenerateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,+CAA4C;AAE5C,0CAAoC;AACpC,2CAA6B;AAE7B,MAAa,eAAgB,SAAQ,yBAAW;IAC9C,KAAK,CAAC,OAAO;QACX,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,CAC9C;YACE;gBACE,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,IAAA,QAAC,EAAC,oCAAoC,CAAC;aACrD;YACD;gBACE,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,IAAA,QAAC,EAAC,uCAAuC,CAAC;aACxD;YACD;gBACE,KAAK,EAAE,IAAA,QAAC,EAAC,sBAAsB,CAAC;gBAChC,WAAW,EAAE,IAAA,QAAC,EAAC,kCAAkC,CAAC;aACnD;SACF,EACD;YACE,WAAW,EAAE,IAAA,QAAC,EAAC,8CAA8C,CAAC;SAC/D,CACF,CAAC;QAEF,IAAI,CAAC,MAAM,EAAE;YACX,OAAO;SACR;QAED,IAAI,MAAM,CAAC,KAAK,KAAK,WAAW,EAAE;YAChC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;SAC7B;aAAM,IAAI,MAAM,CAAC,KAAK,KAAK,YAAY,EAAE;YACxC,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;SAChC;aAAM,IAAI,MAAM,CAAC,KAAK,KAAK,IAAA,QAAC,EAAC,sBAAsB,CAAC,EAAE;YACrD,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;YAC5B,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;SAChC;IACH,CAAC;IAED,KAAK,CAAC,cAAc;QA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,CAAC,EAClD,IAAA,QAAC,EAAC,2BAA2B,CAAC,CAC/B,CAAC;YAEF,IAAI,QAAQ,KAAK,IAAA,QAAC,EAAC,2BAA2B,CAAC,EAAE;gBAC/C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;gBACxE,MAAM,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;aAChD;SACF;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,IAAA,QAAC,EAAC,2CAA2C,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;SAC1F;IACH,CAAC;CACF;AAjMD,0CAiMC"} \ No newline at end of file diff --git a/packages/vscode-extension/out/commands/GitCommand.js b/packages/vscode-extension/out/commands/GitCommand.js index 235dfc5..a55e707 100644 --- a/packages/vscode-extension/out/commands/GitCommand.js +++ b/packages/vscode-extension/out/commands/GitCommand.js @@ -47,15 +47,22 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.GitCommand = void 0; const vscode = __importStar(require("vscode")); const BaseCommand_1 = require("./BaseCommand"); +const i18n_1 = require("@stackcode/i18n"); class GitCommand extends BaseCommand_1.BaseCommand { async execute() { const action = await vscode.window.showQuickPick( [ - { label: "start", description: "Start a new feature branch" }, - { label: "finish", description: "Finish current branch" }, + { + label: "start", + description: (0, i18n_1.t)("vscode.git.start_description"), + }, + { + label: "finish", + description: (0, i18n_1.t)("vscode.git.finish_description"), + }, ], { - placeHolder: "Select Git action", + placeHolder: (0, i18n_1.t)("vscode.git.select_git_action"), }, ); if (!action) { @@ -70,14 +77,14 @@ class GitCommand extends BaseCommand_1.BaseCommand { async startBranch() { try { const branchName = await vscode.window.showInputBox({ - prompt: "Enter the name for the new branch", - placeHolder: "new-feature", + prompt: (0, i18n_1.t)("vscode.git.enter_branch_name"), + placeHolder: (0, i18n_1.t)("vscode.git.new_feature"), validateInput: (value) => { if (!value) { - return "Branch name is required"; + return (0, i18n_1.t)("vscode.git.branch_name_required"); } if (!/^[a-zA-Z0-9/_-]+$/.test(value)) { - return "Branch name can only contain letters, numbers, hyphens, underscores and slashes"; + return (0, i18n_1.t)("vscode.git.branch_name_invalid"); } return null; }, @@ -87,13 +94,25 @@ class GitCommand extends BaseCommand_1.BaseCommand { } const branchType = await vscode.window.showQuickPick( [ - { label: "feature", description: "A new feature branch" }, - { label: "bugfix", description: "A bug fix branch" }, - { label: "hotfix", description: "A hotfix branch" }, - { label: "release", description: "A release branch" }, + { + label: "feature", + description: (0, i18n_1.t)("vscode.git.feature_description"), + }, + { + label: "bugfix", + description: (0, i18n_1.t)("vscode.git.bugfix_description"), + }, + { + label: "hotfix", + description: (0, i18n_1.t)("vscode.git.hotfix_description"), + }, + { + label: "chore", + description: (0, i18n_1.t)("vscode.git.chore_description"), + }, ], { - placeHolder: "Select branch type", + placeHolder: (0, i18n_1.t)("vscode.git.select_branch_type"), }, ); if (!branchType) { @@ -101,42 +120,53 @@ class GitCommand extends BaseCommand_1.BaseCommand { } const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError((0, i18n_1.t)("vscode.common.no_workspace_folder")); return; } vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: `Creating ${branchType.label} branch: ${branchName}`, + title: (0, i18n_1.t)("vscode.git.creating_branch", { + branchName: `${branchType.label}/${branchName}`, + }), cancellable: false, }, async (progress) => { - progress.report({ increment: 0, message: "Creating branch..." }); + progress.report({ + increment: 0, + message: (0, i18n_1.t)("vscode.git.switching_to_develop"), + }); // Use StackCode CLI for git operations const command = `npx @stackcode/cli git start ${branchName} --type=${branchType.label}`; progress.report({ increment: 50, - message: "Switching to new branch...", + message: (0, i18n_1.t)("vscode.git.creating_new_branch"), }); await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); progress.report({ increment: 100, - message: "Branch created successfully!", + message: (0, i18n_1.t)("vscode.git.branch_created_successfully"), }); }, ); this.showSuccess( - `Branch ${branchType.label}/${branchName} has been created and checked out!`, + (0, i18n_1.t)("vscode.git.new_branch_created", { + branchName: `${branchType.label}/${branchName}`, + }), ); } catch (error) { - this.showError(`Failed to create branch: ${error}`); + this.showError( + (0, i18n_1.t)("vscode.git.failed_create_branch", { + error: String(error), + }), + ); } } async finishBranch() { try { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError((0, i18n_1.t)("vscode.common.no_workspace_folder")); return; } // Get current branch name @@ -155,8 +185,10 @@ class GitCommand extends BaseCommand_1.BaseCommand { } } const confirm = await this.confirmAction( - `Are you sure you want to finish ${currentBranch}? This will merge it back to the base branch.`, - "Finish Branch", + (0, i18n_1.t)("vscode.git.are_you_sure_finish_branch", { + currentBranch, + }), + (0, i18n_1.t)("vscode.git.finish_branch"), ); if (!confirm) { return; @@ -164,24 +196,38 @@ class GitCommand extends BaseCommand_1.BaseCommand { vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: `Finishing branch: ${currentBranch}`, + title: (0, i18n_1.t)("vscode.git.finishing_branch", { + branchName: currentBranch, + }), cancellable: false, }, async (progress) => { - progress.report({ increment: 0, message: "Merging branch..." }); + progress.report({ + increment: 0, + message: (0, i18n_1.t)("vscode.git.pushing_branch"), + }); // Use StackCode CLI for git operations const command = `npx @stackcode/cli git finish`; - progress.report({ increment: 50, message: "Cleaning up..." }); + progress.report({ + increment: 50, + message: (0, i18n_1.t)("vscode.git.opening_pr"), + }); await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); progress.report({ increment: 100, - message: "Branch finished successfully!", + message: (0, i18n_1.t)("vscode.git.branch_finished_successfully"), }); }, ); - this.showSuccess(`Branch ${currentBranch} has been finished and merged!`); + this.showSuccess( + (0, i18n_1.t)("vscode.git.branch_has_been_finished", { currentBranch }), + ); } catch (error) { - this.showError(`Failed to finish branch: ${error}`); + this.showError( + (0, i18n_1.t)("vscode.git.failed_finish_branch", { + error: String(error), + }), + ); } } } diff --git a/packages/vscode-extension/out/commands/GitCommand.js.map b/packages/vscode-extension/out/commands/GitCommand.js.map index 18b4912..105a061 100644 --- a/packages/vscode-extension/out/commands/GitCommand.js.map +++ b/packages/vscode-extension/out/commands/GitCommand.js.map @@ -1 +1 @@ -{"version":3,"file":"GitCommand.js","sourceRoot":"","sources":["../../src/commands/GitCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,+CAA4C;AAG5C,MAAa,UAAW,SAAQ,yBAAW;IACzC,KAAK,CAAC,OAAO;QACX,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,CAC9C;YACE,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,4BAA4B,EAAE;YAC7D,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;SAC1D,EACD;YACE,WAAW,EAAE,mBAAmB;SACjC,CACF,CAAC;QAEF,IAAI,CAAC,MAAM,EAAE;YACX,OAAO;SACR;QAED,IAAI,MAAM,CAAC,KAAK,KAAK,OAAO,EAAE;YAC5B,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;SAC1B;aAAM,IAAI,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE;YACpC,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;SAC3B;IACH,CAAC;IAED,KAAK,CAAC,WAAW;QACf,IAAI;YACF,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;gBAClD,MAAM,EAAE,mCAAmC;gBAC3C,WAAW,EAAE,aAAa;gBAC1B,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;oBACvB,IAAI,CAAC,KAAK,EAAE;wBACV,OAAO,yBAAyB,CAAC;qBAClC;oBACD,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE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AAK,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,IAAA,QAAC,EAAC,iCAAiC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;SAChF;IACH,CAAC;CACF;AAjKD,gCAiKC"} \ No newline at end of file diff --git a/packages/vscode-extension/out/commands/InitCommand.js b/packages/vscode-extension/out/commands/InitCommand.js index 1e0020a..5cb9362 100644 --- a/packages/vscode-extension/out/commands/InitCommand.js +++ b/packages/vscode-extension/out/commands/InitCommand.js @@ -47,20 +47,21 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.InitCommand = void 0; const vscode = __importStar(require("vscode")); const BaseCommand_1 = require("./BaseCommand"); +const i18n_1 = require("@stackcode/i18n"); const path = __importStar(require("path")); class InitCommand extends BaseCommand_1.BaseCommand { async execute() { try { // Prompt for project details const projectName = await vscode.window.showInputBox({ - prompt: "Enter project name", - placeHolder: "my-awesome-project", + prompt: (0, i18n_1.t)("vscode.init.enter_project_name"), + placeHolder: (0, i18n_1.t)("vscode.init.my_awesome_project"), validateInput: (value) => { if (!value) { - return "Project name is required"; + return (0, i18n_1.t)("vscode.init.project_name_required"); } if (!/^[a-zA-Z0-9-_]+$/.test(value)) { - return "Project name can only contain letters, numbers, hyphens and underscores"; + return (0, i18n_1.t)("vscode.init.project_name_invalid"); } return null; }, @@ -69,27 +70,48 @@ class InitCommand extends BaseCommand_1.BaseCommand { return; } const description = await vscode.window.showInputBox({ - prompt: "Enter project description", - placeHolder: "A brief description of your project", + prompt: (0, i18n_1.t)("vscode.init.enter_project_description"), + placeHolder: (0, i18n_1.t)("vscode.init.brief_description"), }); const authorName = await vscode.window.showInputBox({ - prompt: "Enter author name", - placeHolder: "Your Name", + prompt: (0, i18n_1.t)("vscode.init.enter_author_name"), + placeHolder: (0, i18n_1.t)("vscode.init.your_name"), value: await this.getGitUserName(), }); const stack = await vscode.window.showQuickPick( [ - { label: "node-ts", description: "Node.js with TypeScript" }, - { label: "react", description: "React application" }, - { label: "vue", description: "Vue.js application" }, - { label: "angular", description: "Angular application" }, - { label: "python", description: "Python project" }, - { label: "java", description: "Java project" }, - { label: "go", description: "Go project" }, - { label: "php", description: "PHP project" }, + { + label: "node-ts", + description: (0, i18n_1.t)("vscode.init.stacks.node_ts"), + }, + { + label: "react", + description: (0, i18n_1.t)("vscode.init.stacks.react"), + }, + { + label: "vue", + description: (0, i18n_1.t)("vscode.init.stacks.vue"), + }, + { + label: "angular", + description: (0, i18n_1.t)("vscode.init.stacks.angular"), + }, + { + label: "python", + description: (0, i18n_1.t)("vscode.init.stacks.python"), + }, + { + label: "java", + description: (0, i18n_1.t)("vscode.init.stacks.java"), + }, + { label: "go", description: (0, i18n_1.t)("vscode.init.stacks.go") }, + { + label: "php", + description: (0, i18n_1.t)("vscode.init.stacks.php"), + }, ], { - placeHolder: "Select project stack", + placeHolder: (0, i18n_1.t)("vscode.init.select_project_stack"), }, ); if (!stack) { @@ -105,7 +127,7 @@ class InitCommand extends BaseCommand_1.BaseCommand { canSelectFolders: true, canSelectFiles: false, canSelectMany: false, - openLabel: "Select Project Location", + openLabel: (0, i18n_1.t)("vscode.init.select_project_location"), }); if (!folderUris || folderUris.length === 0) { return; @@ -116,8 +138,10 @@ class InitCommand extends BaseCommand_1.BaseCommand { try { await vscode.workspace.fs.stat(vscode.Uri.file(projectPath)); const overwrite = await this.confirmAction( - `Directory ${projectName} already exists. Do you want to overwrite it?`, - "Overwrite", + (0, i18n_1.t)("vscode.init.directory_exists_overwrite", { + projectName, + }), + (0, i18n_1.t)("vscode.init.overwrite"), ); if (!overwrite) { return; @@ -129,39 +153,49 @@ class InitCommand extends BaseCommand_1.BaseCommand { vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: `Initializing project ${projectName}`, + title: (0, i18n_1.t)("vscode.init.initializing_project", { + projectName, + }), cancellable: false, }, async (progress) => { progress.report({ increment: 0, - message: "Setting up project structure...", + message: (0, i18n_1.t)("vscode.init.setting_up_structure"), }); // Use StackCode CLI for initialization const command = `npx @stackcode/cli init --name="${projectName}" --description="${description}" --author="${authorName}" --stack="${stack.label}" --path="${projectPath}"`; progress.report({ increment: 50, - message: "Running StackCode CLI...", + message: (0, i18n_1.t)("vscode.init.running_stackcode_cli"), }); await this.runTerminalCommand(command); progress.report({ increment: 100, - message: "Project initialized successfully!", + message: (0, i18n_1.t)( + "vscode.init.project_initialized_successfully", + ), }); }, ); // Ask if user wants to open the new project const openProject = await vscode.window.showInformationMessage( - `Project ${projectName} has been created successfully! Would you like to open it?`, - "Open Project", - "Later", + (0, i18n_1.t)("vscode.init.project_created_successfully", { + projectName, + }), + (0, i18n_1.t)("vscode.init.open_project"), + (0, i18n_1.t)("vscode.init.later"), ); - if (openProject === "Open Project") { + if (openProject === (0, i18n_1.t)("vscode.init.open_project")) { const uri = vscode.Uri.file(projectPath); await vscode.commands.executeCommand("vscode.openFolder", uri, true); } } catch (error) { - this.showError(`Failed to initialize project: ${error}`); + this.showError( + (0, i18n_1.t)("vscode.init.failed_initialize_project", { + error: String(error), + }), + ); } } async getGitUserName() { diff --git a/packages/vscode-extension/out/commands/InitCommand.js.map b/packages/vscode-extension/out/commands/InitCommand.js.map index 889e1ce..d9f00a7 100644 --- a/packages/vscode-extension/out/commands/InitCommand.js.map +++ b/packages/vscode-extension/out/commands/InitCommand.js.map @@ -1 +1 @@ -{"version":3,"file":"InitCommand.js","sourceRoot":"","sources":["../../src/commands/InitCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,+CAA4C;AAE5C,2CAA6B;AAE7B,MAAa,WAAY,SAAQ,yBAAW;IAC1C,KAAK,CAAC,OAAO;QACX,IAAI;YACF,6BAA6B;YAC7B,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;gBACnD,MAAM,EAAE,oBAAoB;gBAC5B,WAAW,EAAE,oBAAoB;gBACjC,aAAa,EAAE,CAAC,KAAa,EA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,CAAC;SACX;QAAC,MAAM;YACN,OAAO,EAAE,CAAC;SACX;IACH,CAAC;CACF;AAjJD,kCAiJC"} \ No newline at end of file +{"version":3,"file":"InitCommand.js","sourceRoot":"","sources":["../../src/commands/InitCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,+CAA4C;AAE5C,0CAAoC;AACpC,2CAA6B;AAE7B,MAAa,WAAY,SAAQ,yBAAW;IAC1C,KAAK,CAAC,OAAO;QACX,IAAI;YACF,6BAA6B;YAC7B,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;gBACnD,MAAM,EAAE,IAAA,QAAC,EAAC,gCAAgC,CAAC;gBAC3C,WAAW,EAAE,IAAA,QAAC,EAAC,gCAAgC,CAAC;gBAChD,aAAa,EAAE,CAAC,KAAa,EAAE,EAAE;oBAC/B,IAAI,CAAC,KAAK,EAAE;wBACV,OAAO,IAAA,QAAC,EAAC,mCAAmC,CAAC,CAAC;qBAC/C;oBACD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;wBACnC,OAAO,IAAA,QAAC,EAAC,kCAAkC,CAAC,CAAC;qBAC9C;oBACD,OAAO,IAAI,CAAC;gBACd,CAAC;aACF,CAAC,CAAC;YAEH,IAAI,CAAC,WAAW,EAAE;gBAChB,OAAO;aACR;YAED,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;gBACnD,MAAM,EAAE,IAAA,QAAC,EAAC,uCAAuC,CAAC;gBAClD,WAAW,EAAE,IAAA,QAAC,EAAC,+BAA+B,CAAC;aAChD,CAAC,CAAC;YAEH,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;gBAClD,MAAM,EAAE,IAAA,QAAC,EAAC,+BAA+B,CAAC;gBAC1C,WAAW,EAAE,IAAA,QAAC,EAAC,uBAAuB,CAAC;gBACv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,CAAC,CAAC;YAC1C,QAAQ,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO,EAAE,CAAC;SACX;QAAC,MAAM;YACN,OAAO,EAAE,CAAC;SACX;IACH,CAAC;CACF;AAjJD,kCAiJC"} \ No newline at end of file diff --git a/packages/vscode-extension/out/commands/ReleaseCommand.js b/packages/vscode-extension/out/commands/ReleaseCommand.js index c7db3a4..44db95f 100644 --- a/packages/vscode-extension/out/commands/ReleaseCommand.js +++ b/packages/vscode-extension/out/commands/ReleaseCommand.js @@ -47,17 +47,18 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.ReleaseCommand = void 0; const vscode = __importStar(require("vscode")); const BaseCommand_1 = require("./BaseCommand"); +const i18n_1 = require("@stackcode/i18n"); class ReleaseCommand extends BaseCommand_1.BaseCommand { async execute() { try { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError((0, i18n_1.t)("vscode.common.no_workspace_folder")); return; } const confirm = await this.confirmAction( - "Are you sure you want to create a new release? This will tag the current commit and publish the release.", - "Create Release", + (0, i18n_1.t)("vscode.release.are_you_sure_create_release"), + (0, i18n_1.t)("vscode.release.create_release"), ); if (!confirm) { return; @@ -65,21 +66,34 @@ class ReleaseCommand extends BaseCommand_1.BaseCommand { vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: "Creating release", + title: (0, i18n_1.t)("vscode.release.creating_release"), cancellable: false, }, async (progress) => { - progress.report({ increment: 0, message: "Preparing release..." }); + progress.report({ + increment: 0, + message: (0, i18n_1.t)("vscode.release.preparing_release"), + }); // Use StackCode CLI for release const command = `npx @stackcode/cli release`; - progress.report({ increment: 50, message: "Creating release..." }); + progress.report({ + increment: 50, + message: (0, i18n_1.t)("vscode.release.creating_release_message"), + }); await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); - progress.report({ increment: 100, message: "Release created!" }); + progress.report({ + increment: 100, + message: (0, i18n_1.t)("vscode.release.release_created"), + }); }, ); - this.showSuccess("Release process started! Check terminal for progress."); + this.showSuccess((0, i18n_1.t)("vscode.release.release_process_started")); } catch (error) { - this.showError(`Failed to create release: ${error}`); + this.showError( + (0, i18n_1.t)("vscode.release.failed_create_release", { + error: String(error), + }), + ); } } } diff --git a/packages/vscode-extension/out/commands/ReleaseCommand.js.map b/packages/vscode-extension/out/commands/ReleaseCommand.js.map index 26882c5..6087758 100644 --- a/packages/vscode-extension/out/commands/ReleaseCommand.js.map +++ b/packages/vscode-extension/out/commands/ReleaseCommand.js.map @@ -1 +1 @@ -{"version":3,"file":"ReleaseCommand.js","sourceRoot":"","sources":["../../src/commands/ReleaseCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,+CAA4C;AAG5C,MAAa,cAAe,SAAQ,yBAAW;IAC7C,KAAK,CAAC,OAAO;QACX,IAAI;YACF,MAAM,eAAe,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAC;YACzD,IAAI,CAAC,eAAe,EAAE;gBACpB,IAAI,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC;gBAC5C,OAAO;aACR;YAED,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CACtC,0GAA0G,EAC1G,gBAAgB,CACjB,CAAC;YAEF,IAAI,CAAC,OAAO,EAAE;gBACZ,OAAO;aACR;YAED,MAAM,CAAC,MAAM,CAAC,YAAY,CACxB;gBACE,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,YAAY;gBAC9C,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EAAE,KAAK;aACnB,EACD,KAAK,EAAE,QAA0B,EAAE,EAAE;gBACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC,CAAC;gBAEnE,gCAAgC;gBAChC,MAAM,OAAO,GAAG,4BAA4B,CAAC;gBAE7C,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC,CAAC;gBAEnE,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBAEnE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC,CAAC;YACnE,CAAC,CACF,CAAC;YAEF,IAAI,CAAC,WAAW,CAAC,uDAAuD,CAAC,CAAC;SAC3E;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,6BAA6B,KAAK,EAAE,CAAC,CAAC;SACtD;IACH,CAAC;CACF;AA3CD,wCA2CC"} \ No newline at end of file +{"version":3,"file":"ReleaseCommand.js","sourceRoot":"","sources":["../../src/commands/ReleaseCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,+CAA4C;AAE5C,0CAAoC;AAEpC,MAAa,cAAe,SAAQ,yBAAW;IAC7C,KAAK,CAAC,OAAO;QACX,IAAI;YACF,MAAM,eAAe,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAC;YACzD,IAAI,CAAC,eAAe,EAAE;gBACpB,IAAI,CAAC,SAAS,CAAC,IAAA,QAAC,EAAC,mCAAmC,CAAC,CAAC,CAAC;gBACvD,OAAO;aACR;YAED,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CACtC,IAAA,QAAC,EAAC,4CAA4C,CAAC,EAC/C,IAAA,QAAC,EAAC,+BAA+B,CAAC,CACnC,CAAC;YAEF,IAAI,CAAC,OAAO,EAAE;gBACZ,OAAO;aACR;YAED,MAAM,CAAC,MAAM,CAAC,YAAY,CACxB;gBACE,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,YAAY;gBAC9C,KAAK,EAAE,IAAA,QAAC,EAAC,iCAAiC,CAAC;gBAC3C,WAAW,EAAE,KAAK;aACnB,EACD,KAAK,EAAE,QAA0B,EAAE,EAAE;gBACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,IAAA,QAAC,EAAC,kCAAkC,CAAC,EAAE,CAAC,CAAC;gBAElF,gCAAgC;gBAChC,MAAM,OAAO,GAAG,4BAA4B,CAAC;gBAE7C,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,IAAA,QAAC,EAAC,yCAAyC,CAAC,EAAE,CAAC,CAAC;gBAE1F,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBAEnE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,IAAA,QAAC,EAAC,gCAAgC,CAAC,EAAE,CAAC,CAAC;YACpF,CAAC,CACF,CAAC;YAEF,IAAI,CAAC,WAAW,CAAC,IAAA,QAAC,EAAC,wCAAwC,CAAC,CAAC,CAAC;SAC/D;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,IAAA,QAAC,EAAC,sCAAsC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;SACrF;IACH,CAAC;CACF;AA3CD,wCA2CC"} \ No newline at end of file diff --git a/packages/vscode-extension/out/commands/ValidateCommand.js b/packages/vscode-extension/out/commands/ValidateCommand.js index d43f509..34ff650 100644 --- a/packages/vscode-extension/out/commands/ValidateCommand.js +++ b/packages/vscode-extension/out/commands/ValidateCommand.js @@ -47,37 +47,50 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.ValidateCommand = void 0; const vscode = __importStar(require("vscode")); const BaseCommand_1 = require("./BaseCommand"); +const i18n_1 = require("@stackcode/i18n"); class ValidateCommand extends BaseCommand_1.BaseCommand { async execute() { try { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError((0, i18n_1.t)("vscode.common.no_workspace_folder")); return; } vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: "Validating project structure", + title: (0, i18n_1.t)("vscode.validate.validating_project_structure"), cancellable: false, }, async (progress) => { - progress.report({ increment: 0, message: "Running validation..." }); + progress.report({ + increment: 0, + message: (0, i18n_1.t)("vscode.validate.running_validation"), + }); // Use StackCode CLI for validation const command = `npx @stackcode/cli validate`; progress.report({ increment: 50, - message: "Checking project structure...", + message: (0, i18n_1.t)( + "vscode.validate.checking_project_structure", + ), }); await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); - progress.report({ increment: 100, message: "Validation completed!" }); + progress.report({ + increment: 100, + message: (0, i18n_1.t)("vscode.validate.validation_completed"), + }); }, ); this.showSuccess( - "Project validation completed! Check terminal for results.", + (0, i18n_1.t)("vscode.validate.project_validation_completed"), ); } catch (error) { - this.showError(`Failed to validate project: ${error}`); + this.showError( + (0, i18n_1.t)("vscode.validate.failed_validate_project", { + error: String(error), + }), + ); } } } diff --git a/packages/vscode-extension/out/commands/ValidateCommand.js.map b/packages/vscode-extension/out/commands/ValidateCommand.js.map index b6ca678..ebdbd33 100644 --- a/packages/vscode-extension/out/commands/ValidateCommand.js.map +++ b/packages/vscode-extension/out/commands/ValidateCommand.js.map @@ -1 +1 @@ -{"version":3,"file":"ValidateCommand.js","sourceRoot":"","sources":["../../src/commands/ValidateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,+CAA4C;AAG5C,MAAa,eAAgB,SAAQ,yBAAW;IAC9C,KAAK,CAAC,OAAO;QACX,IAAI;YACF,MAAM,eAAe,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAC;YACzD,IAAI,CAAC,eAAe,EAAE;gBACpB,IAAI,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC;gBAC5C,OAAO;aACR;YAED,MAAM,CAAC,MAAM,CAAC,YAAY,CACxB;gBACE,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,YAAY;gBAC9C,KAAK,EAAE,8BAA8B;gBACrC,WAAW,EAAE,KAAK;aACnB,EACD,KAAK,EAAE,QAA0B,EAAE,EAAE;gBACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC,CAAC;gBAEpE,mCAAmC;gBACnC,MAAM,OAAO,GAAG,6BAA6B,CAAC;gBAE9C,QAAQ,CAAC,MAAM,CAAC;oBACd,SAAS,EAAE,EAAE;oBACb,OAAO,EAAE,+BAA+B;iBACzC,CAAC,CAAC;gBAEH,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBAEnE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC,CAAC;YACxE,CAAC,CACF,CAAC;YAEF,IAAI,CAAC,WAAW,CACd,2DAA2D,CAC5D,CAAC;SACH;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,+BAA+B,KAAK,EAAE,CAAC,CAAC;SACxD;IACH,CAAC;CACF;AAvCD,0CAuCC"} \ No newline at end of file +{"version":3,"file":"ValidateCommand.js","sourceRoot":"","sources":["../../src/commands/ValidateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,+CAA4C;AAE5C,0CAAoC;AAEpC,MAAa,eAAgB,SAAQ,yBAAW;IAC9C,KAAK,CAAC,OAAO;QACX,IAAI;YACF,MAAM,eAAe,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAC;YACzD,IAAI,CAAC,eAAe,EAAE;gBACpB,IAAI,CAAC,SAAS,CAAC,IAAA,QAAC,EAAC,mCAAmC,CAAC,CAAC,CAAC;gBACvD,OAAO;aACR;YAED,MAAM,CAAC,MAAM,CAAC,YAAY,CACxB;gBACE,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,YAAY;gBAC9C,KAAK,EAAE,IAAA,QAAC,EAAC,8CAA8C,CAAC;gBACxD,WAAW,EAAE,KAAK;aACnB,EACD,KAAK,EAAE,QAA0B,EAAE,EAAE;gBACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,IAAA,QAAC,EAAC,oCAAoC,CAAC,EAAE,CAAC,CAAC;gBAEpF,mCAAmC;gBACnC,MAAM,OAAO,GAAG,6BAA6B,CAAC;gBAE9C,QAAQ,CAAC,MAAM,CAAC;oBACd,SAAS,EAAE,EAAE;oBACb,OAAO,EAAE,IAAA,QAAC,EAAC,4CAA4C,CAAC;iBACzD,CAAC,CAAC;gBAEH,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBAEnE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,IAAA,QAAC,EAAC,sCAAsC,CAAC,EAAE,CAAC,CAAC;YAC1F,CAAC,CACF,CAAC;YAEF,IAAI,CAAC,WAAW,CACd,IAAA,QAAC,EAAC,8CAA8C,CAAC,CAClD,CAAC;SACH;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,IAAA,QAAC,EAAC,yCAAyC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;SACxF;IACH,CAAC;CACF;AAvCD,0CAuCC"} \ No newline at end of file diff --git a/packages/vscode-extension/out/monitors/FileMonitor.js b/packages/vscode-extension/out/monitors/FileMonitor.js index 755dc0b..1d152b2 100644 --- a/packages/vscode-extension/out/monitors/FileMonitor.js +++ b/packages/vscode-extension/out/monitors/FileMonitor.js @@ -46,6 +46,7 @@ var __importStar = Object.defineProperty(exports, "__esModule", { value: true }); exports.FileMonitor = void 0; const vscode = __importStar(require("vscode")); +const i18n_1 = require("@stackcode/i18n"); class FileMonitor { constructor(proactiveManager, configManager) { this.disposables = []; @@ -141,19 +142,21 @@ class FileMonitor { } if (missingFiles.length > 0 && Math.random() < 0.3) { // Show suggestion 30% of the time - const message = `📁 Your project is missing some important files: ${missingFiles.join(", ")}. Would you like to generate them?`; + const message = (0, i18n_1.t)("vscode.common.project_missing_files", { + missingFiles: missingFiles.join(", "), + }); const action = await vscode.window.showInformationMessage( message, - "Generate Files", - "Not Now", - "Don't Show Again", + (0, i18n_1.t)("vscode.common.generate_files"), + (0, i18n_1.t)("vscode.common.not_now"), + (0, i18n_1.t)("vscode.common.dont_show_again"), ); - if (action === "Generate Files") { + if (action === (0, i18n_1.t)("vscode.common.generate_files")) { // TODO: Implement file generation vscode.window.showInformationMessage( - "File generation will be available soon!", + (0, i18n_1.t)("vscode.common.file_generation_available_soon"), ); - } else if (action === "Don't Show Again") { + } else if (action === (0, i18n_1.t)("vscode.common.dont_show_again")) { await this.configManager.updateConfiguration( "notifications.enabled", false, @@ -163,7 +166,11 @@ class FileMonitor { } catch (error) { // Use proper VS Code logging instead of console.log const outputChannel = vscode.window.createOutputChannel("StackCode"); - outputChannel.appendLine(`Error checking project structure: ${error}`); + outputChannel.appendLine( + (0, i18n_1.t)("vscode.common.error_checking_project_structure", { + error: String(error), + }), + ); } } dispose() { diff --git a/packages/vscode-extension/out/monitors/FileMonitor.js.map b/packages/vscode-extension/out/monitors/FileMonitor.js.map index acfb96c..69bcb2f 100644 --- a/packages/vscode-extension/out/monitors/FileMonitor.js.map +++ b/packages/vscode-extension/out/monitors/FileMonitor.js.map @@ -1 +1 @@ -{"version":3,"file":"FileMonitor.js","sourceRoot":"","sources":["../../src/monitors/FileMonitor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAIjC,MAAa,WAAW;IAMtB,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AAC;iBACH;qBAAM,IAAI,MAAM,KAAK,kBAAkB,EAAE;oBACxC,MAAM,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAC1C,uBAAuB,EACvB,KAAK,CACN,CAAC;iBACH;aACF;SACF;QAAC,OAAO,KAAK,EAAE;YACd,oDAAoD;YACpD,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;YACrE,aAAa,CAAC,UAAU,CAAC,qCAAqC,KAAK,EAAE,CAAC,CAAC;SACxE;IACH,CAAC;IAED,OAAO;QACL,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7C,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;CACF;AAlKD,kCAkKC"} \ No newline at end of file +{"version":3,"file":"FileMonitor.js","sourceRoot":"","sources":["../../src/monitors/FileMonitor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAGjC,0CAAoC;AAEpC,MAAa,WAAW;IAMtB,YACE,gBAA8C,EAC9C,aAAmC;QAL7B,gBAAW,GAAwB,EAAE,CAAC;QACtC,mBAAc,GAAgB,IAAI,GAAG,EAAE,CAAC;QAM9C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED,eAAe;QACb,wBAAwB;QACxB,IAAI,CAAC,WAAW,CAAC,IAAI,CACnB,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,KAA6B,EAAE,EAAE;YAClE,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE;gBAC9B,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;aAC/B;QACH,CAAC,CAA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,aAAa,CAAC,UAAU,CAAC,IAAA,QAAC,EAAC,gDAAgD,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;SACzG;IACH,CAAC;IAED,OAAO;QACL,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAoB,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAChE,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;CACF;AAlKD,kCAkKC"} \ No newline at end of file diff --git a/packages/vscode-extension/src/commands/CommitCommand.ts b/packages/vscode-extension/src/commands/CommitCommand.ts index 63c0154..f236a27 100644 --- a/packages/vscode-extension/src/commands/CommitCommand.ts +++ b/packages/vscode-extension/src/commands/CommitCommand.ts @@ -1,11 +1,12 @@ import { BaseCommand } from "./BaseCommand"; +import { t } from "@stackcode/i18n"; export class CommitCommand extends BaseCommand { async execute(): Promise { try { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError(t("vscode.common.no_workspace_folder")); return; } @@ -14,9 +15,11 @@ export class CommitCommand extends BaseCommand { await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); - this.showSuccess("Commit dialog opened in terminal!"); + this.showSuccess(t("vscode.commit.commit_dialog_opened")); } catch (error) { - this.showError(`Failed to open commit dialog: ${error}`); + this.showError( + t("vscode.commit.failed_open_commit_dialog", { error: String(error) }), + ); } } } diff --git a/packages/vscode-extension/src/commands/ConfigCommand.ts b/packages/vscode-extension/src/commands/ConfigCommand.ts index ba1a10e..226ca67 100644 --- a/packages/vscode-extension/src/commands/ConfigCommand.ts +++ b/packages/vscode-extension/src/commands/ConfigCommand.ts @@ -1,32 +1,33 @@ import * as vscode from "vscode"; import { BaseCommand } from "./BaseCommand"; +import { t } from "@stackcode/i18n"; export class ConfigCommand extends BaseCommand { async execute(): Promise { try { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError(t("vscode.common.no_workspace_folder")); return; } const action = await vscode.window.showQuickPick( [ { - label: "Open StackCode Settings", - description: "Configure StackCode extension settings", + label: t("vscode.config.open_stackcode_settings"), + description: t("vscode.config.open_stackcode_settings_description"), }, { - label: "Open Project Config", - description: "Edit .stackcoderc.json file", + label: t("vscode.config.open_project_config"), + description: t("vscode.config.open_project_config_description"), }, { - label: "Create Project Config", - description: "Create a new .stackcoderc.json file", + label: t("vscode.config.create_project_config"), + description: t("vscode.config.create_project_config_description"), }, ], { - placeHolder: "What would you like to configure?", + placeHolder: t("vscode.config.what_would_you_like_configure"), }, ); @@ -34,12 +35,12 @@ export class ConfigCommand extends BaseCommand { return; } - if (action.label === "Open StackCode Settings") { + if (action.label === t("vscode.config.open_stackcode_settings")) { vscode.commands.executeCommand( "workbench.action.openSettings", "stackcode", ); - } else if (action.label === "Open Project Config") { + } else if (action.label === t("vscode.config.open_project_config")) { const configPath = vscode.Uri.joinPath( workspaceFolder.uri, ".stackcoderc.json", @@ -48,18 +49,18 @@ export class ConfigCommand extends BaseCommand { const document = await vscode.workspace.openTextDocument(configPath); await vscode.window.showTextDocument(document); } catch { - this.showError( - '.stackcoderc.json file not found. Use "Create Project Config" to create one.', - ); + this.showError(t("vscode.config.stackcoderc_not_found")); } - } else if (action.label === "Create Project Config") { + } else if (action.label === t("vscode.config.create_project_config")) { // Use StackCode CLI for config creation const command = `npx @stackcode/cli config init`; await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); - this.showSuccess("Project configuration initialized!"); + this.showSuccess(t("vscode.config.project_configuration_initialized")); } } catch (error) { - this.showError(`Failed to open configuration: ${error}`); + this.showError( + t("vscode.config.failed_open_configuration", { error: String(error) }), + ); } } } diff --git a/packages/vscode-extension/src/commands/GenerateCommand.ts b/packages/vscode-extension/src/commands/GenerateCommand.ts index fa074e8..56ebc8d 100644 --- a/packages/vscode-extension/src/commands/GenerateCommand.ts +++ b/packages/vscode-extension/src/commands/GenerateCommand.ts @@ -1,6 +1,7 @@ import * as vscode from "vscode"; import { BaseCommand } from "./BaseCommand"; import { ProgressCallback } from "../types"; +import { t } from "@stackcode/i18n"; import * as path from "path"; export class GenerateCommand extends BaseCommand { @@ -9,19 +10,19 @@ export class GenerateCommand extends BaseCommand { [ { label: "README.md", - description: "Generate a comprehensive README file", + description: t("vscode.generate.readme_description"), }, { label: ".gitignore", - description: "Generate a .gitignore file based on project type", + description: t("vscode.generate.gitignore_description"), }, { - label: "Both", - description: "Generate both README.md and .gitignore", + label: t("vscode.generate.both"), + description: t("vscode.generate.both_description"), }, ], { - placeHolder: "What would you like to generate?", + placeHolder: t("vscode.generate.what_would_you_like_generate"), }, ); @@ -33,7 +34,7 @@ export class GenerateCommand extends BaseCommand { await this.generateReadme(); } else if (option.label === ".gitignore") { await this.generateGitignore(); - } else if (option.label === "Both") { + } else if (option.label === t("vscode.generate.both")) { await this.generateReadme(); await this.generateGitignore(); } @@ -43,7 +44,7 @@ export class GenerateCommand extends BaseCommand { try { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError(t("vscode.common.no_workspace_folder")); return; } @@ -53,8 +54,8 @@ export class GenerateCommand extends BaseCommand { try { await vscode.workspace.fs.stat(vscode.Uri.file(readmePath)); const overwrite = await this.confirmAction( - "README.md already exists. Do you want to overwrite it?", - "Overwrite", + t("vscode.generate.readme_exists_overwrite"), + t("vscode.generate.overwrite"), ); if (!overwrite) { return; @@ -66,43 +67,48 @@ export class GenerateCommand extends BaseCommand { vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: "Generating README.md", + title: t("vscode.generate.generating_readme"), cancellable: false, }, async (progress: ProgressCallback) => { progress.report({ increment: 0, - message: "Analyzing project structure...", + message: t("vscode.generate.setting_up_readme"), }); // Use StackCode CLI for generation const command = `npx @stackcode/cli generate readme`; - progress.report({ increment: 50, message: "Generating content..." }); + progress.report({ + increment: 50, + message: t("vscode.generate.running_generator"), + }); await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); progress.report({ increment: 100, - message: "README.md generated successfully!", + message: t("vscode.generate.readme_created"), }); }, ); - this.showSuccess("README.md has been generated successfully!"); + this.showSuccess(t("vscode.generate.readme_has_been_generated")); // Ask if user wants to open the file const openFile = await vscode.window.showInformationMessage( - "Would you like to open the generated README.md?", - "Open File", + t("vscode.generate.would_you_like_open_readme"), + t("vscode.generate.open_file"), ); - if (openFile === "Open File") { + if (openFile === t("vscode.generate.open_file")) { const document = await vscode.workspace.openTextDocument(readmePath); await vscode.window.showTextDocument(document); } } catch (error) { - this.showError(`Failed to generate README.md: ${error}`); + this.showError( + t("vscode.generate.failed_generate_readme", { error: String(error) }), + ); } } @@ -110,7 +116,7 @@ export class GenerateCommand extends BaseCommand { try { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError(t("vscode.common.no_workspace_folder")); return; } @@ -120,8 +126,8 @@ export class GenerateCommand extends BaseCommand { try { await vscode.workspace.fs.stat(vscode.Uri.file(gitignorePath)); const overwrite = await this.confirmAction( - ".gitignore already exists. Do you want to overwrite it?", - "Overwrite", + t("vscode.generate.gitignore_exists_overwrite"), + t("vscode.generate.overwrite"), ); if (!overwrite) { return; @@ -133,20 +139,26 @@ export class GenerateCommand extends BaseCommand { // Ask for project type const projectType = await vscode.window.showQuickPick( [ - { label: "node-ts", description: "Node.js with TypeScript" }, - { label: "react", description: "React application" }, - { label: "vue", description: "Vue.js application" }, - { label: "angular", description: "Angular application" }, - { label: "python", description: "Python project" }, - { label: "java", description: "Java project" }, - { label: "go", description: "Go project" }, - { label: "php", description: "PHP project" }, - { label: "flutter", description: "Flutter project" }, - { label: "swift", description: "Swift project" }, - { label: "android", description: "Android project" }, + { label: "node-ts", description: t("vscode.init.stacks.node_ts") }, + { label: "react", description: t("vscode.init.stacks.react") }, + { label: "vue", description: t("vscode.init.stacks.vue") }, + { label: "angular", description: t("vscode.init.stacks.angular") }, + { label: "python", description: t("vscode.init.stacks.python") }, + { label: "java", description: t("vscode.init.stacks.java") }, + { label: "go", description: t("vscode.init.stacks.go") }, + { label: "php", description: t("vscode.init.stacks.php") }, + { + label: "flutter", + description: t("vscode.generate.stacks.flutter"), + }, + { label: "swift", description: t("vscode.generate.stacks.swift") }, + { + label: "android", + description: t("vscode.generate.stacks.android"), + }, ], { - placeHolder: "Select project type for .gitignore", + placeHolder: t("vscode.generate.select_project_type_gitignore"), }, ); @@ -157,43 +169,50 @@ export class GenerateCommand extends BaseCommand { vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: "Generating .gitignore", + title: t("vscode.generate.generating_gitignore"), cancellable: false, }, async (progress: ProgressCallback) => { progress.report({ increment: 0, - message: "Generating .gitignore content...", + message: t("vscode.generate.setting_up_gitignore"), }); // Use StackCode CLI for generation const command = `npx @stackcode/cli generate gitignore --type="${projectType.label}"`; - progress.report({ increment: 50, message: "Creating file..." }); + progress.report({ + increment: 50, + message: t("vscode.generate.running_generator"), + }); await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); progress.report({ increment: 100, - message: ".gitignore generated successfully!", + message: t("vscode.generate.gitignore_created"), }); }, ); - this.showSuccess(".gitignore has been generated successfully!"); + this.showSuccess(t("vscode.generate.gitignore_has_been_generated")); // Ask if user wants to open the file const openFile = await vscode.window.showInformationMessage( - "Would you like to open the generated .gitignore?", - "Open File", + t("vscode.generate.would_you_like_open_gitignore"), + t("vscode.generate.open_file"), ); - if (openFile === "Open File") { + if (openFile === t("vscode.generate.open_file")) { const document = await vscode.workspace.openTextDocument(gitignorePath); await vscode.window.showTextDocument(document); } } catch (error) { - this.showError(`Failed to generate .gitignore: ${error}`); + this.showError( + t("vscode.generate.failed_generate_gitignore", { + error: String(error), + }), + ); } } } diff --git a/packages/vscode-extension/src/commands/GitCommand.ts b/packages/vscode-extension/src/commands/GitCommand.ts index ce8cecc..8b6eb18 100644 --- a/packages/vscode-extension/src/commands/GitCommand.ts +++ b/packages/vscode-extension/src/commands/GitCommand.ts @@ -1,16 +1,17 @@ import * as vscode from "vscode"; import { BaseCommand } from "./BaseCommand"; import { ProgressCallback } from "../types"; +import { t } from "@stackcode/i18n"; export class GitCommand extends BaseCommand { async execute(): Promise { const action = await vscode.window.showQuickPick( [ - { label: "start", description: "Start a new feature branch" }, - { label: "finish", description: "Finish current branch" }, + { label: "start", description: t("vscode.git.start_description") }, + { label: "finish", description: t("vscode.git.finish_description") }, ], { - placeHolder: "Select Git action", + placeHolder: t("vscode.git.select_git_action"), }, ); @@ -28,14 +29,14 @@ export class GitCommand extends BaseCommand { async startBranch(): Promise { try { const branchName = await vscode.window.showInputBox({ - prompt: "Enter the name for the new branch", - placeHolder: "new-feature", - validateInput: (value) => { + prompt: t("vscode.git.enter_branch_name"), + placeHolder: t("vscode.git.new_feature"), + validateInput: (value: string) => { if (!value) { - return "Branch name is required"; + return t("vscode.git.branch_name_required"); } if (!/^[a-zA-Z0-9/_-]+$/.test(value)) { - return "Branch name can only contain letters, numbers, hyphens, underscores and slashes"; + return t("vscode.git.branch_name_invalid"); } return null; }, @@ -47,13 +48,16 @@ export class GitCommand extends BaseCommand { const branchType = await vscode.window.showQuickPick( [ - { label: "feature", description: "A new feature branch" }, - { label: "bugfix", description: "A bug fix branch" }, - { label: "hotfix", description: "A hotfix branch" }, - { label: "release", description: "A release branch" }, + { + label: "feature", + description: t("vscode.git.feature_description"), + }, + { label: "bugfix", description: t("vscode.git.bugfix_description") }, + { label: "hotfix", description: t("vscode.git.hotfix_description") }, + { label: "chore", description: t("vscode.git.chore_description") }, ], { - placeHolder: "Select branch type", + placeHolder: t("vscode.git.select_branch_type"), }, ); @@ -63,41 +67,50 @@ export class GitCommand extends BaseCommand { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError(t("vscode.common.no_workspace_folder")); return; } vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: `Creating ${branchType.label} branch: ${branchName}`, + title: t("vscode.git.creating_branch", { + branchName: `${branchType.label}/${branchName}`, + }), cancellable: false, }, async (progress: ProgressCallback) => { - progress.report({ increment: 0, message: "Creating branch..." }); + progress.report({ + increment: 0, + message: t("vscode.git.switching_to_develop"), + }); // Use StackCode CLI for git operations const command = `npx @stackcode/cli git start ${branchName} --type=${branchType.label}`; progress.report({ increment: 50, - message: "Switching to new branch...", + message: t("vscode.git.creating_new_branch"), }); await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); progress.report({ increment: 100, - message: "Branch created successfully!", + message: t("vscode.git.branch_created_successfully"), }); }, ); this.showSuccess( - `Branch ${branchType.label}/${branchName} has been created and checked out!`, + t("vscode.git.new_branch_created", { + branchName: `${branchType.label}/${branchName}`, + }), ); } catch (error) { - this.showError(`Failed to create branch: ${error}`); + this.showError( + t("vscode.git.failed_create_branch", { error: String(error) }), + ); } } @@ -105,7 +118,7 @@ export class GitCommand extends BaseCommand { try { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError(t("vscode.common.no_workspace_folder")); return; } @@ -127,8 +140,8 @@ export class GitCommand extends BaseCommand { } const confirm = await this.confirmAction( - `Are you sure you want to finish ${currentBranch}? This will merge it back to the base branch.`, - "Finish Branch", + t("vscode.git.are_you_sure_finish_branch", { currentBranch }), + t("vscode.git.finish_branch"), ); if (!confirm) { @@ -138,29 +151,41 @@ export class GitCommand extends BaseCommand { vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: `Finishing branch: ${currentBranch}`, + title: t("vscode.git.finishing_branch", { + branchName: currentBranch, + }), cancellable: false, }, async (progress: ProgressCallback) => { - progress.report({ increment: 0, message: "Merging branch..." }); + progress.report({ + increment: 0, + message: t("vscode.git.pushing_branch"), + }); // Use StackCode CLI for git operations const command = `npx @stackcode/cli git finish`; - progress.report({ increment: 50, message: "Cleaning up..." }); + progress.report({ + increment: 50, + message: t("vscode.git.opening_pr"), + }); await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); progress.report({ increment: 100, - message: "Branch finished successfully!", + message: t("vscode.git.branch_finished_successfully"), }); }, ); - this.showSuccess(`Branch ${currentBranch} has been finished and merged!`); + this.showSuccess( + t("vscode.git.branch_has_been_finished", { currentBranch }), + ); } catch (error) { - this.showError(`Failed to finish branch: ${error}`); + this.showError( + t("vscode.git.failed_finish_branch", { error: String(error) }), + ); } } } diff --git a/packages/vscode-extension/src/commands/InitCommand.ts b/packages/vscode-extension/src/commands/InitCommand.ts index 9eef63a..6af1186 100644 --- a/packages/vscode-extension/src/commands/InitCommand.ts +++ b/packages/vscode-extension/src/commands/InitCommand.ts @@ -1,6 +1,7 @@ import * as vscode from "vscode"; import { BaseCommand } from "./BaseCommand"; import { ProgressCallback } from "../types"; +import { t } from "@stackcode/i18n"; import * as path from "path"; export class InitCommand extends BaseCommand { @@ -8,14 +9,14 @@ export class InitCommand extends BaseCommand { try { // Prompt for project details const projectName = await vscode.window.showInputBox({ - prompt: "Enter project name", - placeHolder: "my-awesome-project", + prompt: t("vscode.init.enter_project_name"), + placeHolder: t("vscode.init.my_awesome_project"), validateInput: (value: string) => { if (!value) { - return "Project name is required"; + return t("vscode.init.project_name_required"); } if (!/^[a-zA-Z0-9-_]+$/.test(value)) { - return "Project name can only contain letters, numbers, hyphens and underscores"; + return t("vscode.init.project_name_invalid"); } return null; }, @@ -26,29 +27,29 @@ export class InitCommand extends BaseCommand { } const description = await vscode.window.showInputBox({ - prompt: "Enter project description", - placeHolder: "A brief description of your project", + prompt: t("vscode.init.enter_project_description"), + placeHolder: t("vscode.init.brief_description"), }); const authorName = await vscode.window.showInputBox({ - prompt: "Enter author name", - placeHolder: "Your Name", + prompt: t("vscode.init.enter_author_name"), + placeHolder: t("vscode.init.your_name"), value: await this.getGitUserName(), }); const stack = await vscode.window.showQuickPick( [ - { label: "node-ts", description: "Node.js with TypeScript" }, - { label: "react", description: "React application" }, - { label: "vue", description: "Vue.js application" }, - { label: "angular", description: "Angular application" }, - { label: "python", description: "Python project" }, - { label: "java", description: "Java project" }, - { label: "go", description: "Go project" }, - { label: "php", description: "PHP project" }, + { label: "node-ts", description: t("vscode.init.stacks.node_ts") }, + { label: "react", description: t("vscode.init.stacks.react") }, + { label: "vue", description: t("vscode.init.stacks.vue") }, + { label: "angular", description: t("vscode.init.stacks.angular") }, + { label: "python", description: t("vscode.init.stacks.python") }, + { label: "java", description: t("vscode.init.stacks.java") }, + { label: "go", description: t("vscode.init.stacks.go") }, + { label: "php", description: t("vscode.init.stacks.php") }, ], { - placeHolder: "Select project stack", + placeHolder: t("vscode.init.select_project_stack"), }, ); @@ -67,7 +68,7 @@ export class InitCommand extends BaseCommand { canSelectFolders: true, canSelectFiles: false, canSelectMany: false, - openLabel: "Select Project Location", + openLabel: t("vscode.init.select_project_location"), }); if (!folderUris || folderUris.length === 0) { @@ -81,8 +82,8 @@ export class InitCommand extends BaseCommand { try { await vscode.workspace.fs.stat(vscode.Uri.file(projectPath)); const overwrite = await this.confirmAction( - `Directory ${projectName} already exists. Do you want to overwrite it?`, - "Overwrite", + t("vscode.init.directory_exists_overwrite", { projectName }), + t("vscode.init.overwrite"), ); if (!overwrite) { return; @@ -95,13 +96,13 @@ export class InitCommand extends BaseCommand { vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: `Initializing project ${projectName}`, + title: t("vscode.init.initializing_project", { projectName }), cancellable: false, }, async (progress: ProgressCallback) => { progress.report({ increment: 0, - message: "Setting up project structure...", + message: t("vscode.init.setting_up_structure"), }); // Use StackCode CLI for initialization @@ -109,31 +110,33 @@ export class InitCommand extends BaseCommand { progress.report({ increment: 50, - message: "Running StackCode CLI...", + message: t("vscode.init.running_stackcode_cli"), }); await this.runTerminalCommand(command); progress.report({ increment: 100, - message: "Project initialized successfully!", + message: t("vscode.init.project_initialized_successfully"), }); }, ); // Ask if user wants to open the new project const openProject = await vscode.window.showInformationMessage( - `Project ${projectName} has been created successfully! Would you like to open it?`, - "Open Project", - "Later", + t("vscode.init.project_created_successfully", { projectName }), + t("vscode.init.open_project"), + t("vscode.init.later"), ); - if (openProject === "Open Project") { + if (openProject === t("vscode.init.open_project")) { const uri = vscode.Uri.file(projectPath); await vscode.commands.executeCommand("vscode.openFolder", uri, true); } } catch (error) { - this.showError(`Failed to initialize project: ${error}`); + this.showError( + t("vscode.init.failed_initialize_project", { error: String(error) }), + ); } } diff --git a/packages/vscode-extension/src/commands/ReleaseCommand.ts b/packages/vscode-extension/src/commands/ReleaseCommand.ts index a0a106c..54e85f5 100644 --- a/packages/vscode-extension/src/commands/ReleaseCommand.ts +++ b/packages/vscode-extension/src/commands/ReleaseCommand.ts @@ -1,19 +1,20 @@ import * as vscode from "vscode"; import { BaseCommand } from "./BaseCommand"; import { ProgressCallback } from "../types"; +import { t } from "@stackcode/i18n"; export class ReleaseCommand extends BaseCommand { async execute(): Promise { try { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError(t("vscode.common.no_workspace_folder")); return; } const confirm = await this.confirmAction( - "Are you sure you want to create a new release? This will tag the current commit and publish the release.", - "Create Release", + t("vscode.release.are_you_sure_create_release"), + t("vscode.release.create_release"), ); if (!confirm) { @@ -23,26 +24,37 @@ export class ReleaseCommand extends BaseCommand { vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: "Creating release", + title: t("vscode.release.creating_release"), cancellable: false, }, async (progress: ProgressCallback) => { - progress.report({ increment: 0, message: "Preparing release..." }); + progress.report({ + increment: 0, + message: t("vscode.release.preparing_release"), + }); // Use StackCode CLI for release const command = `npx @stackcode/cli release`; - progress.report({ increment: 50, message: "Creating release..." }); + progress.report({ + increment: 50, + message: t("vscode.release.creating_release_message"), + }); await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); - progress.report({ increment: 100, message: "Release created!" }); + progress.report({ + increment: 100, + message: t("vscode.release.release_created"), + }); }, ); - this.showSuccess("Release process started! Check terminal for progress."); + this.showSuccess(t("vscode.release.release_process_started")); } catch (error) { - this.showError(`Failed to create release: ${error}`); + this.showError( + t("vscode.release.failed_create_release", { error: String(error) }), + ); } } } diff --git a/packages/vscode-extension/src/commands/ValidateCommand.ts b/packages/vscode-extension/src/commands/ValidateCommand.ts index 512a2dc..4e44b25 100644 --- a/packages/vscode-extension/src/commands/ValidateCommand.ts +++ b/packages/vscode-extension/src/commands/ValidateCommand.ts @@ -1,44 +1,51 @@ import * as vscode from "vscode"; import { BaseCommand } from "./BaseCommand"; import { ProgressCallback } from "../types"; +import { t } from "@stackcode/i18n"; export class ValidateCommand extends BaseCommand { async execute(): Promise { try { const workspaceFolder = this.getCurrentWorkspaceFolder(); if (!workspaceFolder) { - this.showError("No workspace folder found"); + this.showError(t("vscode.common.no_workspace_folder")); return; } vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, - title: "Validating project structure", + title: t("vscode.validate.validating_project_structure"), cancellable: false, }, async (progress: ProgressCallback) => { - progress.report({ increment: 0, message: "Running validation..." }); + progress.report({ + increment: 0, + message: t("vscode.validate.running_validation"), + }); // Use StackCode CLI for validation const command = `npx @stackcode/cli validate`; progress.report({ increment: 50, - message: "Checking project structure...", + message: t("vscode.validate.checking_project_structure"), }); await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); - progress.report({ increment: 100, message: "Validation completed!" }); + progress.report({ + increment: 100, + message: t("vscode.validate.validation_completed"), + }); }, ); - this.showSuccess( - "Project validation completed! Check terminal for results.", - ); + this.showSuccess(t("vscode.validate.project_validation_completed")); } catch (error) { - this.showError(`Failed to validate project: ${error}`); + this.showError( + t("vscode.validate.failed_validate_project", { error: String(error) }), + ); } } } diff --git a/packages/vscode-extension/src/monitors/FileMonitor.ts b/packages/vscode-extension/src/monitors/FileMonitor.ts index cfcbd60..04f72f4 100644 --- a/packages/vscode-extension/src/monitors/FileMonitor.ts +++ b/packages/vscode-extension/src/monitors/FileMonitor.ts @@ -1,6 +1,7 @@ import * as vscode from "vscode"; import { ProactiveNotificationManager } from "../notifications/ProactiveNotificationManager"; import { ConfigurationManager } from "../config/ConfigurationManager"; +import { t } from "@stackcode/i18n"; export class FileMonitor implements vscode.Disposable { private proactiveManager: ProactiveNotificationManager; @@ -131,36 +132,42 @@ export class FileMonitor implements vscode.Disposable { if (missingFiles.length > 0 && Math.random() < 0.3) { // Show suggestion 30% of the time - const message = `📁 Your project is missing some important files: ${missingFiles.join(", ")}. Would you like to generate them?`; + const message = t("vscode.common.project_missing_files", { + missingFiles: missingFiles.join(", "), + }); const action = await vscode.window.showInformationMessage( message, - "Generate Files", - "Not Now", - "Don't Show Again", + t("vscode.common.generate_files"), + t("vscode.common.not_now"), + t("vscode.common.dont_show_again"), ); - if (action === "Generate Files") { + if (action === t("vscode.common.generate_files")) { // TODO: Implement file generation vscode.window.showInformationMessage( - "File generation will be available soon!", + t("vscode.common.file_generation_available_soon"), ); - } else if (action === "Don't Show Again") { + } else if (action === t("vscode.common.dont_show_again")) { await this.configManager.updateConfiguration( "notifications.enabled", false, ); } } - } catch (error) { + } catch (error: unknown) { // Use proper VS Code logging instead of console.log const outputChannel = vscode.window.createOutputChannel("StackCode"); - outputChannel.appendLine(`Error checking project structure: ${error}`); + outputChannel.appendLine( + t("vscode.common.error_checking_project_structure", { + error: String(error), + }), + ); } } dispose(): void { - this.disposables.forEach((d) => d.dispose()); + this.disposables.forEach((d: vscode.Disposable) => d.dispose()); this.disposables = []; this.processedFiles.clear(); }