From 4acb5be58df640bab8717f2e279e56ebdf42f84f Mon Sep 17 00:00:00 2001 From: Yago Azevedo Borba <140000816+YagoBorba@users.noreply.github.com> Date: Fri, 8 Aug 2025 12:59:38 +0000 Subject: [PATCH 1/3] =?UTF-8?q?feat(vscode-extension):=20=E2=9C=A8=20Setup?= =?UTF-8?q?=20React,=20Vite,=20and=20Tailwind=20for=20Webview=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/COMMIT_CONVENTION.md | 60 + .github/chatmodes/teste.chatmode.md | 43 + .github/instructions/teste.instructions.md | 57 + package-lock.json | 1975 ++++++++++++++++- packages/vscode-extension/.vscodeignore | 6 + packages/vscode-extension/package.json | 32 +- .../src/monitors/FileMonitor.ts | 4 +- .../src/webview-ui/index.html | 0 .../src/webview-ui/postcss.config.js | 6 + .../src/webview-ui/public/vite.svg | 0 .../src/webview-ui/src/App.tsx | 0 .../src/components/CommandPalette.tsx | 0 .../webview-ui/src/components/Dashboard.tsx | 0 .../src/components/NotificationPanel.tsx | 0 .../webview-ui/src/components/ProjectView.tsx | 0 .../webview-ui/src/components/StatusBar.tsx | 0 .../src/webview-ui/src/index.css | 0 .../src/webview-ui/src/main.tsx | 0 .../src/webview-ui/tailwind.config.js | 20 + .../src/webview-ui/tsconfig.json | 21 + .../src/webview-ui/tsconfig.node.json | 14 + .../src/webview-ui/vite.config.ts | 19 + packages/vscode-extension/tsconfig.json | 10 +- 23 files changed, 2161 insertions(+), 106 deletions(-) create mode 100644 .github/COMMIT_CONVENTION.md create mode 100644 .github/chatmodes/teste.chatmode.md create mode 100644 .github/instructions/teste.instructions.md create mode 100644 packages/vscode-extension/src/webview-ui/index.html create mode 100644 packages/vscode-extension/src/webview-ui/postcss.config.js create mode 100644 packages/vscode-extension/src/webview-ui/public/vite.svg create mode 100644 packages/vscode-extension/src/webview-ui/src/App.tsx create mode 100644 packages/vscode-extension/src/webview-ui/src/components/CommandPalette.tsx create mode 100644 packages/vscode-extension/src/webview-ui/src/components/Dashboard.tsx create mode 100644 packages/vscode-extension/src/webview-ui/src/components/NotificationPanel.tsx create mode 100644 packages/vscode-extension/src/webview-ui/src/components/ProjectView.tsx create mode 100644 packages/vscode-extension/src/webview-ui/src/components/StatusBar.tsx create mode 100644 packages/vscode-extension/src/webview-ui/src/index.css create mode 100644 packages/vscode-extension/src/webview-ui/src/main.tsx create mode 100644 packages/vscode-extension/src/webview-ui/tailwind.config.js create mode 100644 packages/vscode-extension/src/webview-ui/tsconfig.json create mode 100644 packages/vscode-extension/src/webview-ui/tsconfig.node.json create mode 100644 packages/vscode-extension/src/webview-ui/vite.config.ts diff --git a/.github/COMMIT_CONVENTION.md b/.github/COMMIT_CONVENTION.md new file mode 100644 index 00000000..dba1bf80 --- /dev/null +++ b/.github/COMMIT_CONVENTION.md @@ -0,0 +1,60 @@ +# Conventional Commits Reference + +## Format +``` + [optional scope]: + +[optional body] + +[optional footer(s)] +``` + +## Common Types with Emojis + +| Emoji | Code | Type | Description | +|-------|------|------|-------------| +| ✨ | `:sparkles:` | `feat` | Introduce new features | +| 🐛 | `:bug:` | `fix` | Fix a bug | +| 📝 | `:memo:` | `docs` | Add or update documentation | +| 🎨 | `:art:` | `style` | Improve structure/format of code | +| ♻️ | `:recycle:` | `refactor` | Refactor code | +| ⚡️ | `:zap:` | `perf` | Improve performance | +| ✅ | `:white_check_mark:` | `test` | Add, update, or pass tests | +| 🔧 | `:wrench:` | `chore` | Add or update configuration files | +| 🚀 | `:rocket:` | `build` | Deploy stuff | +| 👷 | `:construction_worker:` | `ci` | Add or update CI build system | + +## Examples + +```bash +# Feature +git commit -m "✨ feat(auth): add JWT token validation" + +# Bug fix +git commit -m "🐛 fix(api): handle null response in user service" + +# Documentation +git commit -m "📝 docs: update API documentation for v2.0" + +# Refactoring +git commit -m "♻️ refactor(utils): extract validation logic to separate module" + +# Configuration +git commit -m "🔧 chore: update ESLint configuration for TypeScript" +``` + +## Breaking Changes +Add `!` after the type for breaking changes: +```bash +git commit -m "💥 feat!: remove deprecated authentication methods" +``` + +## Scope Guidelines +- Use lowercase +- Be specific but concise +- Examples: `auth`, `api`, `ui`, `core`, `cli`, `docs` + +## Body and Footer +- Use imperative mood ("add" not "added") +- Explain the what and why, not the how +- Reference issues: `Closes #123`, `Fixes #456` diff --git a/.github/chatmodes/teste.chatmode.md b/.github/chatmodes/teste.chatmode.md new file mode 100644 index 00000000..0bbbe5b0 --- /dev/null +++ b/.github/chatmodes/teste.chatmode.md @@ -0,0 +1,43 @@ +```chatmode +--- +description: 'Parceiro intelectual sênior para desenvolvimento de software com rigor técnico e pensamento crítico' +tools: ['terminal', 'file-editing', 'code-analysis', 'testing', 'documentation'] +--- + +# Chat Mode: Parceiro Intelectual & Desenvolvedor Sênior + +## Propósito +Este modo ativa um comportamento de **parceria intelectual** combinado com expertise técnica de desenvolvedor sênior (25+ anos). O objetivo é provocar reflexão crítica e construtiva enquanto entrega soluções técnicas de alta qualidade. + +## Comportamento do AI: +- **Questione ativamente**: Desafie suposições, explore contradições, sugira alternativas +- **Pensamento crítico**: Não valide automaticamente; busque fragilidades e caminhos mais sólidos +- **Expertise técnica**: Aplique conhecimento profundo em arquitetura, padrões e boas práticas +- **Método educativo**: Explique raciocínios e ensine durante o processo + +## Foco Técnico: +- Clean Code, Clean Architecture, SOLID, Design Patterns +- Gitflow e conventional commits com emojis +- Testes unitários e de integração +- Documentação técnica completa +- Código escalável e manutenível + +## Estilo de Resposta: +- **Tom**: Positivo, didático, colaborativo, mas questionador +- **Linguagem**: Português para comunicação, inglês para código +- **Estrutura**: Sempre organize em etapas claras +- **Profundidade**: Vá além do superficial, explore implicações + +## Restrições: +- Mantenha foco em desenvolvimento de software +- Se divergir do tema, redirecione gentilmente +- Preserve contexto e histórico da conversa +- Evite concordância automática sem análise crítica + +## Ferramentas Preferenciais: +- Análise de código e arquitetura +- Execução de testes e validação +- Edição de arquivos com contexto completo +- Terminal para operações de desenvolvimento +- Documentação técnica detalhada +``` \ No newline at end of file diff --git a/.github/instructions/teste.instructions.md b/.github/instructions/teste.instructions.md new file mode 100644 index 00000000..48f57e84 --- /dev/null +++ b/.github/instructions/teste.instructions.md @@ -0,0 +1,57 @@ +```instructions +--- +applyTo: '**' +--- + +# Diretrizes Consolidadas para Colaboração com GitHub Copilot + +## Preâmbulo: Parceria Intelectual + +O GitHub Copilot deve atuar como um **parceiro intelectual**, não apenas como um assistente validador. Sempre questione suposições implícitas, explore possíveis contradições e considere alternativas relevantes. Adote uma postura crítica, mas construtiva, que leve a mais clareza, precisão e honestidade intelectual. + +## Atuação como Desenvolvedor Sênior (25+ anos de experiência) + +### Responsabilidades Core: +- Entender requisitos, desafios e problemas +- Propor soluções criativas, práticas e escaláveis +- Aplicar boas práticas (SOLID, injeção de dependência, modularização, Clean Code, Clean Architecture, Design Patterns, Gitflow) +- Escrever, revisar, testar e documentar código de alta qualidade, legível e escalável + +### Padrões de Comunicação: +- **Linguagem de comunicação**: Português brasileiro +- **Código e documentação**: Inglês (código, comentários, commits, README) +- **Mensagens de commit**: Padrão conventional commits em inglês + +### Objetivos de Entrega: +1. **Código completo**: Sempre forneça código integral alinhado ao propósito +2. **Método educativo**: Explique cada etapa do desenvolvimento +3. **Instruções detalhadas**: Orientação clara e direta para implementação +4. **Documentação**: Docstrings obrigatórias para funções/classes; comentários inline apenas para lógica muito complexa + +### Fluxo de Trabalho: +1. **Coleta de informações**: Esclarecer requisitos, público-alvo, restrições e tecnologias +2. **Visão geral da solução**: Arquitetura de alto nível, componentes, fluxos de dados +3. **Implementação passo a passo**: Código organizado em módulos/classes/funções +4. **Testes e validação**: Testes unitários, de integração e exemplos de uso +5. **Documentação final**: README completo e docstrings no código + +### Conventional Commits com Emojis: +Use o padrão: ` : ` + +Principais tipos: +- ✨ `feat`: Nova funcionalidade +- 🐛 `fix`: Correção de bug +- 📝 `docs`: Documentação +- 🎨 `style`: Formatação/estrutura +- ♻️ `refactor`: Refatoração +- ✅ `test`: Testes +- 🔧 `chore`: Configuração/manutenção +- ⚡️ `perf`: Performance +- 🚀 `build/deploy`: Build/Deploy + +### Direcionamento Geral: +- Mantenha tom positivo, didático e colaborativo +- Use linguagem simples e clara +- Preserve contexto e histórico da conversa +- Se desviar do tema, redirecione gentilmente para programação mantendo postura construtiva +``` \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 2467a14b..f2587f47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -710,6 +710,38 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz", + "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz", + "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/template": { "version": "7.27.2", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", @@ -1968,6 +2000,13 @@ "@octokit/openapi-types": "^25.1.0" } }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.30", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.30.tgz", + "integrity": "sha512-whXaSoNUFiyDAjkUF8OBpOm77Szdbk5lGNqFe6CbVbJFrhCCPinCbRA3NjawwlNHla1No7xvXXh+CpSxnPfUEw==", + "dev": true, + "license": "MIT" + }, "node_modules/@rollup/rollup-linux-x64-gnu": { "version": "4.46.2", "cpu": [ @@ -2271,6 +2310,26 @@ "@types/node": "*" } }, + "node_modules/@types/react": { + "version": "19.1.9", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.9.tgz", + "integrity": "sha512-WmdoynAX8Stew/36uTSVMcLJJ1KRh6L3IZRx1PZ7qJtBqT3dYTgyDTx8H1qoRghErydW7xw9mSJ3wS//tCRpFA==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.1.7", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.1.7.tgz", + "integrity": "sha512-i5ZzwYpqjmrKenzkoLM2Ibzt6mAsM7pxB6BCIouEVVmgiqaMj1TjaK7hnA36hbW5aZv20kx7Lw6hWzPWg0Rurw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.0.0" + } + }, "node_modules/@types/semver": { "version": "7.7.0", "license": "MIT" @@ -2709,6 +2768,27 @@ "node": ">=20.0.0" } }, + "node_modules/@vitejs/plugin-react": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.0.0.tgz", + "integrity": "sha512-Jx9JfsTa05bYkS9xo0hkofp2dCmp1blrKjw9JONs5BTHOvJCgLbaPSuZLGSVJW6u2qe0tc4eevY0+gSNNi0YCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.28.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-beta.30", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.17.0" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, "node_modules/@vitest/expect": { "version": "3.2.4", "dev": true, @@ -3248,6 +3328,23 @@ "node": ">=0.10.0" } }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array-ify": { "version": "1.0.0", "license": "MIT" @@ -3260,6 +3357,28 @@ "node": ">=0.10.0" } }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/assertion-error": { "version": "2.0.1", "dev": true, @@ -3287,6 +3406,16 @@ ], "license": "MIT" }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -3312,6 +3441,60 @@ "when-exit": "^2.1.1" } }, + "node_modules/autoprefixer": { + "version": "10.4.21", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.21.tgz", + "integrity": "sha512-O+A6LWV5LDHSJD3LjHYoNi4VLsj/Whi7k6zG12xTYaU4cQ8oxQGckXNX8cRHK5yOZ/ppVHe0ZBXGzSV9jXdVbQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "browserslist": "^4.24.4", + "caniuse-lite": "^1.0.30001702", + "fraction.js": "^4.3.7", + "normalize-range": "^0.1.2", + "picocolors": "^1.1.1", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/azure-devops-node-api": { "version": "12.5.0", "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-12.5.0.tgz", @@ -3745,6 +3928,25 @@ "node": ">=0.10.0" } }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/call-bind-apply-helpers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", @@ -4426,6 +4628,67 @@ "url": "https://github.com/sponsors/fb55" } }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "dev": true, + "license": "MIT" + }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/debug": { "version": "2.6.9", "dev": true, @@ -4544,6 +4807,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/define-lazy-prop": { "version": "3.0.0", "license": "MIT", @@ -4554,6 +4835,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/define-property": { "version": "2.0.2", "dev": true, @@ -4802,6 +5101,75 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-abstract": { + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", + "integrity": "sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.3.0", + "get-proto": "^1.0.1", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.2.1", + "is-set": "^2.0.3", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.1", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.4", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.4", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "stop-iteration-iterator": "^1.1.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.19" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", @@ -4856,6 +5224,24 @@ "node": ">= 0.4" } }, + "node_modules/es-to-primitive": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/esbuild": { "version": "0.25.8", "dev": true, @@ -5665,6 +6051,22 @@ "dev": true, "license": "ISC" }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/for-in": { "version": "1.0.2", "dev": true, @@ -5701,6 +6103,20 @@ "node": ">= 6" } }, + "node_modules/fraction.js": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", + "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + } + }, "node_modules/fragment-cache": { "version": "0.2.1", "dev": true, @@ -5748,13 +6164,44 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "node_modules/function.prototype.name": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", "dev": true, "license": "MIT", - "engines": { + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { "node": ">=6.9.0" } }, @@ -5827,6 +6274,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-symbol-description": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-value": { "version": "2.0.6", "dev": true, @@ -5979,6 +6444,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", @@ -6029,6 +6511,19 @@ "node": ">=0.10.0" } }, + "node_modules/has-bigints": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-flag": { "version": "4.0.0", "license": "MIT", @@ -6036,6 +6531,35 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", @@ -6421,6 +6945,21 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/is-accessor-descriptor": { "version": "1.0.1", "dev": true, @@ -6432,6 +6971,24 @@ "node": ">= 0.10" } }, + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -6439,6 +6996,42 @@ "dev": true, "license": "MIT" }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-binary-path": { "version": "1.0.1", "dev": true, @@ -6450,11 +7043,41 @@ "node": ">=0.10.0" } }, + "node_modules/is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-buffer": { "version": "1.1.6", "dev": true, "license": "MIT" }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-core-module": { "version": "2.16.1", "dev": true, @@ -6480,6 +7103,41 @@ "node": ">= 0.4" } }, + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-descriptor": { "version": "1.0.3", "dev": true, @@ -6540,6 +7198,22 @@ "node": ">=0.10.0" } }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "license": "MIT", @@ -6557,6 +7231,25 @@ "node": ">=6" } }, + "node_modules/is-generator-function": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-glob": { "version": "2.0.1", "dev": true, @@ -6591,6 +7284,32 @@ "node": ">=8" } }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-number": { "version": "2.1.0", "dev": true, @@ -6602,6 +7321,23 @@ "node": ">=0.10.0" } }, + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-obj": { "version": "2.0.0", "license": "MIT", @@ -6614,61 +7350,206 @@ "dev": true, "license": "MIT", "dependencies": { - "isobject": "^3.0.1" + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object/node_modules/isobject": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-posix-bracket": { + "version": "0.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-primitive": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-plain-object/node_modules/isobject": { - "version": "3.0.1", + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", "dev": true, "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-posix-bracket": { - "version": "0.1.1", - "dev": true, + "node_modules/is-typedarray": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-primitive": { - "version": "2.0.0", + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", "dev": true, "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", "dev": true, "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, "engines": { - "node": ">=8" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "license": "MIT" - }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, "engines": { - "node": ">=10" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-windows": { @@ -7945,6 +8826,13 @@ "dev": true, "license": "MIT" }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true, + "license": "MIT" + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -8124,6 +9012,46 @@ "uc.micro": "^1.0.1" } }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/load-json-file/node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "license": "MIT", + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/load-json-file/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -8244,6 +9172,16 @@ "version": "10.4.3", "license": "ISC" }, + "node_modules/lucide-react": { + "version": "0.539.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.539.0.tgz", + "integrity": "sha512-VVISr+VF2krO91FeuCrm1rSOLACQUYVy7NQkzrOty52Y8TlTPcXcMdQFj9bYzBgXbWCiywlwSZ3Z8u6a+6bMlg==", + "dev": true, + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/magic-string": { "version": "0.30.17", "dev": true, @@ -8353,6 +9291,15 @@ "dev": true, "license": "MIT" }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, "node_modules/meow": { "version": "13.2.0", "license": "MIT", @@ -8579,102 +9526,286 @@ "version": "4.0.0", "dev": true, "license": "MIT", - "engines": { - "node": ">=0.10.0" + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nanomatch/node_modules/array-unique": { + "version": "0.3.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nanomatch/node_modules/kind-of": { + "version": "6.0.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/napi-build-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/neo-async": { + "version": "2.6.2", + "license": "MIT" + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-abi": { + "version": "3.75.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.75.0.tgz", + "integrity": "sha512-OhYaY5sDsIka7H7AtijtI9jwGYLyl29eQn/W623DiN/MIv5sUqc4g7BIDThX+gb7di9f6xK02nkp8sdfFWZLTg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", + "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-package-data": { + "version": "7.0.1", + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^8.0.0", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/normalize-path": { + "version": "2.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/npm-run-all/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" } }, - "node_modules/nanomatch/node_modules/array-unique": { - "version": "0.3.2", + "node_modules/npm-run-all/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/npm-run-all/node_modules/cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", "dev": true, "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, "engines": { - "node": ">=0.10.0" + "node": ">=4.8" } }, - "node_modules/nanomatch/node_modules/kind-of": { - "version": "6.0.3", + "node_modules/npm-run-all/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/napi-build-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", - "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "node_modules/npm-run-all/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", "dev": true, "license": "MIT", - "optional": true + "engines": { + "node": ">=4" + } }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "node_modules/npm-run-all/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, - "license": "MIT" - }, - "node_modules/neo-async": { - "version": "2.6.2", - "license": "MIT" + "license": "ISC", + "bin": { + "semver": "bin/semver" + } }, - "node_modules/node-abi": { - "version": "3.75.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.75.0.tgz", - "integrity": "sha512-OhYaY5sDsIka7H7AtijtI9jwGYLyl29eQn/W623DiN/MIv5sUqc4g7BIDThX+gb7di9f6xK02nkp8sdfFWZLTg==", + "node_modules/npm-run-all/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", "dev": true, "license": "MIT", - "optional": true, "dependencies": { - "semver": "^7.3.5" + "shebang-regex": "^1.0.0" }, "engines": { - "node": ">=10" + "node": ">=0.10.0" } }, - "node_modules/node-addon-api": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", - "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==", + "node_modules/npm-run-all/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", "dev": true, "license": "MIT", - "optional": true - }, - "node_modules/node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "dev": true, - "license": "MIT" + "engines": { + "node": ">=0.10.0" + } }, - "node_modules/node-releases": { - "version": "2.0.19", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", - "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "node_modules/npm-run-all/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, - "license": "MIT" - }, - "node_modules/normalize-package-data": { - "version": "7.0.1", - "license": "BSD-2-Clause", + "license": "MIT", "dependencies": { - "hosted-git-info": "^8.0.0", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4" + "has-flag": "^3.0.0" }, "engines": { - "node": "^18.17.0 || >=20.5.0" + "node": ">=4" } }, - "node_modules/normalize-path": { - "version": "2.1.1", + "node_modules/npm-run-all/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "remove-trailing-separator": "^1.0.1" + "isexe": "^2.0.0" }, - "engines": { - "node": ">=0.10.0" + "bin": { + "which": "bin/which" } }, "node_modules/npm-run-path": { @@ -8752,6 +9883,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/object-visit": { "version": "1.0.1", "dev": true, @@ -8771,6 +9912,27 @@ "node": ">=0.10.0" } }, + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/object.omit": { "version": "2.0.1", "dev": true, @@ -8899,6 +10061,24 @@ "node": ">=0.10.0" } }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -9101,6 +10281,19 @@ "dev": true, "license": "MIT" }, + "node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/pathe": { "version": "2.0.3", "dev": true, @@ -9137,6 +10330,29 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true, + "license": "MIT", + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/pirates": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", @@ -9224,8 +10440,20 @@ "node": ">=0.10.0" } }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/postcss": { "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", "dev": true, "funding": [ { @@ -9251,6 +10479,13 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true, + "license": "MIT" + }, "node_modules/prebuild-install": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", @@ -9493,6 +10728,29 @@ "node": ">=0.10.0" } }, + "node_modules/react": { + "version": "19.1.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.1.1.tgz", + "integrity": "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.1.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.1.tgz", + "integrity": "sha512-Dlq/5LAZgF0Gaz6yiqZCf6VCcZs1ghAJyrsu84Q/GT0gV+mCxbfmKNoGRKBYMJ8IEdGPqu49YWXD02GCknEDkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "scheduler": "^0.26.0" + }, + "peerDependencies": { + "react": "^19.1.1" + } + }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -9500,6 +10758,16 @@ "dev": true, "license": "MIT" }, + "node_modules/react-refresh": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", + "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/read": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", @@ -9513,6 +10781,51 @@ "node": ">=0.8" } }, + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true, + "license": "ISC" + }, + "node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/read-pkg/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, "node_modules/readable-stream": { "version": "3.6.2", "license": "MIT", @@ -9789,6 +11102,29 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/regenerator-runtime": { "version": "0.11.1", "dev": true, @@ -9817,6 +11153,27 @@ "node": ">=0.10.0" } }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/remove-trailing-separator": { "version": "1.1.0", "dev": true, @@ -10028,6 +11385,33 @@ "tslib": "^2.1.0" } }, + "node_modules/safe-array-concat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, "node_modules/safe-buffer": { "version": "5.2.1", "funding": [ @@ -10046,6 +11430,30 @@ ], "license": "MIT" }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-push-apply/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, "node_modules/safe-regex": { "version": "1.1.0", "dev": true, @@ -10054,6 +11462,24 @@ "ret": "~0.1.10" } }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "license": "MIT" @@ -10065,6 +11491,13 @@ "dev": true, "license": "ISC" }, + "node_modules/scheduler": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", + "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", + "dev": true, + "license": "MIT" + }, "node_modules/semver": { "version": "7.7.2", "license": "ISC", @@ -10075,6 +11508,55 @@ "node": ">=10" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/set-value": { "version": "2.0.1", "dev": true, @@ -10548,6 +12030,20 @@ "dev": true, "license": "MIT" }, + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "license": "MIT", @@ -10581,6 +12077,84 @@ "node": ">=8" } }, + "node_modules/string.prototype.padend": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", + "integrity": "sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "license": "MIT", @@ -10667,6 +12241,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/tailwindcss": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.11.tgz", + "integrity": "sha512-2E9TBm6MDD/xKYe+dvJZAmg3yxIEDNRc0jwlNyDg/4Fil2QcSLjFKGVff0lAf1jjeaArlG/M75Ey/EYr/OJtBA==", + "dev": true, + "license": "MIT" + }, "node_modules/tar-fs": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.3.tgz", @@ -10959,6 +12540,84 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typed-rest-client": { "version": "1.8.11", "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.11.tgz", @@ -11032,6 +12691,25 @@ "node": ">=0.8.0" } }, + "node_modules/unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/underscore": { "version": "1.13.7", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", @@ -11225,7 +12903,9 @@ } }, "node_modules/vite": { - "version": "7.0.6", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.1.tgz", + "integrity": "sha512-yJ+Mp7OyV+4S+afWo+QyoL9jFWD11QFH0i5i7JypnfTcA1rmgxCbiA8WwAICDEtZ1Z1hzrVhN8R8rGTqkTY8ZQ==", "dev": true, "license": "MIT", "dependencies": { @@ -11233,7 +12913,7 @@ "fdir": "^6.4.6", "picomatch": "^4.0.3", "postcss": "^8.5.6", - "rollup": "^4.40.0", + "rollup": "^4.43.0", "tinyglobby": "^0.2.14" }, "bin": { @@ -11510,6 +13190,102 @@ "node": ">= 8" } }, + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/why-is-node-running": { "version": "2.3.0", "dev": true, @@ -11750,11 +13526,22 @@ "devDependencies": { "@types/jest": "^29.5.14", "@types/node": "^16.18.126", + "@types/react": "^19.1.9", + "@types/react-dom": "^19.1.7", "@types/vscode": "^1.85.0", + "@vitejs/plugin-react": "^5.0.0", "@vscode/vsce": "^2.19.0", + "autoprefixer": "^10.4.21", "jest": "^29.5.0", + "lucide-react": "^0.539.0", + "npm-run-all": "^4.1.5", + "postcss": "^8.5.6", + "react": "^19.1.1", + "react-dom": "^19.1.1", + "tailwindcss": "^4.1.11", "ts-jest": "^29.4.1", - "typescript": "^4.9.5" + "typescript": "^4.9.5", + "vite": "^7.1.1" }, "engines": { "vscode": "^1.85.0" diff --git a/packages/vscode-extension/.vscodeignore b/packages/vscode-extension/.vscodeignore index 20107d31..90e58133 100644 --- a/packages/vscode-extension/.vscodeignore +++ b/packages/vscode-extension/.vscodeignore @@ -21,3 +21,9 @@ test/** ../../** **/tsconfig.* **/.tsbuildinfo + +# Adicione essas linhas +dist/ +node_modules/ +src/webview-ui/ +!dist/webview-ui/ diff --git a/packages/vscode-extension/package.json b/packages/vscode-extension/package.json index e657748f..75a449b4 100644 --- a/packages/vscode-extension/package.json +++ b/packages/vscode-extension/package.json @@ -7,6 +7,18 @@ "engines": { "vscode": "^1.85.0" }, + "scripts": { + "vscode:prepublish": "npm run build", + "build": "npm run build:ui && npm run compile:ext", + "build:ui": "vite build --config src/webview-ui/vite.config.ts --emptyOutDir", + "watch": "npm-run-all --parallel watch:*", + "watch:ui": "vite build --watch --config src/webview-ui/vite.config.ts --emptyOutDir", + "watch:ext": "tsc -w -p ./", + "dev:ui": "vite --config src/webview-ui/vite.config.ts", + "compile:ext": "tsc -p ./", + "package": "vsce package", + "test": "jest" + }, "categories": [ "Other", "SCM Providers", @@ -213,21 +225,25 @@ } } }, - "scripts": { - "vscode:prepublish": "npm run compile", - "compile": "tsc -p ./", - "watch": "tsc -watch -p ./", - "package": "vsce package", - "test": "jest" - }, "devDependencies": { "@types/jest": "^29.5.14", "@types/node": "^16.18.126", + "@types/react": "^19.1.9", + "@types/react-dom": "^19.1.7", "@types/vscode": "^1.85.0", + "@vitejs/plugin-react": "^5.0.0", "@vscode/vsce": "^2.19.0", + "autoprefixer": "^10.4.21", "jest": "^29.5.0", + "lucide-react": "^0.539.0", + "npm-run-all": "^4.1.5", + "postcss": "^8.5.6", + "react": "^19.1.1", + "react-dom": "^19.1.1", + "tailwindcss": "^4.1.11", "ts-jest": "^29.4.1", - "typescript": "^4.9.5" + "typescript": "^4.9.5", + "vite": "^7.1.1" }, "dependencies": { "@stackcode/core": "^1.0.3", diff --git a/packages/vscode-extension/src/monitors/FileMonitor.ts b/packages/vscode-extension/src/monitors/FileMonitor.ts index b892f8f1..cfcbd602 100644 --- a/packages/vscode-extension/src/monitors/FileMonitor.ts +++ b/packages/vscode-extension/src/monitors/FileMonitor.ts @@ -153,7 +153,9 @@ export class FileMonitor implements vscode.Disposable { } } } catch (error) { - console.log("Error checking project structure:", error); + // Use proper VS Code logging instead of console.log + const outputChannel = vscode.window.createOutputChannel("StackCode"); + outputChannel.appendLine(`Error checking project structure: ${error}`); } } diff --git a/packages/vscode-extension/src/webview-ui/index.html b/packages/vscode-extension/src/webview-ui/index.html new file mode 100644 index 00000000..e69de29b diff --git a/packages/vscode-extension/src/webview-ui/postcss.config.js b/packages/vscode-extension/src/webview-ui/postcss.config.js new file mode 100644 index 00000000..e99ebc2c --- /dev/null +++ b/packages/vscode-extension/src/webview-ui/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/public/vite.svg b/packages/vscode-extension/src/webview-ui/public/vite.svg new file mode 100644 index 00000000..e69de29b diff --git a/packages/vscode-extension/src/webview-ui/src/App.tsx b/packages/vscode-extension/src/webview-ui/src/App.tsx new file mode 100644 index 00000000..e69de29b diff --git a/packages/vscode-extension/src/webview-ui/src/components/CommandPalette.tsx b/packages/vscode-extension/src/webview-ui/src/components/CommandPalette.tsx new file mode 100644 index 00000000..e69de29b diff --git a/packages/vscode-extension/src/webview-ui/src/components/Dashboard.tsx b/packages/vscode-extension/src/webview-ui/src/components/Dashboard.tsx new file mode 100644 index 00000000..e69de29b diff --git a/packages/vscode-extension/src/webview-ui/src/components/NotificationPanel.tsx b/packages/vscode-extension/src/webview-ui/src/components/NotificationPanel.tsx new file mode 100644 index 00000000..e69de29b diff --git a/packages/vscode-extension/src/webview-ui/src/components/ProjectView.tsx b/packages/vscode-extension/src/webview-ui/src/components/ProjectView.tsx new file mode 100644 index 00000000..e69de29b diff --git a/packages/vscode-extension/src/webview-ui/src/components/StatusBar.tsx b/packages/vscode-extension/src/webview-ui/src/components/StatusBar.tsx new file mode 100644 index 00000000..e69de29b diff --git a/packages/vscode-extension/src/webview-ui/src/index.css b/packages/vscode-extension/src/webview-ui/src/index.css new file mode 100644 index 00000000..e69de29b diff --git a/packages/vscode-extension/src/webview-ui/src/main.tsx b/packages/vscode-extension/src/webview-ui/src/main.tsx new file mode 100644 index 00000000..e69de29b diff --git a/packages/vscode-extension/src/webview-ui/tailwind.config.js b/packages/vscode-extension/src/webview-ui/tailwind.config.js new file mode 100644 index 00000000..f494b1bd --- /dev/null +++ b/packages/vscode-extension/src/webview-ui/tailwind.config.js @@ -0,0 +1,20 @@ +/** @type {import('tailwindcss').Config} */ +export default { + content: [ + "./index.html", + "./src/**/*.{js,ts,jsx,tsx}", + ], + theme: { + extend: { + colors: { + // Cores que podem ser usadas para mimetizar o tema do VS Code + vscode: { + background: 'var(--vscode-editor-background)', + foreground: 'var(--vscode-editor-foreground)', + // ... outras cores que você definiu + } + } + }, + }, + plugins: [], +} \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/tsconfig.json b/packages/vscode-extension/src/webview-ui/tsconfig.json new file mode 100644 index 00000000..d0104edb --- /dev/null +++ b/packages/vscode-extension/src/webview-ui/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"], + "references": [{ "path": "./tsconfig.node.json" }] +} \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/tsconfig.node.json b/packages/vscode-extension/src/webview-ui/tsconfig.node.json new file mode 100644 index 00000000..216fa6a8 --- /dev/null +++ b/packages/vscode-extension/src/webview-ui/tsconfig.node.json @@ -0,0 +1,14 @@ +// packages/vscode-extension/src/webview-ui/tsconfig.node.json + +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + // Altere esta linha de 'bundler' para 'NodeNext' ou 'bundler' + // 'bundler' é o mais recomendado para ambientes de build modernos como Vite. + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true + }, + "include": ["vite.config.ts"] +} \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/vite.config.ts b/packages/vscode-extension/src/webview-ui/vite.config.ts new file mode 100644 index 00000000..02f112e7 --- /dev/null +++ b/packages/vscode-extension/src/webview-ui/vite.config.ts @@ -0,0 +1,19 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [react()], + build: { + // Gera os artefatos de build na pasta 'dist/webview-ui' + // dentro do pacote da extensão, para não poluir a raiz. + outDir: '../../dist/webview-ui', + rollupOptions: { + output: { + entryFileNames: `assets/[name].js`, + chunkFileNames: `assets/[name].js`, + assetFileNames: `assets/[name].[ext]`, + }, + }, + }, +}); \ No newline at end of file diff --git a/packages/vscode-extension/tsconfig.json b/packages/vscode-extension/tsconfig.json index cdfca725..fedf7eaf 100644 --- a/packages/vscode-extension/tsconfig.json +++ b/packages/vscode-extension/tsconfig.json @@ -1,10 +1,11 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { + // VS Code Extension specific overrides "module": "CommonJS", "target": "ES2020", "outDir": "out", - "lib": ["ES2020"], + "lib": ["ES2020", "DOM"], // Add DOM for console and other browser APIs "sourceMap": true, "rootDir": "src", "strict": true, @@ -12,8 +13,11 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "skipLibCheck": true, - "types": ["jest", "node", "vscode"] + "types": ["jest", "node", "vscode"], + // Override base config for VS Code extensions + "declaration": false, // Not needed for extensions + "composite": false // Not needed for extensions }, "include": ["src/**/*"], - "exclude": ["node_modules", "out"] + "exclude": ["node_modules", "out", "**/*.test.ts"] } From 32f42417a0d7c6beba050f10e062aabe5eb43e0c Mon Sep 17 00:00:00 2001 From: Yago Azevedo Borba <140000816+YagoBorba@users.noreply.github.com> Date: Fri, 8 Aug 2025 16:46:31 +0000 Subject: [PATCH 2/3] =?UTF-8?q?feat(vscode-extension):=20=F0=9F=9A=80=20Co?= =?UTF-8?q?mplete=20React=20webview=20UI=20implementation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✨ FEATURES: - Implemented complete React-based dashboard webview - Added 5 interactive UI components (Dashboard, ProjectView, CommandPalette, NotificationPanel, StatusBar) - Created responsive TailwindCSS design system integrated with VS Code themes - Built comprehensive command system with webview communication - Added real-time project statistics and workspace detection 🔧 TECHNICAL IMPROVEMENTS: - Fixed TypeScript compilation and module resolution issues - Corrected VSCode extension registration and sidebar integration - Implemented proper Content Security Policy for webview security - Added robust error handling and debug logging system - Created proper Vite build configuration for extension assets 🎨 UI/UX ENHANCEMENTS: - Modern dashboard with project stats, quick actions, and git workflow - Interactive command palette with search and categorization - Real-time notification system with multiple alert types - Project overview with file structure and git branch visualization - Status bar with commit info and quick actions 🛠️ INFRASTRUCTURE: - Complete PostCSS + TailwindCSS setup with VS Code variable integration - Proper TypeScript configuration for both extension and webview - Vite build system with manifest generation for asset loading - Extension packaging and development workflow setup 🐛 BUG FIXES: - Resolved webview command registration and communication issues - Fixed workspace detection in development and production environments - Corrected asset loading paths and CSP configuration - Fixed TypeScript errors and linting issues This implementation provides a complete, production-ready VS Code extension with a modern React interface that integrates seamlessly with the VS Code ecosystem while maintaining performance and security standards. --- .vscode/extensions.json | 8 + .vscode/launch.json | 27 + .vscode/settings.json | 19 + .vscode/tasks.json | 43 + package-lock.json | 654 ++++++++++++++- .../vscode-extension/.vscode/settings.json | 12 + .../out/commands/BaseCommand.js | 58 ++ .../out/commands/BaseCommand.js.map | 1 + .../out/commands/CommitCommand.js | 24 + .../out/commands/CommitCommand.js.map | 1 + .../out/commands/ConfigCommand.js | 82 ++ .../out/commands/ConfigCommand.js.map | 1 + .../out/commands/GenerateCommand.js | 181 ++++ .../out/commands/GenerateCommand.js.map | 1 + .../out/commands/GitCommand.js | 155 ++++ .../out/commands/GitCommand.js.map | 1 + .../out/commands/InitCommand.js | 150 ++++ .../out/commands/InitCommand.js.map | 1 + .../out/commands/ReleaseCommand.js | 61 ++ .../out/commands/ReleaseCommand.js.map | 1 + .../out/commands/ValidateCommand.js | 60 ++ .../out/commands/ValidateCommand.js.map | 1 + .../out/config/ConfigurationManager.js | 64 ++ .../out/config/ConfigurationManager.js.map | 1 + packages/vscode-extension/out/extension.js | 137 +++ .../vscode-extension/out/extension.js.map | 1 + .../out/monitors/FileMonitor.js | 137 +++ .../out/monitors/FileMonitor.js.map | 1 + .../out/monitors/GitMonitor.js | 190 +++++ .../out/monitors/GitMonitor.js.map | 1 + .../ProactiveNotificationManager.js | 207 +++++ .../ProactiveNotificationManager.js.map | 1 + .../out/providers/DashboardProvider.backup.js | 272 ++++++ .../providers/DashboardProvider.backup.js.map | 1 + .../out/providers/DashboardProvider.js | 272 ++++++ .../out/providers/DashboardProvider.js.map | 1 + .../out/providers/ProjectViewProvider.js | 307 +++++++ .../out/providers/ProjectViewProvider.js.map | 1 + .../out/test/__mocks__/vscode.js | 58 ++ .../out/test/__mocks__/vscode.js.map | 1 + packages/vscode-extension/out/types.js | 3 + packages/vscode-extension/out/types.js.map | 1 + packages/vscode-extension/package.json | 13 +- packages/vscode-extension/src/extension.ts | 30 +- .../src/providers/DashboardProvider.backup.ts | 279 ++++++ .../src/providers/DashboardProvider.ts | 794 ++++++------------ .../src/webview-ui/index.html | 12 + .../src/webview-ui/postcss.config.js | 5 +- .../src/webview-ui/src/App.tsx | 209 +++++ .../src/components/CommandPalette.tsx | 244 ++++++ .../webview-ui/src/components/Dashboard.tsx | 306 +++++++ .../src/components/NotificationPanel.tsx | 142 ++++ .../webview-ui/src/components/ProjectView.tsx | 254 ++++++ .../webview-ui/src/components/StatusBar.tsx | 74 ++ .../src/webview-ui/src/index.css | 256 ++++++ .../src/webview-ui/src/main.tsx | 10 + .../src/webview-ui/tailwind.config.js | 149 +++- .../src/webview-ui/tsconfig.json | 19 +- .../src/webview-ui/tsconfig.node.json | 9 +- .../src/webview-ui/vite.config.ts | 23 +- packages/vscode-extension/tsconfig.json | 18 +- 61 files changed, 5468 insertions(+), 577 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json create mode 100644 packages/vscode-extension/.vscode/settings.json create mode 100644 packages/vscode-extension/out/commands/BaseCommand.js create mode 100644 packages/vscode-extension/out/commands/BaseCommand.js.map create mode 100644 packages/vscode-extension/out/commands/CommitCommand.js create mode 100644 packages/vscode-extension/out/commands/CommitCommand.js.map create mode 100644 packages/vscode-extension/out/commands/ConfigCommand.js create mode 100644 packages/vscode-extension/out/commands/ConfigCommand.js.map create mode 100644 packages/vscode-extension/out/commands/GenerateCommand.js create mode 100644 packages/vscode-extension/out/commands/GenerateCommand.js.map create mode 100644 packages/vscode-extension/out/commands/GitCommand.js create mode 100644 packages/vscode-extension/out/commands/GitCommand.js.map create mode 100644 packages/vscode-extension/out/commands/InitCommand.js create mode 100644 packages/vscode-extension/out/commands/InitCommand.js.map create mode 100644 packages/vscode-extension/out/commands/ReleaseCommand.js create mode 100644 packages/vscode-extension/out/commands/ReleaseCommand.js.map create mode 100644 packages/vscode-extension/out/commands/ValidateCommand.js create mode 100644 packages/vscode-extension/out/commands/ValidateCommand.js.map create mode 100644 packages/vscode-extension/out/config/ConfigurationManager.js create mode 100644 packages/vscode-extension/out/config/ConfigurationManager.js.map create mode 100644 packages/vscode-extension/out/extension.js create mode 100644 packages/vscode-extension/out/extension.js.map create mode 100644 packages/vscode-extension/out/monitors/FileMonitor.js create mode 100644 packages/vscode-extension/out/monitors/FileMonitor.js.map create mode 100644 packages/vscode-extension/out/monitors/GitMonitor.js create mode 100644 packages/vscode-extension/out/monitors/GitMonitor.js.map create mode 100644 packages/vscode-extension/out/notifications/ProactiveNotificationManager.js create mode 100644 packages/vscode-extension/out/notifications/ProactiveNotificationManager.js.map create mode 100644 packages/vscode-extension/out/providers/DashboardProvider.backup.js create mode 100644 packages/vscode-extension/out/providers/DashboardProvider.backup.js.map create mode 100644 packages/vscode-extension/out/providers/DashboardProvider.js create mode 100644 packages/vscode-extension/out/providers/DashboardProvider.js.map create mode 100644 packages/vscode-extension/out/providers/ProjectViewProvider.js create mode 100644 packages/vscode-extension/out/providers/ProjectViewProvider.js.map create mode 100644 packages/vscode-extension/out/test/__mocks__/vscode.js create mode 100644 packages/vscode-extension/out/test/__mocks__/vscode.js.map create mode 100644 packages/vscode-extension/out/types.js create mode 100644 packages/vscode-extension/out/types.js.map create mode 100644 packages/vscode-extension/src/providers/DashboardProvider.backup.ts diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..91cd9197 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "ms-vscode.vscode-json" + ], + "unwantedRecommendations": [ + "equinusocio.vsc-material-theme-icons" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..2c47bb0c --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,27 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Run VSCode Extension", + "type": "extensionHost", + "request": "launch", + "args": ["--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-extension"], + "outFiles": ["${workspaceFolder}/packages/vscode-extension/out/**/*.js"], + "preLaunchTask": "npm: compile:ext" + }, + { + "name": "Extension Tests", + "type": "extensionHost", + "request": "launch", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-extension", + "--extensionTestsPath=${workspaceFolder}/packages/vscode-extension/out/test" + ], + "outFiles": ["${workspaceFolder}/packages/vscode-extension/out/**/*.js"], + "preLaunchTask": "npm: compile:ext" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..58213ff5 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,19 @@ +{ + "files.associations": { + "*.json": "jsonc", + "tsconfig*.json": "jsonc", + "launch.json": "jsonc", + "tasks.json": "jsonc", + "package.json": "jsonc", + ".vscode/*.json": "jsonc" + }, + "json.schemaDownload.enable": true, + "jsonc.validate.enable": true, + "json.validate.enable": true, + "[jsonc]": { + "editor.defaultFormatter": "vscode.json-language-features" + }, + "[json]": { + "editor.defaultFormatter": "vscode.json-language-features" + } +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..b67a06b8 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,43 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "npm: compile:ext", + "type": "shell", + "command": "npm", + "args": ["run", "compile:ext"], + "options": { + "cwd": "${workspaceFolder}/packages/vscode-extension" + }, + "group": "build", + "presentation": { + "echo": true, + "reveal": "silent", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false + }, + "problemMatcher": ["$tsc"] + }, + { + "label": "npm: build", + "type": "shell", + "command": "npm", + "args": ["run", "build"], + "options": { + "cwd": "${workspaceFolder}/packages/vscode-extension" + }, + "group": "build", + "presentation": { + "echo": true, + "reveal": "always", + "focus": true, + "panel": "shared" + }, + "problemMatcher": ["$tsc"] + } + ] +} diff --git a/package-lock.json b/package-lock.json index f2587f47..8d416176 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,19 @@ "typescript-eslint": "^8.39.0" } }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@ampproject/remapping": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", @@ -1135,6 +1148,19 @@ "node": ">=10.13.0" } }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -2107,6 +2133,282 @@ "resolved": "packages/i18n", "link": true }, + "node_modules/@tailwindcss/node": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.1.11.tgz", + "integrity": "sha512-yzhzuGRmv5QyU9qLNg4GTlYI6STedBWRE7NjxP45CsFYYq9taI0zJXZBMqIC/c8fViNLhmrbpSFS57EoxUmD6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.3.0", + "enhanced-resolve": "^5.18.1", + "jiti": "^2.4.2", + "lightningcss": "1.30.1", + "magic-string": "^0.30.17", + "source-map-js": "^1.2.1", + "tailwindcss": "4.1.11" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.1.11.tgz", + "integrity": "sha512-Q69XzrtAhuyfHo+5/HMgr1lAiPP/G40OMFAnws7xcFEYqcypZmdW8eGXaOUIeOl1dzPJBPENXgbjsOyhg2nkrg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.4", + "tar": "^7.4.3" + }, + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.1.11", + "@tailwindcss/oxide-darwin-arm64": "4.1.11", + "@tailwindcss/oxide-darwin-x64": "4.1.11", + "@tailwindcss/oxide-freebsd-x64": "4.1.11", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.11", + "@tailwindcss/oxide-linux-arm64-gnu": "4.1.11", + "@tailwindcss/oxide-linux-arm64-musl": "4.1.11", + "@tailwindcss/oxide-linux-x64-gnu": "4.1.11", + "@tailwindcss/oxide-linux-x64-musl": "4.1.11", + "@tailwindcss/oxide-wasm32-wasi": "4.1.11", + "@tailwindcss/oxide-win32-arm64-msvc": "4.1.11", + "@tailwindcss/oxide-win32-x64-msvc": "4.1.11" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.1.11.tgz", + "integrity": "sha512-3IfFuATVRUMZZprEIx9OGDjG3Ou3jG4xQzNTvjDoKmU9JdmoCohQJ83MYd0GPnQIu89YoJqvMM0G3uqLRFtetg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.1.11.tgz", + "integrity": "sha512-ESgStEOEsyg8J5YcMb1xl8WFOXfeBmrhAwGsFxxB2CxY9evy63+AtpbDLAyRkJnxLy2WsD1qF13E97uQyP1lfQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.1.11.tgz", + "integrity": "sha512-EgnK8kRchgmgzG6jE10UQNaH9Mwi2n+yw1jWmof9Vyg2lpKNX2ioe7CJdf9M5f8V9uaQxInenZkOxnTVL3fhAw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.1.11.tgz", + "integrity": "sha512-xdqKtbpHs7pQhIKmqVpxStnY1skuNh4CtbcyOHeX1YBE0hArj2romsFGb6yUmzkq/6M24nkxDqU8GYrKrz+UcA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.1.11.tgz", + "integrity": "sha512-ryHQK2eyDYYMwB5wZL46uoxz2zzDZsFBwfjssgB7pzytAeCCa6glsiJGjhTEddq/4OsIjsLNMAiMlHNYnkEEeg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.1.11.tgz", + "integrity": "sha512-mYwqheq4BXF83j/w75ewkPJmPZIqqP1nhoghS9D57CLjsh3Nfq0m4ftTotRYtGnZd3eCztgbSPJ9QhfC91gDZQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.1.11.tgz", + "integrity": "sha512-m/NVRFNGlEHJrNVk3O6I9ggVuNjXHIPoD6bqay/pubtYC9QIdAMpS+cswZQPBLvVvEF6GtSNONbDkZrjWZXYNQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.1.11.tgz", + "integrity": "sha512-YW6sblI7xukSD2TdbbaeQVDysIm/UPJtObHJHKxDEcW2exAtY47j52f8jZXkqE1krdnkhCMGqP3dbniu1Te2Fg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.1.11.tgz", + "integrity": "sha512-e3C/RRhGunWYNC3aSF7exsQkdXzQ/M+aYuZHKnw4U7KQwTJotnWsGOIVih0s2qQzmEzOFIJ3+xt7iq67K/p56Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.1.11.tgz", + "integrity": "sha512-Xo1+/GU0JEN/C/dvcammKHzeM6NqKovG+6921MR6oadee5XPBaKOumrJCXvopJ/Qb5TH7LX/UAywbqrP4lax0g==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.4.3", + "@emnapi/runtime": "^1.4.3", + "@emnapi/wasi-threads": "^1.0.2", + "@napi-rs/wasm-runtime": "^0.2.11", + "@tybys/wasm-util": "^0.9.0", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.11.tgz", + "integrity": "sha512-UgKYx5PwEKrac3GPNPf6HVMNhUIGuUh4wlDFR2jYYdkX6pL/rn73zTq/4pzUm8fOjAn5L8zDeHp9iXmUGOXZ+w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.1.11.tgz", + "integrity": "sha512-YfHoggn1j0LK7wR82TOucWc5LDCguHnoS879idHekmmiR7g9HUtMw9MI0NHatS28u/Xlkfi9w5RJWgz2Dl+5Qg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/postcss": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/postcss/-/postcss-4.1.11.tgz", + "integrity": "sha512-q/EAIIpF6WpLhKEuQSEVMZNMIY8KhWoAemZ9eylNAih9jxMGAYPPWBn3I9QL/2jZ+e7OEz/tZkX5HwbBR4HohA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "@tailwindcss/node": "4.1.11", + "@tailwindcss/oxide": "4.1.11", + "postcss": "^8.4.41", + "tailwindcss": "4.1.11" + } + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -4889,7 +5191,6 @@ "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", "dev": true, "license": "Apache-2.0", - "optional": true, "engines": { "node": ">=8" } @@ -5078,6 +5379,20 @@ "once": "^1.4.0" } }, + "node_modules/enhanced-resolve": { + "version": "5.18.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz", + "integrity": "sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/entities": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", @@ -8788,6 +9103,16 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/jiti": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.5.1.tgz", + "integrity": "sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, "node_modules/js-tokens": { "version": "9.0.1", "dev": true, @@ -8995,6 +9320,245 @@ "node": ">= 0.8.0" } }, + "node_modules/lightningcss": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.30.1.tgz", + "integrity": "sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-darwin-arm64": "1.30.1", + "lightningcss-darwin-x64": "1.30.1", + "lightningcss-freebsd-x64": "1.30.1", + "lightningcss-linux-arm-gnueabihf": "1.30.1", + "lightningcss-linux-arm64-gnu": "1.30.1", + "lightningcss-linux-arm64-musl": "1.30.1", + "lightningcss-linux-x64-gnu": "1.30.1", + "lightningcss-linux-x64-musl": "1.30.1", + "lightningcss-win32-arm64-msvc": "1.30.1", + "lightningcss-win32-x64-msvc": "1.30.1" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.1.tgz", + "integrity": "sha512-c8JK7hyE65X1MHMN+Viq9n11RRC7hgin3HhYKhrMyaXflk5GVplZ60IxyoVtzILeKr+xAJwg6zK6sjTBJ0FKYQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.30.1.tgz", + "integrity": "sha512-k1EvjakfumAQoTfcXUcHQZhSpLlkAuEkdMBsI/ivWw9hL+7FtilQc0Cy3hrx0AAQrVtQAbMI7YjCgYgvn37PzA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.30.1.tgz", + "integrity": "sha512-kmW6UGCGg2PcyUE59K5r0kWfKPAVy4SltVeut+umLCFoJ53RdCUWxcRDzO1eTaxf/7Q2H7LTquFHPL5R+Gjyig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.30.1.tgz", + "integrity": "sha512-MjxUShl1v8pit+6D/zSPq9S9dQ2NPFSQwGvxBCYaBYLPlCWuPh9/t1MRS8iUaR8i+a6w7aps+B4N0S1TYP/R+Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.30.1.tgz", + "integrity": "sha512-gB72maP8rmrKsnKYy8XUuXi/4OctJiuQjcuqWNlJQ6jZiWqtPvqFziskH3hnajfvKB27ynbVCucKSm2rkQp4Bw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.30.1.tgz", + "integrity": "sha512-jmUQVx4331m6LIX+0wUhBbmMX7TCfjF5FoOH6SD1CttzuYlGNVpA7QnrmLxrsub43ClTINfGSYyHe2HWeLl5CQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.1.tgz", + "integrity": "sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.1.tgz", + "integrity": "sha512-rRomAK7eIkL+tHY0YPxbc5Dra2gXlI63HL+v1Pdi1a3sC+tJTcFrHX+E86sulgAXeI7rSzDYhPSeHHjqFhqfeQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.30.1.tgz", + "integrity": "sha512-mSL4rqPi4iXq5YVqzSsJgMVFENoa4nGTT/GjO2c0Yl9OuQfPsIfncvLrEW6RbbB24WtZ3xP/2CCmI3tNkNV4oA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.1.tgz", + "integrity": "sha512-PVqXh48wh4T53F/1CCu8PIPCxLzWyCnn/9T5W1Jpmdy5h9Cwd+0YQS6/LwhHXSafuc61/xg9Lv5OrCby6a++jg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -9425,6 +9989,29 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minizlib": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz", + "integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.1.2" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/mixin-deep": { "version": "1.3.2", "dev": true, @@ -12248,6 +12835,34 @@ "dev": true, "license": "MIT" }, + "node_modules/tapable": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.2.tgz", + "integrity": "sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/tar-fs": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.3.tgz", @@ -12280,6 +12895,42 @@ "node": ">=6" } }, + "node_modules/tar/node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/tar/node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -13524,6 +14175,7 @@ "@stackcode/i18n": "^1.0.3" }, "devDependencies": { + "@tailwindcss/postcss": "^4.1.11", "@types/jest": "^29.5.14", "@types/node": "^16.18.126", "@types/react": "^19.1.9", diff --git a/packages/vscode-extension/.vscode/settings.json b/packages/vscode-extension/.vscode/settings.json new file mode 100644 index 00000000..7572112e --- /dev/null +++ b/packages/vscode-extension/.vscode/settings.json @@ -0,0 +1,12 @@ +{ + "files.associations": { + "*.json": "jsonc", + "tsconfig*.json": "jsonc", + "launch.json": "jsonc", + "tasks.json": "jsonc", + "package.json": "jsonc" + }, + "json.schemaDownload.enable": true, + "jsonc.validate.enable": true, + "typescript.preferences.includePackageJsonAutoImports": "on" +} diff --git a/packages/vscode-extension/out/commands/BaseCommand.js b/packages/vscode-extension/out/commands/BaseCommand.js new file mode 100644 index 00000000..6cdfd572 --- /dev/null +++ b/packages/vscode-extension/out/commands/BaseCommand.js @@ -0,0 +1,58 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BaseCommand = void 0; +const vscode = __importStar(require("vscode")); +class BaseCommand { + async showError(message) { + vscode.window.showErrorMessage(`StackCode: ${message}`); + } + async showWarning(message) { + vscode.window.showWarningMessage(`StackCode: ${message}`); + } + async showInfo(message) { + vscode.window.showInformationMessage(`StackCode: ${message}`); + } + async showSuccess(message) { + vscode.window.showInformationMessage(`✅ ${message}`); + } + getCurrentWorkspaceFolder() { + return vscode.workspace.workspaceFolders?.[0]; + } + async runTerminalCommand(command, cwd) { + const terminal = vscode.window.createTerminal({ + name: "StackCode", + cwd: cwd || this.getCurrentWorkspaceFolder()?.uri.fsPath, + }); + terminal.sendText(command); + terminal.show(); + } + async confirmAction(message, confirmText = "Yes") { + const result = await vscode.window.showWarningMessage(message, { modal: true }, confirmText, "Cancel"); + return result === confirmText; + } +} +exports.BaseCommand = BaseCommand; +//# sourceMappingURL=BaseCommand.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/commands/BaseCommand.js.map b/packages/vscode-extension/out/commands/BaseCommand.js.map new file mode 100644 index 00000000..6b4c6573 --- /dev/null +++ b/packages/vscode-extension/out/commands/BaseCommand.js.map @@ -0,0 +1 @@ +{"version":3,"file":"BaseCommand.js","sourceRoot":"","sources":["../../src/commands/BaseCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAEjC,MAAsB,WAAW;IAGrB,KAAK,CAAC,SAAS,CAAC,OAAe;QACvC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC;IAC1D,CAAC;IAES,KAAK,CAAC,WAAW,CAAC,OAAe;QACzC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;IAES,KAAK,CAAC,QAAQ,CAAC,OAAe;QACtC,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAES,KAAK,CAAC,WAAW,CAAC,OAAe;QACzC,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;IACvD,CAAC;IAES,yBAAyB;QACjC,OAAO,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC;IAChD,CAAC;IAES,KAAK,CAAC,kBAAkB,CAChC,OAAe,EACf,GAAY;QAEZ,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;YAC5C,IAAI,EAAE,WAAW;YACjB,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,yBAAyB,EAAE,EAAE,GAAG,CAAC,MAAM;SACzD,CAAC,CAAC;QACH,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC3B,QAAQ,CAAC,IAAI,EAAE,CAAC;IAClB,CAAC;IAES,KAAK,CAAC,aAAa,CAC3B,OAAe,EACf,cAAsB,KAAK;QAE3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,kBAAkB,CACnD,OAAO,EACP,EAAE,KAAK,EAAE,IAAI,EAAE,EACf,WAAW,EACX,QAAQ,CACT,CAAC;QACF,OAAO,MAAM,KAAK,WAAW,CAAC;IAChC,CAAC;CACF;AA/CD,kCA+CC"} \ No newline at end of file diff --git a/packages/vscode-extension/out/commands/CommitCommand.js b/packages/vscode-extension/out/commands/CommitCommand.js new file mode 100644 index 00000000..e9c8d180 --- /dev/null +++ b/packages/vscode-extension/out/commands/CommitCommand.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CommitCommand = void 0; +const BaseCommand_1 = require("./BaseCommand"); +class CommitCommand extends BaseCommand_1.BaseCommand { + async execute() { + try { + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + 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!"); + } + catch (error) { + this.showError(`Failed to open commit dialog: ${error}`); + } + } +} +exports.CommitCommand = CommitCommand; +//# sourceMappingURL=CommitCommand.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/commands/CommitCommand.js.map b/packages/vscode-extension/out/commands/CommitCommand.js.map new file mode 100644 index 00000000..c1707cd4 --- /dev/null +++ b/packages/vscode-extension/out/commands/CommitCommand.js.map @@ -0,0 +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 diff --git a/packages/vscode-extension/out/commands/ConfigCommand.js b/packages/vscode-extension/out/commands/ConfigCommand.js new file mode 100644 index 00000000..62dabaac --- /dev/null +++ b/packages/vscode-extension/out/commands/ConfigCommand.js @@ -0,0 +1,82 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConfigCommand = void 0; +const vscode = __importStar(require("vscode")); +const BaseCommand_1 = require("./BaseCommand"); +class ConfigCommand extends BaseCommand_1.BaseCommand { + async execute() { + try { + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + return; + } + const action = await vscode.window.showQuickPick([ + { + label: "Open StackCode Settings", + description: "Configure StackCode extension settings", + }, + { + label: "Open Project Config", + description: "Edit .stackcoderc.json file", + }, + { + label: "Create Project Config", + description: "Create a new .stackcoderc.json file", + }, + ], { + placeHolder: "What would you like to configure?", + }); + if (!action) { + return; + } + if (action.label === "Open StackCode Settings") { + vscode.commands.executeCommand("workbench.action.openSettings", "stackcode"); + } + else if (action.label === "Open Project Config") { + const configPath = vscode.Uri.joinPath(workspaceFolder.uri, ".stackcoderc.json"); + try { + 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.'); + } + } + else if (action.label === "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!"); + } + } + catch (error) { + this.showError(`Failed to open configuration: ${error}`); + } + } +} +exports.ConfigCommand = ConfigCommand; +//# sourceMappingURL=ConfigCommand.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/commands/ConfigCommand.js.map b/packages/vscode-extension/out/commands/ConfigCommand.js.map new file mode 100644 index 00000000..9dc1b121 --- /dev/null +++ b/packages/vscode-extension/out/commands/ConfigCommand.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ConfigCommand.js","sourceR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E,CAAC;iBACH;aACF;iBAAM,IAAI,MAAM,CAAC,KAAK,KAAK,uBAAuB,EAAE;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 diff --git a/packages/vscode-extension/out/commands/GenerateCommand.js b/packages/vscode-extension/out/commands/GenerateCommand.js new file mode 100644 index 00000000..2030b473 --- /dev/null +++ b/packages/vscode-extension/out/commands/GenerateCommand.js @@ -0,0 +1,181 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GenerateCommand = void 0; +const vscode = __importStar(require("vscode")); +const BaseCommand_1 = require("./BaseCommand"); +const path = __importStar(require("path")); +class GenerateCommand extends BaseCommand_1.BaseCommand { + async execute() { + const option = await vscode.window.showQuickPick([ + { + label: "README.md", + description: "Generate a comprehensive README file", + }, + { + label: ".gitignore", + description: "Generate a .gitignore file based on project type", + }, + { + label: "Both", + description: "Generate both README.md and .gitignore", + }, + ], { + placeHolder: "What would you like to generate?", + }); + if (!option) { + return; + } + if (option.label === "README.md") { + await this.generateReadme(); + } + else if (option.label === ".gitignore") { + await this.generateGitignore(); + } + else if (option.label === "Both") { + await this.generateReadme(); + await this.generateGitignore(); + } + } + async generateReadme() { + try { + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + return; + } + const readmePath = path.join(workspaceFolder.uri.fsPath, "README.md"); + // Check if README already exists + 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"); + if (!overwrite) { + return; + } + } + catch { + // File doesn't exist, which is fine + } + vscode.window.withProgress({ + location: vscode.ProgressLocation.Notification, + title: "Generating README.md", + cancellable: false, + }, async (progress) => { + progress.report({ + increment: 0, + message: "Analyzing project structure...", + }); + // Use StackCode CLI for generation + const command = `npx @stackcode/cli generate readme`; + progress.report({ increment: 50, message: "Generating content..." }); + await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); + progress.report({ + increment: 100, + message: "README.md generated successfully!", + }); + }); + this.showSuccess("README.md has been generated successfully!"); + // 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"); + if (openFile === "Open File") { + const document = await vscode.workspace.openTextDocument(readmePath); + await vscode.window.showTextDocument(document); + } + } + catch (error) { + this.showError(`Failed to generate README.md: ${error}`); + } + } + async generateGitignore() { + try { + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + return; + } + const gitignorePath = path.join(workspaceFolder.uri.fsPath, ".gitignore"); + // Check if .gitignore already exists + 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"); + if (!overwrite) { + return; + } + } + catch { + // File doesn't exist, which is fine + } + // 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" }, + ], { + placeHolder: "Select project type for .gitignore", + }); + if (!projectType) { + return; + } + vscode.window.withProgress({ + location: vscode.ProgressLocation.Notification, + title: "Generating .gitignore", + cancellable: false, + }, async (progress) => { + progress.report({ + increment: 0, + message: "Generating .gitignore content...", + }); + // Use StackCode CLI for generation + const command = `npx @stackcode/cli generate gitignore --type="${projectType.label}"`; + progress.report({ increment: 50, message: "Creating file..." }); + await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); + progress.report({ + increment: 100, + message: ".gitignore generated successfully!", + }); + }); + this.showSuccess(".gitignore has been generated successfully!"); + // Ask if user wants to open the file + const openFile = await vscode.window.showInformationMessage("Would you like to open the generated .gitignore?", "Open File"); + if (openFile === "Open File") { + const document = await vscode.workspace.openTextDocument(gitignorePath); + await vscode.window.showTextDocument(document); + } + } + catch (error) { + this.showError(`Failed to generate .gitignore: ${error}`); + } + } +} +exports.GenerateCommand = GenerateCommand; +//# sourceMappingURL=GenerateCommand.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/commands/GenerateCommand.js.map b/packages/vscode-extension/out/commands/GenerateCommand.js.map new file mode 100644 index 00000000..8ed223eb --- /dev/null +++ b/packages/vscode-extension/out/commands/GenerateCommand.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GenerateCommand.js","sourceRoot":"","sources":["../../src/commands/GenerateCommand.ts"],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sBAAsB,CACzD,kDAAkD,EAClD,WAAW,CACZ,CAAC;YAEF,IAAI,QAAQ,KAAK,WAAW,EAAE;gBAC5B,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,kCAAkC,KAAK,EAAE,CAAC,CAAC;SAC3D;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 new file mode 100644 index 00000000..9f7b76fe --- /dev/null +++ b/packages/vscode-extension/out/commands/GitCommand.js @@ -0,0 +1,155 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GitCommand = void 0; +const vscode = __importStar(require("vscode")); +const BaseCommand_1 = require("./BaseCommand"); +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" }, + ], { + placeHolder: "Select Git action", + }); + if (!action) { + return; + } + if (action.label === "start") { + await this.startBranch(); + } + else if (action.label === "finish") { + await this.finishBranch(); + } + } + async startBranch() { + try { + const branchName = await vscode.window.showInputBox({ + prompt: "Enter the name for the new branch", + placeHolder: "new-feature", + validateInput: (value) => { + if (!value) { + return "Branch name is required"; + } + if (!/^[a-zA-Z0-9/_-]+$/.test(value)) { + return "Branch name can only contain letters, numbers, hyphens, underscores and slashes"; + } + return null; + }, + }); + if (!branchName) { + return; + } + 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" }, + ], { + placeHolder: "Select branch type", + }); + if (!branchType) { + return; + } + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + return; + } + vscode.window.withProgress({ + location: vscode.ProgressLocation.Notification, + title: `Creating ${branchType.label} branch: ${branchName}`, + cancellable: false, + }, async (progress) => { + progress.report({ increment: 0, message: "Creating branch..." }); + // 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...", + }); + await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); + progress.report({ + increment: 100, + message: "Branch created successfully!", + }); + }); + this.showSuccess(`Branch ${branchType.label}/${branchName} has been created and checked out!`); + } + catch (error) { + this.showError(`Failed to create branch: ${error}`); + } + } + async finishBranch() { + try { + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + return; + } + // Get current branch name + const gitExtension = vscode.extensions.getExtension("vscode.git"); + let currentBranch = "current branch"; + if (gitExtension && gitExtension.isActive) { + try { + const git = gitExtension.exports; + const api = git.getAPI(1); + const repo = api.repositories[0]; + if (repo && repo.state.HEAD) { + currentBranch = repo.state.HEAD.name || "current branch"; + } + } + catch { + // Fallback to generic message + } + } + const confirm = await this.confirmAction(`Are you sure you want to finish ${currentBranch}? This will merge it back to the base branch.`, "Finish Branch"); + if (!confirm) { + return; + } + vscode.window.withProgress({ + location: vscode.ProgressLocation.Notification, + title: `Finishing branch: ${currentBranch}`, + cancellable: false, + }, async (progress) => { + progress.report({ increment: 0, message: "Merging branch..." }); + // Use StackCode CLI for git operations + const command = `npx @stackcode/cli git finish`; + progress.report({ increment: 50, message: "Cleaning up..." }); + await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); + progress.report({ + increment: 100, + message: "Branch finished successfully!", + }); + }); + this.showSuccess(`Branch ${currentBranch} has been finished and merged!`); + } + catch (error) { + this.showError(`Failed to finish branch: ${error}`); + } + } +} +exports.GitCommand = GitCommand; +//# sourceMappingURL=GitCommand.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/commands/GitCommand.js.map b/packages/vscode-extension/out/commands/GitCommand.js.map new file mode 100644 index 00000000..18b4912f --- /dev/null +++ b/packages/vscode-extension/out/commands/GitCommand.js.map @@ -0,0 +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;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C,CAAC,CAAC;YACL,CAAC,CACF,CAAC;YAEF,IAAI,CAAC,WAAW,CAAC,UAAU,aAAa,gCAAgC,CAAC,CAAC;SAC3E;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,4BAA4B,KAAK,EAAE,CAAC,CAAC;SACrD;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 new file mode 100644 index 00000000..7dc17cbf --- /dev/null +++ b/packages/vscode-extension/out/commands/InitCommand.js @@ -0,0 +1,150 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InitCommand = void 0; +const vscode = __importStar(require("vscode")); +const BaseCommand_1 = require("./BaseCommand"); +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", + validateInput: (value) => { + if (!value) { + return "Project name is required"; + } + if (!/^[a-zA-Z0-9-_]+$/.test(value)) { + return "Project name can only contain letters, numbers, hyphens and underscores"; + } + return null; + }, + }); + if (!projectName) { + return; + } + const description = await vscode.window.showInputBox({ + prompt: "Enter project description", + placeHolder: "A brief description of your project", + }); + const authorName = await vscode.window.showInputBox({ + prompt: "Enter author name", + placeHolder: "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" }, + ], { + placeHolder: "Select project stack", + }); + if (!stack) { + return; + } + // Get workspace folder or ask for project location + const workspaceFolder = this.getCurrentWorkspaceFolder(); + let projectPath; + if (workspaceFolder) { + projectPath = path.join(workspaceFolder.uri.fsPath, projectName); + } + else { + const folderUris = await vscode.window.showOpenDialog({ + canSelectFolders: true, + canSelectFiles: false, + canSelectMany: false, + openLabel: "Select Project Location", + }); + if (!folderUris || folderUris.length === 0) { + return; + } + projectPath = path.join(folderUris[0].fsPath, projectName); + } + // Check if directory exists + 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"); + if (!overwrite) { + return; + } + } + catch { + // Directory doesn't exist, which is fine + } + // Show progress + vscode.window.withProgress({ + location: vscode.ProgressLocation.Notification, + title: `Initializing project ${projectName}`, + cancellable: false, + }, async (progress) => { + progress.report({ + increment: 0, + message: "Setting up project 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...", + }); + await this.runTerminalCommand(command); + progress.report({ + increment: 100, + message: "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"); + if (openProject === "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}`); + } + } + async getGitUserName() { + try { + // Try to get git user name from workspace + const terminal = vscode.window.createTerminal({ name: "temp" }); + terminal.sendText("git config user.name"); + terminal.dispose(); + return ""; + } + catch { + return ""; + } + } +} +exports.InitCommand = InitCommand; +//# sourceMappingURL=InitCommand.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/commands/InitCommand.js.map b/packages/vscode-extension/out/commands/InitCommand.js.map new file mode 100644 index 00000000..889e1cee --- /dev/null +++ b/packages/vscode-extension/out/commands/InitCommand.js.map @@ -0,0 +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,EAAE,EAAE;oBAC/B,IAAI,CAAC,KAAK,EAAE;wBACV,OAAO,0BAA0B,CAAC;qBACnC;oBACD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;wBACnC,OAAO,yEAAyE,CAAC;qBAClF;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,2BAA2B;gBAC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,CAAC;gBAEvC,QAAQ,CAAC,MAAM,CAAC;oBACd,SAAS,EAAE,GAAG;oBACd,OAAO,EAAE,mCAAmC;iBAC7C,CAAC,CAAC;YACL,CAAC,CACF,CAAC;YAEF,4CAA4C;YAC5C,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAC5D,WAAW,WAAW,4DAA4D,EAClF,cAAc,EACd,OAAO,CACR,CAAC;YAEF,IAAI,WAAW,KAAK,cAAc,EAAE;gBAClC,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACzC,MAAM,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,mBAAmB,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;aACtE;SACF;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,iCAAiC,KAAK,EAAE,CAAC,CAAC;SAC1D;IACH,CAAC;IAEO,KAAK,CAAC,cAAc;QAC1B,IAAI;YACF,0CAA0C;YAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;YAChE,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,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 new file mode 100644 index 00000000..d081e393 --- /dev/null +++ b/packages/vscode-extension/out/commands/ReleaseCommand.js @@ -0,0 +1,61 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReleaseCommand = void 0; +const vscode = __importStar(require("vscode")); +const BaseCommand_1 = require("./BaseCommand"); +class ReleaseCommand extends BaseCommand_1.BaseCommand { + async execute() { + try { + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + 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"); + if (!confirm) { + return; + } + vscode.window.withProgress({ + location: vscode.ProgressLocation.Notification, + title: "Creating release", + cancellable: false, + }, async (progress) => { + progress.report({ increment: 0, message: "Preparing release..." }); + // Use StackCode CLI for release + const command = `npx @stackcode/cli release`; + progress.report({ increment: 50, message: "Creating release..." }); + await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); + progress.report({ increment: 100, message: "Release created!" }); + }); + this.showSuccess("Release process started! Check terminal for progress."); + } + catch (error) { + this.showError(`Failed to create release: ${error}`); + } + } +} +exports.ReleaseCommand = ReleaseCommand; +//# sourceMappingURL=ReleaseCommand.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/commands/ReleaseCommand.js.map b/packages/vscode-extension/out/commands/ReleaseCommand.js.map new file mode 100644 index 00000000..26882c51 --- /dev/null +++ b/packages/vscode-extension/out/commands/ReleaseCommand.js.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,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 diff --git a/packages/vscode-extension/out/commands/ValidateCommand.js b/packages/vscode-extension/out/commands/ValidateCommand.js new file mode 100644 index 00000000..ff108bb0 --- /dev/null +++ b/packages/vscode-extension/out/commands/ValidateCommand.js @@ -0,0 +1,60 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValidateCommand = void 0; +const vscode = __importStar(require("vscode")); +const BaseCommand_1 = require("./BaseCommand"); +class ValidateCommand extends BaseCommand_1.BaseCommand { + async execute() { + try { + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + return; + } + vscode.window.withProgress({ + location: vscode.ProgressLocation.Notification, + title: "Validating project structure", + cancellable: false, + }, async (progress) => { + progress.report({ increment: 0, message: "Running validation..." }); + // Use StackCode CLI for validation + const command = `npx @stackcode/cli validate`; + progress.report({ + increment: 50, + message: "Checking project structure...", + }); + await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); + progress.report({ increment: 100, message: "Validation completed!" }); + }); + this.showSuccess("Project validation completed! Check terminal for results."); + } + catch (error) { + this.showError(`Failed to validate project: ${error}`); + } + } +} +exports.ValidateCommand = ValidateCommand; +//# sourceMappingURL=ValidateCommand.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/commands/ValidateCommand.js.map b/packages/vscode-extension/out/commands/ValidateCommand.js.map new file mode 100644 index 00000000..b6ca6789 --- /dev/null +++ b/packages/vscode-extension/out/commands/ValidateCommand.js.map @@ -0,0 +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 diff --git a/packages/vscode-extension/out/config/ConfigurationManager.js b/packages/vscode-extension/out/config/ConfigurationManager.js new file mode 100644 index 00000000..51c03700 --- /dev/null +++ b/packages/vscode-extension/out/config/ConfigurationManager.js @@ -0,0 +1,64 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConfigurationManager = void 0; +const vscode = __importStar(require("vscode")); +class ConfigurationManager { + constructor() { + this.configuration = vscode.workspace.getConfiguration("stackcode"); + // Listen for configuration changes + vscode.workspace.onDidChangeConfiguration((event) => { + if (event.affectsConfiguration("stackcode")) { + this.configuration = vscode.workspace.getConfiguration("stackcode"); + } + }); + } + get notificationsEnabled() { + return this.configuration.get("notifications.enabled", true); + } + get branchCheckEnabled() { + return this.configuration.get("notifications.branchCheck", true); + } + get commitCheckEnabled() { + return this.configuration.get("notifications.commitCheck", true); + } + get autoGenerateReadme() { + return this.configuration.get("autoGenerate.readme", false); + } + get autoGenerateGitignore() { + return this.configuration.get("autoGenerate.gitignore", true); + } + get defaultBranchType() { + return this.configuration.get("git.defaultBranchType", "feature"); + } + get dashboardAutoOpen() { + return this.configuration.get("dashboard.autoOpen", false); + } + async updateConfiguration(key, value) { + await this.configuration.update(key, value, vscode.ConfigurationTarget.Workspace); + } +} +exports.ConfigurationManager = ConfigurationManager; +//# sourceMappingURL=ConfigurationManager.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/config/ConfigurationManager.js.map b/packages/vscode-extension/out/config/ConfigurationManager.js.map new file mode 100644 index 00000000..6bd5776c --- /dev/null +++ b/packages/vscode-extension/out/config/ConfigurationManager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ConfigurationManager.js","sourceRoot":"","sources":["../../src/config/ConfigurationManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAEjC,MAAa,oBAAoB;IAG/B;QACE,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;QAEpE,mCAAmC;QACnC,MAAM,CAAC,SAAS,CAAC,wBAAwB,CACvC,CAAC,KAAsC,EAAE,EAAE;YACzC,IAAI,KAAK,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE;gBAC3C,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;aACrE;QACH,CAAC,CACF,CAAC;IACJ,CAAC;IAED,IAAI,oBAAoB;QACtB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,2BAA2B,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,2BAA2B,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC;IAED,IAAI,qBAAqB;QACvB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC;IAChE,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC;IACpE,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,GAAW,EAAE,KAAc;QACnD,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAC7B,GAAG,EACH,KAAK,EACL,MAAM,CAAC,mBAAmB,CAAC,SAAS,CACrC,CAAC;IACJ,CAAC;CACF;AAnDD,oDAmDC"} \ No newline at end of file diff --git a/packages/vscode-extension/out/extension.js b/packages/vscode-extension/out/extension.js new file mode 100644 index 00000000..b6b21ab3 --- /dev/null +++ b/packages/vscode-extension/out/extension.js @@ -0,0 +1,137 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.deactivate = exports.activate = void 0; +const vscode = __importStar(require("vscode")); +const ProactiveNotificationManager_1 = require("./notifications/ProactiveNotificationManager"); +const GitMonitor_1 = require("./monitors/GitMonitor"); +const FileMonitor_1 = require("./monitors/FileMonitor"); +const ConfigurationManager_1 = require("./config/ConfigurationManager"); +const InitCommand_1 = require("./commands/InitCommand"); +const GenerateCommand_1 = require("./commands/GenerateCommand"); +const GitCommand_1 = require("./commands/GitCommand"); +const CommitCommand_1 = require("./commands/CommitCommand"); +const ValidateCommand_1 = require("./commands/ValidateCommand"); +const ReleaseCommand_1 = require("./commands/ReleaseCommand"); +const ConfigCommand_1 = require("./commands/ConfigCommand"); +const DashboardProvider_1 = require("./providers/DashboardProvider"); +const ProjectViewProvider_1 = require("./providers/ProjectViewProvider"); +let proactiveManager; +let gitMonitor; +let fileMonitor; +let configManager; +let dashboardProvider; +let projectViewProvider; +// Command instances +let initCommand; +let generateCommand; +let gitCommand; +let commitCommand; +let validateCommand; +let releaseCommand; +let configCommand; +function activate(context) { + console.log("[StackCode] Extension is now active!"); + console.log("[StackCode] Workspace folders:", vscode.workspace.workspaceFolders?.length || 0); + console.log("[StackCode] Extension path:", context.extensionPath); + // Initialize configuration manager + configManager = new ConfigurationManager_1.ConfigurationManager(); + // Initialize notification manager + proactiveManager = new ProactiveNotificationManager_1.ProactiveNotificationManager(configManager); + // Initialize monitors + gitMonitor = new GitMonitor_1.GitMonitor(proactiveManager, configManager); + fileMonitor = new FileMonitor_1.FileMonitor(proactiveManager, configManager); + // Initialize providers + dashboardProvider = new DashboardProvider_1.DashboardProvider(context); + projectViewProvider = new ProjectViewProvider_1.ProjectViewProvider(context.workspaceState); + // Initialize commands + initCommand = new InitCommand_1.InitCommand(); + generateCommand = new GenerateCommand_1.GenerateCommand(); + gitCommand = new GitCommand_1.GitCommand(); + commitCommand = new CommitCommand_1.CommitCommand(); + validateCommand = new ValidateCommand_1.ValidateCommand(); + releaseCommand = new ReleaseCommand_1.ReleaseCommand(); + configCommand = new ConfigCommand_1.ConfigCommand(); + // Register webview providers + context.subscriptions.push(vscode.window.registerWebviewViewProvider("stackcode.dashboard", dashboardProvider), vscode.window.registerTreeDataProvider("stackcode.projectView", projectViewProvider)); + // Register all commands + const commands = [ + // Core functionality commands + vscode.commands.registerCommand("stackcode.init", () => initCommand.execute()), + vscode.commands.registerCommand("stackcode.generate.readme", () => generateCommand.generateReadme()), + vscode.commands.registerCommand("stackcode.generate.gitignore", () => generateCommand.generateGitignore()), + vscode.commands.registerCommand("stackcode.git.start", () => gitCommand.startBranch()), + vscode.commands.registerCommand("stackcode.git.finish", () => gitCommand.finishBranch()), + vscode.commands.registerCommand("stackcode.commit", () => commitCommand.execute()), + vscode.commands.registerCommand("stackcode.validate", () => validateCommand.execute()), + vscode.commands.registerCommand("stackcode.release", () => releaseCommand.execute()), + vscode.commands.registerCommand("stackcode.config", () => configCommand.execute()), + vscode.commands.registerCommand("stackcode.dashboard", () => dashboardProvider.show()), + // Legacy commands for backward compatibility + vscode.commands.registerCommand("stackcode.createBranch", () => gitCommand.startBranch()), + vscode.commands.registerCommand("stackcode.formatCommitMessage", () => commitCommand.execute()), + vscode.commands.registerCommand("stackcode.checkBestPractices", () => validateCommand.execute()), + // Project view commands + vscode.commands.registerCommand("stackcode.projectView.refresh", () => projectViewProvider.refresh()), + // Webview commands + vscode.commands.registerCommand("webviewReady", () => { + console.log("[StackCode] Webview is ready!"); + // Pode enviar dados iniciais aqui se necessário + }), + vscode.commands.registerCommand("stackcode.webview.init", () => initCommand.execute()), + vscode.commands.registerCommand("stackcode.webview.generate.readme", () => generateCommand.generateReadme()), + vscode.commands.registerCommand("stackcode.webview.generate.gitignore", () => generateCommand.generateGitignore()), + vscode.commands.registerCommand("stackcode.webview.git.start", () => gitCommand.startBranch()), + vscode.commands.registerCommand("stackcode.webview.commit", () => commitCommand.execute()), + vscode.commands.registerCommand("stackcode.webview.validate", () => validateCommand.execute()), + ]; + // Add all to context subscriptions for cleanup + context.subscriptions.push(...commands, gitMonitor, fileMonitor, proactiveManager, dashboardProvider); + // Start monitoring + gitMonitor.startMonitoring(); + fileMonitor.startMonitoring(); + // Auto-open dashboard if configured + if (configManager.dashboardAutoOpen) { + setTimeout(() => { + dashboardProvider.show(); + }, 1000); + } + // Show welcome message + proactiveManager.showWelcomeMessage(); +} +exports.activate = activate; +function deactivate() { + if (gitMonitor) { + gitMonitor.dispose(); + } + if (fileMonitor) { + fileMonitor.dispose(); + } + if (proactiveManager) { + proactiveManager.dispose(); + } +} +exports.deactivate = deactivate; +//# sourceMappingURL=extension.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/extension.js.map b/packages/vscode-extension/out/extension.js.map new file mode 100644 index 00000000..237d6608 --- /dev/null +++ b/packages/vscode-extension/out/extension.js.map @@ -0,0 +1 @@ +{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,+FAA4F;AAC5F,sDAAmD;AACnD,wDAAqD;AACrD,wEAAqE;AACrE,wDAAqD;AACrD,gEAA6D;AAC7D,sDAAmD;AACnD,4DAAyD;AACzD,gEAA6D;AAC7D,8DAA2D;AAC3D,4DAAyD;AACzD,qEAAkE;AAClE,yEAAsE;AAEtE,IAAI,gBAA8C,CAAC;AACnD,IAAI,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,EAAE,CACzB;QACD,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,0BAA0B,EAAE,GAAG,EAAE,CAC/D,aAAa,CAAC,OAAO,EAAE,CACxB;QACD,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,4BAA4B,EAAE,GAAG,EAAE,CACjE,eAAe,CAAC,OAAO,EAAE,CAC1B;KACF,CAAC;IAEF,+CAA+C;IAC/C,OAAO,CAAC,aAAa,CAAC,IAAI,CACxB,GAAG,QAAQ,EACX,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,iBAAiB,CAClB,CAAC;IAEF,mBAAmB;IACnB,UAAU,CAAC,eAAe,EAAE,CAAC;IAC7B,WAAW,CAAC,eAAe,EAAE,CAAC;IAE9B,oCAAoC;IACpC,IAAI,aAAa,CAAC,iBAAiB,EAAE;QACnC,UAAU,CAAC,GAAG,EAAE;YACd,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAC3B,CAAC,EAAE,IAAI,CAAC,CAAC;KACV;IAED,uBAAuB;IACvB,gBAAgB,CAAC,kBAAkB,EAAE,CAAC;AACxC,CAAC;AAzID,4BAyIC;AAED,SAAgB,UAAU;IACxB,IAAI,UAAU,EAAE;QACd,UAAU,CAAC,OAAO,EAAE,CAAC;KACtB;IACD,IAAI,WAAW,EAAE;QACf,WAAW,CAAC,OAAO,EAAE,CAAC;KACvB;IACD,IAAI,gBAAgB,EAAE;QACpB,gBAAgB,CAAC,OAAO,EAAE,CAAC;KAC5B;AACH,CAAC;AAVD,gCAUC"} \ No newline at end of file diff --git a/packages/vscode-extension/out/monitors/FileMonitor.js b/packages/vscode-extension/out/monitors/FileMonitor.js new file mode 100644 index 00000000..8b390b56 --- /dev/null +++ b/packages/vscode-extension/out/monitors/FileMonitor.js @@ -0,0 +1,137 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FileMonitor = void 0; +const vscode = __importStar(require("vscode")); +class FileMonitor { + constructor(proactiveManager, configManager) { + this.disposables = []; + this.processedFiles = new Set(); + this.proactiveManager = proactiveManager; + this.configManager = configManager; + } + startMonitoring() { + // Monitor file creation + this.disposables.push(vscode.workspace.onDidCreateFiles((event) => { + for (const file of event.files) { + this.handleFileCreation(file); + } + })); + // Monitor file changes + this.disposables.push(vscode.workspace.onDidChangeTextDocument((event) => { + this.handleFileChange(event); + })); + // Monitor when files are opened + this.disposables.push(vscode.window.onDidChangeActiveTextEditor((editor) => { + if (editor) { + this.handleFileOpen(editor.document.uri); + } + })); + } + async handleFileCreation(fileUri) { + if (!this.configManager.notificationsEnabled) { + return; + } + const fileName = fileUri.path.split("/").pop() || ""; + const fileKey = `${fileUri.toString()}-created`; + if (this.processedFiles.has(fileKey)) { + return; + } + this.processedFiles.add(fileKey); + // Suggest generating comprehensive files + if (["README.md", ".gitignore"].includes(fileName)) { + await this.proactiveManager.showFileCreationSuggestion(fileName); + } + } + async handleFileChange(event) { + const document = event.document; + // Skip if not a git commit message + if (!document.fileName.includes("COMMIT_EDITMSG")) { + return; + } + const content = document.getText(); + if (content.trim()) { + await this.proactiveManager.showCommitMessageWarning(content); + } + } + async handleFileOpen(fileUri) { + const fileName = fileUri.path.split("/").pop() || ""; + const fileKey = `${fileUri.toString()}-opened`; + if (this.processedFiles.has(fileKey)) { + return; + } + this.processedFiles.add(fileKey); + // Check for missing important files when opening project files + if (fileName.endsWith(".js") || + fileName.endsWith(".ts") || + fileName.endsWith(".json")) { + await this.checkProjectStructure(); + } + } + async checkProjectStructure() { + if (!this.configManager.notificationsEnabled) { + return; + } + const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; + if (!workspaceFolder) { + return; + } + try { + const files = await vscode.workspace.fs.readDirectory(workspaceFolder.uri); + const fileNames = files.map(([name]) => name); + const missingFiles = []; + if (!fileNames.includes("README.md")) { + missingFiles.push("README.md"); + } + if (!fileNames.includes(".gitignore")) { + missingFiles.push(".gitignore"); + } + 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 action = await vscode.window.showInformationMessage(message, "Generate Files", "Not Now", "Don't Show Again"); + if (action === "Generate Files") { + // TODO: Implement file generation + vscode.window.showInformationMessage("File generation will be available soon!"); + } + else if (action === "Don't Show Again") { + await this.configManager.updateConfiguration("notifications.enabled", false); + } + } + } + catch (error) { + // Use proper VS Code logging instead of console.log + const outputChannel = vscode.window.createOutputChannel("StackCode"); + outputChannel.appendLine(`Error checking project structure: ${error}`); + } + } + dispose() { + this.disposables.forEach((d) => d.dispose()); + this.disposables = []; + this.processedFiles.clear(); + } +} +exports.FileMonitor = FileMonitor; +//# sourceMappingURL=FileMonitor.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/monitors/FileMonitor.js.map b/packages/vscode-extension/out/monitors/FileMonitor.js.map new file mode 100644 index 00000000..acfb96c2 --- /dev/null +++ b/packages/vscode-extension/out/monitors/FileMonitor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"FileMonitor.js","sourceRoot":"","sources":["../../src/monitors/FileMonitor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;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AAM,CAAC,sBAAsB,CAClC,yCAAyC,CAC1C,CAAC;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 diff --git a/packages/vscode-extension/out/monitors/GitMonitor.js b/packages/vscode-extension/out/monitors/GitMonitor.js new file mode 100644 index 00000000..078f0430 --- /dev/null +++ b/packages/vscode-extension/out/monitors/GitMonitor.js @@ -0,0 +1,190 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GitMonitor = void 0; +const vscode = __importStar(require("vscode")); +class GitMonitor { + constructor(proactiveManager, configManager) { + this.disposables = []; + this.proactiveManager = proactiveManager; + this.configManager = configManager; + } + startMonitoring() { + // Monitor git extension state changes + const gitExtension = vscode.extensions.getExtension("vscode.git"); + if (gitExtension) { + if (gitExtension.isActive) { + this.setupGitMonitoring(); + } + else { + gitExtension.activate().then(() => { + this.setupGitMonitoring(); + }); + } + } + // Monitor workspace folder changes + this.disposables.push(vscode.workspace.onDidChangeWorkspaceFolders(() => { + this.checkCurrentBranch(); + })); + // Initial check + setTimeout(() => { + this.checkCurrentBranch(); + }, 2000); + } + setupGitMonitoring() { + try { + const git = vscode.extensions.getExtension("vscode.git")?.exports; + if (git) { + const gitAPI = git.getAPI(1); + this.disposables.push(gitAPI.onDidChangeState(() => { + this.checkCurrentBranch(); + })); + this.disposables.push(gitAPI.onDidOpenRepository(() => { + this.checkCurrentBranch(); + })); + } + } + catch (error) { + console.log("Failed to setup git monitoring:", error); + } + } + async checkCurrentBranch() { + try { + const git = vscode.extensions.getExtension("vscode.git")?.exports; + if (git) { + const gitAPI = git.getAPI(1); + const repo = gitAPI.repositories[0]; + if (repo && repo.state.HEAD) { + const currentBranch = repo.state.HEAD.name; + if (currentBranch && currentBranch !== this.lastBranch) { + this.lastBranch = currentBranch; + await this.proactiveManager.showBranchWarning(currentBranch); + } + } + } + } + catch (error) { + console.log("Error checking current branch:", error); + } + } + async showCreateBranchDialog() { + const branchName = await vscode.window.showInputBox({ + prompt: "Enter the name for the new branch", + placeHolder: "feature/new-feature", + validateInput: (value) => { + if (!value) { + return "Branch name is required"; + } + if (!/^[a-zA-Z0-9/_-]+$/.test(value)) { + return "Branch name can only contain letters, numbers, hyphens, underscores and slashes"; + } + return null; + }, + }); + if (branchName) { + 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" }, + ], { + placeHolder: "Select branch type", + }); + if (branchType) { + const fullBranchName = branchName.includes("/") + ? branchName + : `${branchType.label}/${branchName}`; + try { + const terminal = vscode.window.createTerminal("StackCode Git"); + terminal.sendText(`git checkout -b ${fullBranchName}`); + terminal.show(); + vscode.window.showInformationMessage(`✅ Created and switched to branch: ${fullBranchName}`); + } + catch (error) { + vscode.window.showErrorMessage(`Failed to create branch: ${error}`); + } + } + } + } + async showCommitMessageDialog() { + const commitType = await vscode.window.showQuickPick([ + { label: "feat", description: "A new feature" }, + { label: "fix", description: "A bug fix" }, + { label: "docs", description: "Documentation changes" }, + { label: "style", description: "Code style changes (formatting, etc)" }, + { label: "refactor", description: "Code refactoring" }, + { label: "perf", description: "Performance improvements" }, + { label: "test", description: "Adding or updating tests" }, + { label: "chore", description: "Maintenance tasks" }, + { label: "build", description: "Build system changes" }, + { label: "ci", description: "CI/CD changes" }, + ], { + placeHolder: "Select commit type", + }); + if (!commitType) { + return; + } + const scope = await vscode.window.showInputBox({ + prompt: "Enter scope (optional)", + placeHolder: "auth, api, ui, etc.", + }); + const description = await vscode.window.showInputBox({ + prompt: "Enter commit description", + placeHolder: "add user authentication", + validateInput: (value) => { + if (!value) { + return "Description is required"; + } + if (value.length > 50) { + return "Description should be 50 characters or less"; + } + return null; + }, + }); + if (!description) { + return; + } + let commitMessage = commitType.label; + if (scope) { + commitMessage += `(${scope})`; + } + commitMessage += `: ${description}`; + // Copy to clipboard + await vscode.env.clipboard.writeText(commitMessage); + vscode.window + .showInformationMessage(`📋 Commit message copied to clipboard: ${commitMessage}`, "Open Git Panel") + .then((action) => { + if (action === "Open Git Panel") { + vscode.commands.executeCommand("workbench.view.scm"); + } + }); + } + dispose() { + this.disposables.forEach((d) => d.dispose()); + this.disposables = []; + } +} +exports.GitMonitor = GitMonitor; +//# sourceMappingURL=GitMonitor.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/monitors/GitMonitor.js.map b/packages/vscode-extension/out/monitors/GitMonitor.js.map new file mode 100644 index 00000000..78255890 --- /dev/null +++ b/packages/vscode-extension/out/monitors/GitMonitor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GitMonitor.js","sourceRoot":"","sources":["../../src/monitors/GitMonitor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAIjC,MAAa,UAAU;IAMrB,YACE,gBAA8C,EAC9C,aAAmC;QAL7B,gBAAW,GAAwB,EAAE,CAAC;QAO5C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED,eAAe;QACb,sCAAsC;QACtC,MAAM,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QAClE,IAAI,YAAY,EAAE;YAChB,IAAI,YAAY,CAAC,QAAQ,EAAE;gBACzB,IAAI,CAAC,kBAAkB,EAAE,CAAC;aAC3B;iBAAM;gBACL,YAAY,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;oBAChC,IAAI,CAAC,kBAAkB,EAAE,CAAC;gBAC5B,CAAC,CAAC,CAAC;aACJ;SACF;QAED,mCAAmC;QACnC,IAAI,CAAC,WAAW,CAAC,IAAI,CACnB,MAAM,CAAC,SAAS,CAAC,2BAA2B,CAAC,GAAG,EAAE;YAChD,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC5B,CAAC,CAAC,CACH,CAAC;QAEF,gBAAgB;QAChB,UAAU,CAAC,GAAG,EAAE;YACd,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC5B,CAAC,EAAE,IAAI,CAAC,CAAC;IACX,CAAC;IAEO,kBAAkB;QACxB,IAAI;YACF,MAAM,GAAG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AM,CAAC,MAAM,CAAC,YAAY,CAAC;YACnD,MAAM,EAAE,0BAA0B;YAClC,WAAW,EAAE,yBAAyB;YACtC,aAAa,EAAE,CAAC,KAAa,EAAE,EAAE;gBAC/B,IAAI,CAAC,KAAK,EAAE;oBACV,OAAO,yBAAyB,CAAC;iBAClC;gBACD,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE;oBACrB,OAAO,6CAA6C,CAAC;iBACtD;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO;SACR;QAED,IAAI,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC;QACrC,IAAI,KAAK,EAAE;YACT,aAAa,IAAI,IAAI,KAAK,GAAG,CAAC;SAC/B;QACD,aAAa,IAAI,KAAK,WAAW,EAAE,CAAC;QAEpC,oBAAoB;QACpB,MAAM,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QAEpD,MAAM,CAAC,MAAM;aACV,sBAAsB,CACrB,0CAA0C,aAAa,EAAE,EACzD,gBAAgB,CACjB;aACA,IAAI,CAAC,CAAC,MAA0B,EAAE,EAAE;YACnC,IAAI,MAAM,KAAK,gBAAgB,EAAE;gBAC/B,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;aACtD;QACH,CAAC,CAAC,CAAC;IACP,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;IACxB,CAAC;CACF;AA3MD,gCA2MC"} \ No newline at end of file diff --git a/packages/vscode-extension/out/notifications/ProactiveNotificationManager.js b/packages/vscode-extension/out/notifications/ProactiveNotificationManager.js new file mode 100644 index 00000000..ee37fa34 --- /dev/null +++ b/packages/vscode-extension/out/notifications/ProactiveNotificationManager.js @@ -0,0 +1,207 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ProactiveNotificationManager = void 0; +const vscode = __importStar(require("vscode")); +class ProactiveNotificationManager { + constructor(configManager) { + this.notificationQueue = []; + this.configManager = configManager; + } + async showWelcomeMessage() { + if (!this.configManager.notificationsEnabled) { + return; + } + const action = await vscode.window.showInformationMessage("🚀 StackCode is now active! Get proactive suggestions to improve your development workflow.", "Learn More", "Settings"); + if (action === "Learn More") { + vscode.env.openExternal(vscode.Uri.parse("https://github.com/YagoBorba/StackCode")); + } + else if (action === "Settings") { + vscode.commands.executeCommand("workbench.action.openSettings", "stackcode"); + } + } + async showBranchWarning(currentBranch) { + if (!this.configManager.branchCheckEnabled) { + return; + } + const isMainBranch = ["main", "master", "develop"].includes(currentBranch); + if (isMainBranch) { + const action = await vscode.window.showWarningMessage(`⚠️ You are working on the ${currentBranch} branch. Would you like to create a new feature branch?`, "Create Branch", "Continue", "Don't Show Again"); + if (action === "Create Branch") { + vscode.commands.executeCommand("stackcode.createBranch"); + } + else if (action === "Don't Show Again") { + await this.configManager.updateConfiguration("notifications.branchCheck", false); + } + } + } + async showCommitMessageWarning(message) { + if (!this.configManager.commitCheckEnabled) { + return; + } + const isConventional = this.isConventionalCommit(message); + if (!isConventional) { + const action = await vscode.window.showWarningMessage("💬 We detected you are trying to commit without a conventional message. Would you like help formatting it?", "Format Message", "Continue", "Learn More"); + if (action === "Format Message") { + vscode.commands.executeCommand("stackcode.formatCommitMessage"); + } + else if (action === "Learn More") { + vscode.env.openExternal(vscode.Uri.parse("https://conventionalcommits.org/")); + } + } + } + async showFileCreationSuggestion(fileName) { + if (!this.configManager.notificationsEnabled) { + return; + } + if (fileName === "README.md") { + const action = await vscode.window.showInformationMessage("📝 Would you like to generate a comprehensive README.md using StackCode templates?", "Generate README", "Not Now"); + if (action === "Generate README") { + // TODO: Implement README generation + vscode.window.showInformationMessage("README generation will be available soon!"); + } + } + else if (fileName === ".gitignore") { + const action = await vscode.window.showInformationMessage("🚫 Would you like to generate a .gitignore file based on your project type?", "Generate .gitignore", "Not Now"); + if (action === "Generate .gitignore") { + // TODO: Implement .gitignore generation + vscode.window.showInformationMessage(".gitignore generation will be available soon!"); + } + } + } + async runFullBestPracticesCheck() { + const issues = []; + // Check if working on main branch + try { + const gitExtension = vscode.extensions.getExtension("vscode.git")?.exports; + if (gitExtension) { + const repo = gitExtension.getAPI(1).repositories[0]; + if (repo && + ["main", "master", "develop"].includes(repo.state.HEAD?.name || "")) { + issues.push("Working on main/develop branch"); + } + } + } + catch (error) { + // Git extension not available or error accessing it + console.log("Git extension error:", error); + } + // Check for missing files + const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; + if (workspaceFolder) { + const files = await vscode.workspace.fs.readDirectory(workspaceFolder.uri); + const fileNames = files.map(([name]) => name); + if (!fileNames.includes("README.md")) { + issues.push("Missing README.md file"); + } + if (!fileNames.includes(".gitignore")) { + issues.push("Missing .gitignore file"); + } + } + if (issues.length === 0) { + vscode.window.showInformationMessage("✅ All best practices checks passed!"); + } + else { + const message = `Found ${issues.length} potential improvements:\n${issues.map((issue) => `• ${issue}`).join("\n")}`; + vscode.window.showWarningMessage(message, "Fix Issues"); + } + } + isConventionalCommit(message) { + const conventionalPattern = /^(feat|fix|docs|style|refactor|perf|test|chore|build|ci)(\(.+\))?: .+/; + return conventionalPattern.test(message); + } + async handleApplyFix(message) { + // Enhanced fix handling with specific actions + if (message.includes("README")) { + await vscode.commands.executeCommand("stackcode.generate.readme"); + } + else if (message.includes("gitignore")) { + await vscode.commands.executeCommand("stackcode.generate.gitignore"); + } + else if (message.includes("commit")) { + await vscode.commands.executeCommand("stackcode.commit"); + } + else { + await vscode.commands.executeCommand("stackcode.validate"); + } + } + async handleLearnMore(message) { + const learnMoreUrls = { + "conventional commits": "https://conventionalcommits.org/", + gitflow: "https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow", + readme: "https://www.makeareadme.com/", + "git best practices": "https://sethrobertson.github.io/GitBestPractices/", + }; + const topic = Object.keys(learnMoreUrls).find((key) => message.toLowerCase().includes(key)) || "git best practices"; + await vscode.env.openExternal(vscode.Uri.parse(learnMoreUrls[topic])); + } + async handleStartWorkflow(workflowType) { + switch (workflowType) { + case "feature": + await vscode.commands.executeCommand("stackcode.git.feature.start"); + break; + case "hotfix": + await vscode.commands.executeCommand("stackcode.git.hotfix.start"); + break; + case "release": + await vscode.commands.executeCommand("stackcode.release"); + break; + default: + await vscode.commands.executeCommand("stackcode.git.feature.start"); + } + } + async handleConfigureWorkflow() { + await vscode.commands.executeCommand("stackcode.config"); + } + async handleFixProjectIssue(issue) { + if (issue.includes("README")) { + await vscode.commands.executeCommand("stackcode.generate.readme"); + } + else if (issue.includes("gitignore")) { + await vscode.commands.executeCommand("stackcode.generate.gitignore"); + } + else { + await vscode.commands.executeCommand("stackcode.validate"); + } + } + async handleShowDetails(issue) { + const outputChannel = vscode.window.createOutputChannel("StackCode Details"); + outputChannel.appendLine(`=== Project Issue Details ===`); + outputChannel.appendLine(`Issue: ${issue}`); + outputChannel.appendLine(`Timestamp: ${new Date().toISOString()}`); + outputChannel.appendLine(`Workspace: ${vscode.workspace.name || "Unknown"}`); + outputChannel.appendLine(""); + outputChannel.appendLine("Suggested Actions:"); + outputChannel.appendLine("1. Run project validation"); + outputChannel.appendLine("2. Check project structure"); + outputChannel.appendLine("3. Review best practices"); + outputChannel.show(); + } + dispose() { + // Cleanup if needed + } +} +exports.ProactiveNotificationManager = ProactiveNotificationManager; +//# sourceMappingURL=ProactiveNotificationManager.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/notifications/ProactiveNotificationManager.js.map b/packages/vscode-extension/out/notifications/ProactiveNotificationManager.js.map new file mode 100644 index 00000000..cb7165d7 --- /dev/null +++ b/packages/vscode-extension/out/notifications/ProactiveNotificationManager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ProactiveNotificationManager.js","sourceRoot":"","sources":["../../src/notifications/ProactiveNotificationManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAQjC,MAAa,4BAA4B;IAQvC,YAAY,aAAmC;QAN9B,sBAAiB,GAI7B,EAAE,CAAC;QAGN,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,oBAAoB,EAAE;YAC5C,OAAO;SACR;QAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,sBAAsB,CACvD,6FAA6F,EAC7F,YAAY,EACZ,UAAU,CACX,CAAC;QAEF,IAAI,MAAM,KAAK,YAAY,EAAE;YAC3B,MAAM,CAAC,GAAG,CAAC,YAAY,CACrB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAC3D,CAAC;SACH;aAAM,IAAI,MAAM,KAAK,UAAU,EAAE;YAChC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAC5B,+BAA+B,EAC/B,WAAW,CACZ,CAAC;SACH;IACH,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,UAAU,CAAC,EAAE,CAAC,CAAC;QAC7B,aAAa,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;QAC/C,aAAa,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;QACtD,aAAa,CAAC,UAAU,CAAC,4BAA4B,CAAC,CAAC;QACvD,aAAa,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC;QACrD,aAAa,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAED,OAAO;QACL,oBAAoB;IACtB,CAAC;CACF;AA/PD,oEA+PC"} \ No newline at end of file diff --git a/packages/vscode-extension/out/providers/DashboardProvider.backup.js b/packages/vscode-extension/out/providers/DashboardProvider.backup.js new file mode 100644 index 00000000..213458c8 --- /dev/null +++ b/packages/vscode-extension/out/providers/DashboardProvider.backup.js @@ -0,0 +1,272 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DashboardProvider = void 0; +const vscode = __importStar(require("vscode")); +const path = __importStar(require("path")); +const fs = __importStar(require("fs")); +class DashboardProvider { + constructor(context) { + this._disposables = []; + this._extensionUri = context.extensionUri; + } + resolveWebviewView(webviewView, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + context, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + token) { + this._view = webviewView; + webviewView.webview.options = { + enableScripts: true, + localResourceRoots: [vscode.Uri.joinPath(this._extensionUri, 'dist')], + }; + webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); + webviewView.webview.onDidReceiveMessage(async (data) => { + console.log(`[StackCode] Received command from webview: ${data.type}`); + try { + // Tratar comandos específicos do webview + switch (data.type) { + case 'webviewReady': + console.log('[StackCode] Webview reported ready, sending initial data'); + this.updateProjectStats(); + return; + case 'refreshStats': + this.updateProjectStats(); + return; + default: + // Executar comando normal do VS Code + await vscode.commands.executeCommand(data.type, data.payload); + } + } + catch (error) { + console.error(`[StackCode] Error executing command ${data.type}:`, error); + this.sendMessage({ + type: 'commandError', + payload: { command: data.type, error: error instanceof Error ? error.message : 'Unknown error' } + }); + } + }, undefined, this._disposables); + // WebviewView doesn't have onDidBecomeVisible, so we'll update stats immediately + this.updateProjectStats(); + } + sendMessage(message) { + if (this._view) { + this._view.webview.postMessage(message); + } + } + show() { + if (this._view) { + this._view.show?.(true); + } + else { + // If view is not created yet, trigger the creation by executing the show command + vscode.commands.executeCommand('workbench.view.extension.stackcode'); + } + } + async updateProjectStats() { + if (!this._view) { + console.log('[StackCode] No view available for stats update'); + return; + } + const workspaceFolders = vscode.workspace.workspaceFolders; + console.log('[StackCode] Workspace folders:', workspaceFolders?.length || 0); + console.log('[StackCode] Workspace name:', vscode.workspace.name); + console.log('[StackCode] Workspace file:', vscode.workspace.workspaceFile?.toString()); + if (!workspaceFolders || workspaceFolders.length === 0) { + console.log('[StackCode] No workspace folders found, using alternative detection'); + // Fallback: usar informações do contexto da extensão + const extensionWorkspace = path.dirname(path.dirname(path.dirname(this._extensionUri.fsPath))); + console.log('[StackCode] Extension workspace path:', extensionWorkspace); + this.sendMessage({ + type: 'updateStats', + payload: { + files: 0, + workspaceName: 'StackCode (Debug)', + workspacePath: extensionWorkspace, + mode: 'development' + } + }); + return; + } + try { + const files = await vscode.workspace.findFiles('**/*', '**/node_modules/**', 1000); + console.log('[StackCode] Found files:', files.length); + this.sendMessage({ + type: 'updateStats', + payload: { + files: files.length, + workspaceName: workspaceFolders[0].name, + workspacePath: workspaceFolders[0].uri.fsPath, + mode: 'production' + }, + }); + } + catch (e) { + console.error("[StackCode] Error fetching project stats:", e); + this.sendMessage({ + type: 'updateStats', + payload: { files: 0, error: 'Failed to scan files' } + }); + } + } + _getHtmlForWebview(webview) { + const nonce = getNonce(); + const buildPath = vscode.Uri.joinPath(this._extensionUri, 'dist', 'webview-ui'); + // Lê o manifest.json do Vite + const manifestPath = path.join(buildPath.fsPath, '.vite', 'manifest.json'); + console.log('[StackCode] Build path:', buildPath.fsPath); + console.log('[StackCode] Manifest path:', manifestPath); + console.log('[StackCode] Manifest exists:', fs.existsSync(manifestPath)); + try { + const manifestContent = fs.readFileSync(manifestPath, 'utf-8'); + const manifest = JSON.parse(manifestContent); + console.log('[StackCode] Manifest content:', manifest); + // Pega os arquivos do manifest do Vite + const indexEntry = manifest['index.html']; + const scriptFile = indexEntry.file; + const cssFiles = indexEntry.css || []; + const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(buildPath, scriptFile)); + const cssUris = cssFiles.map((cssFile) => webview.asWebviewUri(vscode.Uri.joinPath(buildPath, cssFile))); + console.log('[StackCode] Script URI:', scriptUri.toString()); + console.log('[StackCode] CSS URIs:', cssUris.map((uri) => uri.toString())); + return ` + + + + + + ${cssUris.map((uri) => ``).join('\n ')} + StackCode Dashboard + + +
+ ⏳ Carregando StackCode Dashboard... +
+
+ + + +`; + } + catch (error) { + console.error("[StackCode] Error reading manifest:", error); + // Fallback melhorado para desenvolvimento + return ` + + + + + StackCode Dashboard + + + +
+
Development Mode
+

🏗️ StackCode Dashboard

+
+ Build Required: O webview-ui precisa ser compilado primeiro. +

+ Execute: npm run build:ui +

+ Erro: ${error instanceof Error ? error.message : 'Manifest não encontrado'} +
+

Status da extensão: ✅ Ativa

+

Workspace: ${vscode.workspace.workspaceFolders?.[0]?.name || 'Nenhum'}

+
+ +`; + } + } + // CORREÇÃO: Adicionando o método dispose para conformidade. + dispose() { + while (this._disposables.length) { + const x = this._disposables.pop(); + if (x) { + x.dispose(); + } + } + } +} +exports.DashboardProvider = DashboardProvider; +DashboardProvider.viewType = "stackcode.dashboard"; +function getNonce() { + let text = ''; + const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + for (let i = 0; i < 32; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } + return text; +} +//# sourceMappingURL=DashboardProvider.backup.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/providers/DashboardProvider.backup.js.map b/packages/vscode-extension/out/providers/DashboardProvider.backup.js.map new file mode 100644 index 00000000..47460414 --- /dev/null +++ b/packages/vscode-extension/out/providers/DashboardProvider.backup.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DashboardProvider.backup.js","sourceRoot":"","sources":["../../src/providers/DashboardProvider.backup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,2CAA6B;AAC7B,uCAAyB;AAEzB,MAAa,iBAAiB;IAM1B,YAAY,OAAgC;QAFpC,iBAAY,GAAwB,EAAE,CAAC;QAG3C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAC9C,CAAC;IAEM,kBAAkB,CACrB,WAA+B;IAC/B,6DAA6D;IAC7D,OAAyC;IACzC,+DAA+D;IAC/D,KAA+B;QAE/B,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC;QAEzB,WAAW,CAAC,OAAO,CAAC,OAAO,GAAG;YAC1B,aAAa,EAAE,IAAI;YACnB,kBAAkB,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;SACxE,CAAC;QAEF,WAAW,CAAC,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ension/out/providers/DashboardProvider.js b/packages/vscode-extension/out/providers/DashboardProvider.js new file mode 100644 index 00000000..94e2493d --- /dev/null +++ b/packages/vscode-extension/out/providers/DashboardProvider.js @@ -0,0 +1,272 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DashboardProvider = void 0; +const vscode = __importStar(require("vscode")); +const path = __importStar(require("path")); +const fs = __importStar(require("fs")); +class DashboardProvider { + constructor(context) { + this._disposables = []; + this._extensionUri = context.extensionUri; + } + resolveWebviewView(webviewView, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + context, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + token) { + this._view = webviewView; + webviewView.webview.options = { + enableScripts: true, + localResourceRoots: [vscode.Uri.joinPath(this._extensionUri, 'dist')], + }; + webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); + webviewView.webview.onDidReceiveMessage(async (data) => { + console.log(`[StackCode] Received command from webview: ${data.type}`); + try { + // Tratar comandos específicos do webview + switch (data.type) { + case 'webviewReady': + console.log('[StackCode] Webview reported ready, sending initial data'); + this.updateProjectStats(); + return; + case 'refreshStats': + this.updateProjectStats(); + return; + default: + // Executar comando normal do VS Code + await vscode.commands.executeCommand(data.type, data.payload); + } + } + catch (error) { + console.error(`[StackCode] Error executing command ${data.type}:`, error); + this.sendMessage({ + type: 'commandError', + payload: { command: data.type, error: error instanceof Error ? error.message : 'Unknown error' } + }); + } + }, undefined, this._disposables); + // WebviewView doesn't have onDidBecomeVisible, so we'll update stats immediately + this.updateProjectStats(); + } + sendMessage(message) { + if (this._view) { + this._view.webview.postMessage(message); + } + } + show() { + if (this._view) { + this._view.show?.(true); + } + else { + // If view is not created yet, trigger the creation by executing the show command + vscode.commands.executeCommand('workbench.view.extension.stackcode'); + } + } + async updateProjectStats() { + if (!this._view) { + console.log('[StackCode] No view available for stats update'); + return; + } + const workspaceFolders = vscode.workspace.workspaceFolders; + console.log('[StackCode] Workspace folders:', workspaceFolders?.length || 0); + console.log('[StackCode] Workspace name:', vscode.workspace.name); + console.log('[StackCode] Workspace file:', vscode.workspace.workspaceFile?.toString()); + if (!workspaceFolders || workspaceFolders.length === 0) { + console.log('[StackCode] No workspace folders found, using alternative detection'); + // Fallback: usar informações do contexto da extensão + const extensionWorkspace = path.dirname(path.dirname(path.dirname(this._extensionUri.fsPath))); + console.log('[StackCode] Extension workspace path:', extensionWorkspace); + this.sendMessage({ + type: 'updateStats', + payload: { + files: 0, + workspaceName: 'StackCode (Debug)', + workspacePath: extensionWorkspace, + mode: 'development' + } + }); + return; + } + try { + const files = await vscode.workspace.findFiles('**/*', '**/node_modules/**', 1000); + console.log('[StackCode] Found files:', files.length); + this.sendMessage({ + type: 'updateStats', + payload: { + files: files.length, + workspaceName: workspaceFolders[0].name, + workspacePath: workspaceFolders[0].uri.fsPath, + mode: 'production' + }, + }); + } + catch (e) { + console.error("[StackCode] Error fetching project stats:", e); + this.sendMessage({ + type: 'updateStats', + payload: { files: 0, error: 'Failed to scan files' } + }); + } + } + _getHtmlForWebview(webview) { + const nonce = getNonce(); + const buildPath = vscode.Uri.joinPath(this._extensionUri, 'dist', 'webview-ui'); + // Lê o manifest.json do Vite + const manifestPath = path.join(buildPath.fsPath, '.vite', 'manifest.json'); + console.log('[StackCode] Build path:', buildPath.fsPath); + console.log('[StackCode] Manifest path:', manifestPath); + console.log('[StackCode] Manifest exists:', fs.existsSync(manifestPath)); + try { + const manifestContent = fs.readFileSync(manifestPath, 'utf-8'); + const manifest = JSON.parse(manifestContent); + console.log('[StackCode] Manifest content:', manifest); + // Pega os arquivos do manifest do Vite + const indexEntry = manifest['index.html']; + const scriptFile = indexEntry.file; + const cssFiles = indexEntry.css || []; + const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(buildPath, scriptFile)); + const cssUris = cssFiles.map((cssFile) => webview.asWebviewUri(vscode.Uri.joinPath(buildPath, cssFile))); + console.log('[StackCode] Script URI:', scriptUri.toString()); + console.log('[StackCode] CSS URIs:', cssUris.map((uri) => uri.toString())); + return ` + + + + + + ${cssUris.map((uri) => ``).join('\n ')} + StackCode Dashboard + + +
+ ⏳ Carregando StackCode Dashboard... +
+
+ + + +`; + } + catch (error) { + console.error("[StackCode] Error reading manifest:", error); + // Fallback melhorado para desenvolvimento + return ` + + + + + StackCode Dashboard + + + +
+
Development Mode
+

🏗️ StackCode Dashboard

+
+ Build Required: O webview-ui precisa ser compilado primeiro. +

+ Execute: npm run build:ui +

+ Erro: ${error instanceof Error ? error.message : 'Manifest não encontrado'} +
+

Status da extensão: ✅ Ativa

+

Workspace: ${vscode.workspace.workspaceFolders?.[0]?.name || 'Nenhum'}

+
+ +`; + } + } + // CORREÇÃO: Adicionando o método dispose para conformidade. + dispose() { + while (this._disposables.length) { + const x = this._disposables.pop(); + if (x) { + x.dispose(); + } + } + } +} +exports.DashboardProvider = DashboardProvider; +DashboardProvider.viewType = "stackcode.dashboard"; +function getNonce() { + let text = ''; + const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + for (let i = 0; i < 32; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } + return text; +} +//# sourceMappingURL=DashboardProvider.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/providers/DashboardProvider.js.map b/packages/vscode-extension/out/providers/DashboardProvider.js.map new file mode 100644 index 00000000..f364f746 --- /dev/null +++ b/packages/vscode-extension/out/providers/DashboardProvider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DashboardProvider.js","sourceRoot":"","sources":["../../src/providers/DashboardProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,2CAA6B;AAC7B,uCAAyB;AAEzB,MAAa,iBAAiB;IAM1B,YAAY,OAAgC;QAFpC,iBAAY,GAAwB,EAAE,CAAC;QAG3C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAC9C,CAAC;IAEM,kBAAkB,CACrB,WAA+B;IAC/B,6DAA6D;IAC7D,OAAyC;IACzC,+DAA+D;IAC/D,KAA+B;QAE/B,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC;QAEzB,WAAW,CAAC,OAAO,CAAC,OAAO,GAAG;YAC1B,aAAa,EAAE,IAAI;YACnB,kBAAkB,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;SACxE,CAAC;QAEF,WAAW,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAExE,WAAW,CAAC,OAAO,CAAC,mBAAmB,CACnC,KAAK,EAAE,IAAyC,EAAE,EAAE;YAChD,OAAO,CAAC,GAAG,CAAC,8CAA8C,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAEvE,IAAI;gBACA,yCAAyC;gBACzC,QAAQ,IAAI,CAAC,IAAI,EAAE;oBACf,KAAK,cAAc;wBACf,OAAO,CAAC,GAAG,CAAC,0DAA0D,CAAC,CAAC;wBACxE,IAAI,CAAC,kBAAkB,EAAE,C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,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB;;;wBAG9D,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,QAAQ;;;QAGxE,CAAC;SACA;IACL,CAAC;IAED,4DAA4D;IACrD,OAAO;QACV,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;YAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;YAClC,IAAI,CAAC,EAAE;gBACH,CAAC,CAAC,OAAO,EAAE,CAAC;aACf;SACJ;IACL,CAAC;;AAxQL,8CAyQC;AAxQ0B,0BAAQ,GAAG,qBAAqB,CAAC;AA0Q5D,SAAS,QAAQ;IACb,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,MAAM,QAAQ,GAAG,gEAAgE,CAAC;IAClF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;QACzB,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;KACxE;IACD,OAAO,IAAI,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/packages/vscode-extension/out/providers/ProjectViewProvider.js b/packages/vscode-extension/out/providers/ProjectViewProvider.js new file mode 100644 index 00000000..da64a272 --- /dev/null +++ b/packages/vscode-extension/out/providers/ProjectViewProvider.js @@ -0,0 +1,307 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ProjectViewProvider = void 0; +const vscode = __importStar(require("vscode")); +class ProjectViewProvider { + constructor(workspaceState) { + this.workspaceState = workspaceState; + this._onDidChangeTreeData = new vscode.EventEmitter(); + this.onDidChangeTreeData = this._onDidChangeTreeData.event; + } + refresh() { + this._onDidChangeTreeData.fire(); + } + getTreeItem(element) { + const item = new vscode.TreeItem(element.label, element.collapsibleState); + // Enhanced icons and styling + const iconMap = { + "StackCode Project": "rocket", + "Quick Actions": "zap", + "Initialize Project": "folder-opened", + "Generate README": "book", + "Generate .gitignore": "git-branch", + "Validate Project": "check", + "Git Workflow": "git-commit", + "Start Feature": "git-branch", + "Create Hotfix": "flame", + "Make Release": "package", + "Commit Changes": "git-commit", + "Project Tools": "tools", + Configuration: "gear", + "Show Dashboard": "dashboard", + "View Project Stats": "graph", + "Help & Documentation": "question", + }; + // Set icons with theme support + item.iconPath = new vscode.ThemeIcon(iconMap[element.label] || "circle-filled"); + // Add commands for interactive items + if (element.command) { + // Handle both string and Command object types + if (typeof element.command === "string") { + item.command = { + command: element.command, + title: element.label, + }; + } + else { + item.command = element.command; + } + // Add hover descriptions + const tooltips = { + "Initialize Project": "Create a new project with StackCode scaffolding", + "Generate README": "Generate a comprehensive README.md file", + "Generate .gitignore": "Generate .gitignore based on project type", + "Validate Project": "Check project structure and best practices", + "Start Feature": "Begin a new feature using GitFlow", + "Create Hotfix": "Create a hotfix branch for urgent fixes", + "Make Release": "Create a new release with automated versioning", + "Commit Changes": "Make a conventional commit with validation", + Configuration: "Configure StackCode settings", + "Show Dashboard": "Open the interactive StackCode dashboard", + "View Project Stats": "See detailed project statistics", + "Help & Documentation": "Access StackCode documentation", + }; + item.tooltip = tooltips[element.label] || element.label; + } + // Style for different types + if (element.children && element.children.length > 0) { + item.contextValue = "stackcode-category"; + } + else if (element.command) { + item.contextValue = "stackcode-action"; + } + return item; + } + getChildren(element) { + if (!element) { + // Root level - show main categories with enhanced structure + return Promise.resolve([ + { + label: "StackCode Project", + icon: "rocket", + collapsibleState: vscode.TreeItemCollapsibleState.Expanded, + children: [ + { + label: "Quick Actions", + icon: "zap", + collapsibleState: vscode.TreeItemCollapsibleState.Expanded, + children: [ + { + label: "Initialize Project", + icon: "folder-opened", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.init", + title: "Initialize Project", + }, + }, + { + label: "Generate README", + icon: "book", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.generate.readme", + title: "Generate README", + }, + }, + { + label: "Generate .gitignore", + icon: "git-branch", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.generate.gitignore", + title: "Generate .gitignore", + }, + }, + { + label: "Validate Project", + icon: "check", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.validate", + title: "Validate Project", + }, + }, + ], + }, + { + label: "Git Workflow", + icon: "git-commit", + collapsibleState: vscode.TreeItemCollapsibleState.Expanded, + children: [ + { + label: "Start Feature", + icon: "git-branch", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.git.feature.start", + title: "Start Feature", + }, + }, + { + label: "Create Hotfix", + icon: "flame", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.git.hotfix.start", + title: "Create Hotfix", + }, + }, + { + label: "Make Release", + icon: "package", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.release", + title: "Make Release", + }, + }, + { + label: "Commit Changes", + icon: "git-commit", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.commit", + title: "Commit Changes", + }, + }, + ], + }, + { + label: "Project Tools", + icon: "tools", + collapsibleState: vscode.TreeItemCollapsibleState.Collapsed, + children: [ + { + label: "Configuration", + icon: "gear", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.config", + title: "Configuration", + }, + }, + { + label: "Show Dashboard", + icon: "dashboard", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.dashboard.show", + title: "Show Dashboard", + }, + }, + { + label: "View Project Stats", + icon: "graph", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.stats.show", + title: "View Project Stats", + }, + }, + { + label: "Help & Documentation", + icon: "question", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.help", + title: "Help & Documentation", + }, + }, + ], + }, + ], + }, + ]); + } + else { + return Promise.resolve(element.children || []); + } + } + async getProjectInfo() { + const items = []; + const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; + if (!workspaceFolder) { + return [ + { + label: "No workspace", + description: "Open a folder to see project info", + icon: "folder-opened", + }, + ]; + } + // Project name + items.push({ + label: workspaceFolder.name, + description: "Project root", + icon: "folder", + }); + // Git status + try { + const gitExtension = vscode.extensions.getExtension("vscode.git"); + if (gitExtension && gitExtension.isActive) { + const git = gitExtension.exports; + const api = git.getAPI(1); + const repo = api.repositories[0]; + if (repo && repo.state.HEAD) { + items.push({ + label: `Branch: ${repo.state.HEAD.name}`, + description: `${repo.state.workingTreeChanges.length} changes`, + icon: "git-branch", + }); + } + } + } + catch { + // Git not available + } + // Quick actions + items.push({ + label: "Initialize Project", + description: "Set up StackCode project", + icon: "play", + command: "stackcode.init", + }, { + label: "Generate Files", + description: "Create README, .gitignore, etc.", + icon: "file-add", + command: "stackcode.generate.readme", + }, { + label: "Start Branch", + description: "Create new feature branch", + icon: "git-branch", + command: "stackcode.git.start", + }, { + label: "Create Commit", + description: "Make conventional commit", + icon: "git-commit", + command: "stackcode.commit", + }); + return items; + } +} +exports.ProjectViewProvider = ProjectViewProvider; +//# sourceMappingURL=ProjectViewProvider.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/providers/ProjectViewProvider.js.map b/packages/vscode-extension/out/providers/ProjectViewProvider.js.map new file mode 100644 index 00000000..9f1ce9e1 --- /dev/null +++ b/packages/vscode-extension/out/providers/ProjectViewProvider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ProjectViewProvider.js","sourceRoot":"","sources":["../../src/providers/ProjectViewProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAWjC,MAAa,mBAAmB;IAU9B,YAAoB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;QAP1C,yBAAoB,GAExB,IAAI,MAAM,CAAC,YAAY,EAAyC,CAAC;QAC5D,wBAAmB,GAExB,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC;IAEiB,CAAC;IAEtD,OAAO;QACL,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,WAAW,CAAC,OAAoB;QAC9B,MAAM,IAAI,GAAG,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAE1E,6BAA6B;QAC7B,MAAM,OAAO,GAA2B;YACtC,mBAAmB,EAAE,QAAQ;YAC7B,eAAe,EAAE,KAAK;YACtB,oBAAoB,EAAE,eAAe;YACrC,iBAAiB,EAAE,MAAM;YACzB,qBAAqB,EAAE,YAAY;YACnC,kBAAkB,EAAE,OAAO;YAC3B,cAAc,EAAE,YAAY;YAC5B,eAAe,EAAE,YAAY;YAC7B,eAAe,EAAE,OAAO;YACxB,cAAc,EAAE,SAAS;YACzB,gBAAgB,EAAE,YAAY;YAC9B,eAAe,EAAE,OAAO;YACxB,aAAa,EAAE,MAAM;YACrB,gBAAgB,EAAE,WAAW;YA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 No newline at end of file diff --git a/packages/vscode-extension/out/test/__mocks__/vscode.js b/packages/vscode-extension/out/test/__mocks__/vscode.js new file mode 100644 index 00000000..90a9daef --- /dev/null +++ b/packages/vscode-extension/out/test/__mocks__/vscode.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConfigurationTarget = exports.StatusBarAlignment = exports.extensions = exports.commands = exports.workspace = exports.window = void 0; +const mockConfiguration = { + get: jest.fn((key, defaultValue) => { + const configs = { + "notifications.enabled": true, + "notifications.branchCheck": true, + "notifications.commitCheck": true, + "autoGenerate.readme": false, + "autoGenerate.gitignore": true, + "git.defaultBranchType": "feature", + "dashboard.autoOpen": false, + }; + return configs[key] !== undefined ? configs[key] : defaultValue; + }), + update: jest.fn(), +}; +exports.window = { + showInformationMessage: jest.fn(), + showWarningMessage: jest.fn(), + showErrorMessage: jest.fn(), + createStatusBarItem: jest.fn(() => ({ + show: jest.fn(), + hide: jest.fn(), + dispose: jest.fn(), + })), +}; +exports.workspace = { + getConfiguration: jest.fn(() => mockConfiguration), + workspaceFolders: [], + onDidChangeConfiguration: jest.fn(), +}; +exports.commands = { + registerCommand: jest.fn(), + executeCommand: jest.fn(), + getCommands: jest.fn(() => Promise.resolve([ + "stackcode.init", + "stackcode.generate.readme", + "stackcode.git.start", + ])), +}; +exports.extensions = { + getExtension: jest.fn(() => ({ + activate: jest.fn(() => Promise.resolve()), + isActive: true, + })), +}; +exports.StatusBarAlignment = { + Left: 1, + Right: 2, +}; +exports.ConfigurationTarget = { + Global: 1, + Workspace: 2, + WorkspaceFolder: 3, +}; +//# sourceMappingURL=vscode.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/test/__mocks__/vscode.js.map b/packages/vscode-extension/out/test/__mocks__/vscode.js.map new file mode 100644 index 00000000..09cf3d11 --- /dev/null +++ b/packages/vscode-extension/out/test/__mocks__/vscode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"vscode.js","sourceRoot":"","sources":["../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AE,EAAE;IACzB,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CACxB,OAAO,CAAC,OAAO,CAAC;QACd,gBAAgB;QAChB,2BAA2B;QAC3B,qBAAqB;KACtB,CAAC,CACH;CACF,CAAC;AAEW,QAAA,UAAU,GAAG;IACxB,YAAY,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;QAC3B,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAC1C,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;CACJ,CAAC;AAEW,QAAA,kBAAkB,GAAG;IAChC,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;CACT,CAAC;AAEW,QAAA,mBAAmB,GAAG;IACjC,MAAM,EAAE,CAAC;IACT,SAAS,EAAE,CAAC;IACZ,eAAe,EAAE,CAAC;CACnB,CAAC"} \ No newline at end of file diff --git a/packages/vscode-extension/out/types.js b/packages/vscode-extension/out/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/packages/vscode-extension/out/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/packages/vscode-extension/out/types.js.map b/packages/vscode-extension/out/types.js.map new file mode 100644 index 00000000..c768b790 --- /dev/null +++ b/packages/vscode-extension/out/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/packages/vscode-extension/package.json b/packages/vscode-extension/package.json index 75a449b4..d1444cd1 100644 --- a/packages/vscode-extension/package.json +++ b/packages/vscode-extension/package.json @@ -25,7 +25,10 @@ "Programming Languages" ], "activationEvents": [ - "onStartupFinished" + "onStartupFinished", + "onView:stackcode.dashboard", + "onView:stackcode.projectView", + "*" ], "main": "./out/extension.js", "contributes": { @@ -161,10 +164,15 @@ }, "views": { "stackcode": [ + { + "id": "stackcode.dashboard", + "name": "Dashboard", + "type": "webview", + "icon": "$(dashboard)" + }, { "id": "stackcode.projectView", "name": "Project Overview", - "when": "workbenchState != empty", "icon": "$(project)" } ] @@ -226,6 +234,7 @@ } }, "devDependencies": { + "@tailwindcss/postcss": "^4.1.11", "@types/jest": "^29.5.14", "@types/node": "^16.18.126", "@types/react": "^19.1.9", diff --git a/packages/vscode-extension/src/extension.ts b/packages/vscode-extension/src/extension.ts index 1ca61142..a6cffaec 100644 --- a/packages/vscode-extension/src/extension.ts +++ b/packages/vscode-extension/src/extension.ts @@ -30,7 +30,9 @@ let releaseCommand: ReleaseCommand; let configCommand: ConfigCommand; export function activate(context: vscode.ExtensionContext) { - console.log("StackCode extension is now active!"); + console.log("[StackCode] Extension is now active!"); + console.log("[StackCode] Workspace folders:", vscode.workspace.workspaceFolders?.length || 0); + console.log("[StackCode] Extension path:", context.extensionPath); // Initialize configuration manager configManager = new ConfigurationManager(); @@ -43,7 +45,7 @@ export function activate(context: vscode.ExtensionContext) { fileMonitor = new FileMonitor(proactiveManager, configManager); // Initialize providers - dashboardProvider = new DashboardProvider(context.extensionUri); + dashboardProvider = new DashboardProvider(context); projectViewProvider = new ProjectViewProvider(context.workspaceState); // Initialize commands @@ -116,6 +118,30 @@ export function activate(context: vscode.ExtensionContext) { vscode.commands.registerCommand("stackcode.projectView.refresh", () => projectViewProvider.refresh(), ), + + // Webview commands + vscode.commands.registerCommand("webviewReady", () => { + console.log("[StackCode] Webview is ready!"); + // Pode enviar dados iniciais aqui se necessário + }), + vscode.commands.registerCommand("stackcode.webview.init", () => + initCommand.execute(), + ), + vscode.commands.registerCommand("stackcode.webview.generate.readme", () => + generateCommand.generateReadme(), + ), + vscode.commands.registerCommand("stackcode.webview.generate.gitignore", () => + generateCommand.generateGitignore(), + ), + vscode.commands.registerCommand("stackcode.webview.git.start", () => + gitCommand.startBranch(), + ), + vscode.commands.registerCommand("stackcode.webview.commit", () => + commitCommand.execute(), + ), + vscode.commands.registerCommand("stackcode.webview.validate", () => + validateCommand.execute(), + ), ]; // Add all to context subscriptions for cleanup diff --git a/packages/vscode-extension/src/providers/DashboardProvider.backup.ts b/packages/vscode-extension/src/providers/DashboardProvider.backup.ts new file mode 100644 index 00000000..7dae5723 --- /dev/null +++ b/packages/vscode-extension/src/providers/DashboardProvider.backup.ts @@ -0,0 +1,279 @@ +import * as vscode from "vscode"; +import * as path from "path"; +import * as fs from "fs"; + +export class DashboardProvider implements vscode.WebviewViewProvider, vscode.Disposable { + public static readonly viewType = "stackcode.dashboard"; + private _view?: vscode.WebviewView; + private readonly _extensionUri: vscode.Uri; + private _disposables: vscode.Disposable[] = []; + + constructor(context: vscode.ExtensionContext) { + this._extensionUri = context.extensionUri; + } + + public resolveWebviewView( + webviewView: vscode.WebviewView, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + context: vscode.WebviewViewResolveContext, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + token: vscode.CancellationToken, + ) { + this._view = webviewView; + + webviewView.webview.options = { + enableScripts: true, + localResourceRoots: [vscode.Uri.joinPath(this._extensionUri, 'dist')], + }; + + webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); + + webviewView.webview.onDidReceiveMessage( + async (data: { type: string; payload?: unknown }) => { + console.log(`[StackCode] Received command from webview: ${data.type}`); + + try { + // Tratar comandos específicos do webview + switch (data.type) { + case 'webviewReady': + console.log('[StackCode] Webview reported ready, sending initial data'); + this.updateProjectStats(); + return; + + case 'refreshStats': + this.updateProjectStats(); + return; + + default: + // Executar comando normal do VS Code + await vscode.commands.executeCommand(data.type, data.payload); + } + } catch (error) { + console.error(`[StackCode] Error executing command ${data.type}:`, error); + this.sendMessage({ + type: 'commandError', + payload: { command: data.type, error: error instanceof Error ? error.message : 'Unknown error' } + }); + } + }, + undefined, + this._disposables + ); + + // WebviewView doesn't have onDidBecomeVisible, so we'll update stats immediately + this.updateProjectStats(); + } + + public sendMessage(message: { type: string; payload?: unknown }) { + if (this._view) { + this._view.webview.postMessage(message); + } + } + + public show() { + if (this._view) { + this._view.show?.(true); + } else { + // If view is not created yet, trigger the creation by executing the show command + vscode.commands.executeCommand('workbench.view.extension.stackcode'); + } + } + + private async updateProjectStats() { + if (!this._view) { + console.log('[StackCode] No view available for stats update'); + return; + } + + const workspaceFolders = vscode.workspace.workspaceFolders; + console.log('[StackCode] Workspace folders:', workspaceFolders?.length || 0); + console.log('[StackCode] Workspace name:', vscode.workspace.name); + console.log('[StackCode] Workspace file:', vscode.workspace.workspaceFile?.toString()); + + if (!workspaceFolders || workspaceFolders.length === 0) { + console.log('[StackCode] No workspace folders found, using alternative detection'); + + // Fallback: usar informações do contexto da extensão + const extensionWorkspace = path.dirname(path.dirname(path.dirname(this._extensionUri.fsPath))); + console.log('[StackCode] Extension workspace path:', extensionWorkspace); + + this.sendMessage({ + type: 'updateStats', + payload: { + files: 0, + workspaceName: 'StackCode (Debug)', + workspacePath: extensionWorkspace, + mode: 'development' + } + }); + return; + } + + try { + const files = await vscode.workspace.findFiles('**/*', '**/node_modules/**', 1000); + console.log('[StackCode] Found files:', files.length); + + this.sendMessage({ + type: 'updateStats', + payload: { + files: files.length, + workspaceName: workspaceFolders[0].name, + workspacePath: workspaceFolders[0].uri.fsPath, + mode: 'production' + }, + }); + } catch (e) { + console.error("[StackCode] Error fetching project stats:", e); + this.sendMessage({ + type: 'updateStats', + payload: { files: 0, error: 'Failed to scan files' } + }); + } + } + + private _getHtmlForWebview(webview: vscode.Webview): string { + const nonce = getNonce(); + const buildPath = vscode.Uri.joinPath(this._extensionUri, 'dist', 'webview-ui'); + + // Lê o manifest.json do Vite + const manifestPath = path.join(buildPath.fsPath, '.vite', 'manifest.json'); + + console.log('[StackCode] Build path:', buildPath.fsPath); + console.log('[StackCode] Manifest path:', manifestPath); + console.log('[StackCode] Manifest exists:', fs.existsSync(manifestPath)); + + try { + const manifestContent = fs.readFileSync(manifestPath, 'utf-8'); + const manifest = JSON.parse(manifestContent); + console.log('[StackCode] Manifest content:', manifest); + + // Pega os arquivos do manifest do Vite + const indexEntry = manifest['index.html']; + const scriptFile = indexEntry.file; + const cssFiles = indexEntry.css || []; + + const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(buildPath, scriptFile)); + const cssUris = cssFiles.map((cssFile: string) => + webview.asWebviewUri(vscode.Uri.joinPath(buildPath, cssFile)) + ); + + console.log('[StackCode] Script URI:', scriptUri.toString()); + console.log('[StackCode] CSS URIs:', cssUris.map((uri: vscode.Uri) => uri.toString())); + + return ` + + + + + + ${cssUris.map((uri: vscode.Uri) => ``).join('\n ')} + StackCode Dashboard + + +
+ ⏳ Carregando StackCode Dashboard... +
+
+ + + +`; + } catch (error) { + console.error("[StackCode] Error reading manifest:", error); + // Fallback melhorado para desenvolvimento + return ` + + + + + StackCode Dashboard + + + +
+
Development Mode
+

🏗️ StackCode Dashboard

+
+ Build Required: O webview-ui precisa ser compilado primeiro. +

+ Execute: npm run build:ui +

+ Erro: ${error instanceof Error ? error.message : 'Manifest não encontrado'} +
+

Status da extensão: ✅ Ativa

+

Workspace: ${vscode.workspace.workspaceFolders?.[0]?.name || 'Nenhum'}

+
+ +`; + } + } + + // CORREÇÃO: Adicionando o método dispose para conformidade. + public dispose() { + while (this._disposables.length) { + const x = this._disposables.pop(); + if (x) { + x.dispose(); + } + } + } +} + +function getNonce() { + let text = ''; + const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + for (let i = 0; i < 32; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } + return text; +} diff --git a/packages/vscode-extension/src/providers/DashboardProvider.ts b/packages/vscode-extension/src/providers/DashboardProvider.ts index c4ef99c7..7dae5723 100644 --- a/packages/vscode-extension/src/providers/DashboardProvider.ts +++ b/packages/vscode-extension/src/providers/DashboardProvider.ts @@ -1,549 +1,279 @@ import * as vscode from "vscode"; +import * as path from "path"; +import * as fs from "fs"; -export class DashboardProvider implements vscode.WebviewViewProvider { - public static readonly viewType = "stackcode.dashboard"; - private _view?: vscode.WebviewView; +export class DashboardProvider implements vscode.WebviewViewProvider, vscode.Disposable { + public static readonly viewType = "stackcode.dashboard"; + private _view?: vscode.WebviewView; + private readonly _extensionUri: vscode.Uri; + private _disposables: vscode.Disposable[] = []; - constructor(private readonly _extensionUri: vscode.Uri) {} + constructor(context: vscode.ExtensionContext) { + this._extensionUri = context.extensionUri; + } - public resolveWebviewView( - webviewView: vscode.WebviewView, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - _context: vscode.WebviewViewResolveContext, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - _token: vscode.CancellationToken, - ) { - this._view = webviewView; + public resolveWebviewView( + webviewView: vscode.WebviewView, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + context: vscode.WebviewViewResolveContext, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + token: vscode.CancellationToken, + ) { + this._view = webviewView; - webviewView.webview.options = { - enableScripts: true, - localResourceRoots: [this._extensionUri], - }; + webviewView.webview.options = { + enableScripts: true, + localResourceRoots: [vscode.Uri.joinPath(this._extensionUri, 'dist')], + }; - webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); + webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); - // Handle messages from webview - webviewView.webview.onDidReceiveMessage((data: { type: string }) => { - switch (data.type) { - case "init": - vscode.commands.executeCommand("stackcode.init"); - break; - case "generate": - vscode.commands.executeCommand("stackcode.generate.readme"); - break; - case "git": - vscode.commands.executeCommand("stackcode.git.start"); - break; - case "commit": - vscode.commands.executeCommand("stackcode.commit"); - break; - case "validate": - vscode.commands.executeCommand("stackcode.validate"); - break; - case "release": - vscode.commands.executeCommand("stackcode.release"); - break; - } - }); - } + webviewView.webview.onDidReceiveMessage( + async (data: { type: string; payload?: unknown }) => { + console.log(`[StackCode] Received command from webview: ${data.type}`); + + try { + // Tratar comandos específicos do webview + switch (data.type) { + case 'webviewReady': + console.log('[StackCode] Webview reported ready, sending initial data'); + this.updateProjectStats(); + return; + + case 'refreshStats': + this.updateProjectStats(); + return; + + default: + // Executar comando normal do VS Code + await vscode.commands.executeCommand(data.type, data.payload); + } + } catch (error) { + console.error(`[StackCode] Error executing command ${data.type}:`, error); + this.sendMessage({ + type: 'commandError', + payload: { command: data.type, error: error instanceof Error ? error.message : 'Unknown error' } + }); + } + }, + undefined, + this._disposables + ); - public show() { - if (this._view) { - this._view.show?.(true); + // WebviewView doesn't have onDidBecomeVisible, so we'll update stats immediately + this.updateProjectStats(); } - } - dispose() { - // Cleanup if needed - } + public sendMessage(message: { type: string; payload?: unknown }) { + if (this._view) { + this._view.webview.postMessage(message); + } + } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - private _getHtmlForWebview(_webview: vscode.Webview) { - return ` - - - - - StackCode Dashboard - - - -
-
- -
Your Complete Development Assistant
-
+ public show() { + if (this._view) { + this._view.show?.(true); + } else { + // If view is not created yet, trigger the creation by executing the show command + vscode.commands.executeCommand('workbench.view.extension.stackcode'); + } + } -
-
-

📊 Project Overview

-
-
-
23
-
Files
-
-
-
5
-
Branches
-
-
-
42
-
Commits
-
-
-
0
-
Issues
-
-
-
+ private async updateProjectStats() { + if (!this._view) { + console.log('[StackCode] No view available for stats update'); + return; + } -
-

⚡ Quick Actions

-
- - - - - - -
-
+ const workspaceFolders = vscode.workspace.workspaceFolders; + console.log('[StackCode] Workspace folders:', workspaceFolders?.length || 0); + console.log('[StackCode] Workspace name:', vscode.workspace.name); + console.log('[StackCode] Workspace file:', vscode.workspace.workspaceFile?.toString()); + + if (!workspaceFolders || workspaceFolders.length === 0) { + console.log('[StackCode] No workspace folders found, using alternative detection'); + + // Fallback: usar informações do contexto da extensão + const extensionWorkspace = path.dirname(path.dirname(path.dirname(this._extensionUri.fsPath))); + console.log('[StackCode] Extension workspace path:', extensionWorkspace); + + this.sendMessage({ + type: 'updateStats', + payload: { + files: 0, + workspaceName: 'StackCode (Debug)', + workspacePath: extensionWorkspace, + mode: 'development' + } + }); + return; + } -
-

🕒 Recent Activity

-
-
-
🎉
-
-
VS Code Extension Created
-
Successfully packaged and installed StackCode extension
-
-
2 min ago
-
-
-
🔄
-
-
Project Compiled
-
TypeScript compilation completed successfully
-
-
5 min ago
-
-
-
📝
-
-
README Updated
-
Added new documentation sections
-
-
15 min ago
-
-
-
🌟
-
-
Feature Branch
-
Created feature/vscode-proactive-notifications
-
-
30 min ago
-
-
-
+ try { + const files = await vscode.workspace.findFiles('**/*', '**/node_modules/**', 1000); + console.log('[StackCode] Found files:', files.length); + + this.sendMessage({ + type: 'updateStats', + payload: { + files: files.length, + workspaceName: workspaceFolders[0].name, + workspacePath: workspaceFolders[0].uri.fsPath, + mode: 'production' + }, + }); + } catch (e) { + console.error("[StackCode] Error fetching project stats:", e); + this.sendMessage({ + type: 'updateStats', + payload: { files: 0, error: 'Failed to scan files' } + }); + } + } -
-

💡 Pro Tips

-
-
-
🚀 Quick Start
-
Use Ctrl+Shift+P and type "StackCode" to access all commands quickly!
-
-
-
🔄 Auto Monitor
-
The extension automatically monitors your files and suggests improvements.
-
-
-
🎯 Git Flow
-
Follow best practices with automated feature, hotfix, and release workflows.
-
-
-
-
-
+ private _getHtmlForWebview(webview: vscode.Webview): string { + const nonce = getNonce(); + const buildPath = vscode.Uri.joinPath(this._extensionUri, 'dist', 'webview-ui'); + + // Lê o manifest.json do Vite + const manifestPath = path.join(buildPath.fsPath, '.vite', 'manifest.json'); + + console.log('[StackCode] Build path:', buildPath.fsPath); + console.log('[StackCode] Manifest path:', manifestPath); + console.log('[StackCode] Manifest exists:', fs.existsSync(manifestPath)); + + try { + const manifestContent = fs.readFileSync(manifestPath, 'utf-8'); + const manifest = JSON.parse(manifestContent); + console.log('[StackCode] Manifest content:', manifest); - - - `; - } + // Pega os arquivos do manifest do Vite + const indexEntry = manifest['index.html']; + const scriptFile = indexEntry.file; + const cssFiles = indexEntry.css || []; + + const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(buildPath, scriptFile)); + const cssUris = cssFiles.map((cssFile: string) => + webview.asWebviewUri(vscode.Uri.joinPath(buildPath, cssFile)) + ); + + console.log('[StackCode] Script URI:', scriptUri.toString()); + console.log('[StackCode] CSS URIs:', cssUris.map((uri: vscode.Uri) => uri.toString())); + + return ` + + + + + + ${cssUris.map((uri: vscode.Uri) => ``).join('\n ')} + StackCode Dashboard + + +
+ ⏳ Carregando StackCode Dashboard... +
+
+ + + +`; + } catch (error) { + console.error("[StackCode] Error reading manifest:", error); + // Fallback melhorado para desenvolvimento + return ` + + + + + StackCode Dashboard + + + +
+
Development Mode
+

🏗️ StackCode Dashboard

+
+ Build Required: O webview-ui precisa ser compilado primeiro. +

+ Execute: npm run build:ui +

+ Erro: ${error instanceof Error ? error.message : 'Manifest não encontrado'} +
+

Status da extensão: ✅ Ativa

+

Workspace: ${vscode.workspace.workspaceFolders?.[0]?.name || 'Nenhum'}

+
+ +`; + } + } + + // CORREÇÃO: Adicionando o método dispose para conformidade. + public dispose() { + while (this._disposables.length) { + const x = this._disposables.pop(); + if (x) { + x.dispose(); + } + } + } +} + +function getNonce() { + let text = ''; + const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + for (let i = 0; i < 32; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } + return text; } diff --git a/packages/vscode-extension/src/webview-ui/index.html b/packages/vscode-extension/src/webview-ui/index.html index e69de29b..e8a29515 100644 --- a/packages/vscode-extension/src/webview-ui/index.html +++ b/packages/vscode-extension/src/webview-ui/index.html @@ -0,0 +1,12 @@ + + + + + + StackCode UI + + +
+ + + \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/postcss.config.js b/packages/vscode-extension/src/webview-ui/postcss.config.js index e99ebc2c..9c3f9ec9 100644 --- a/packages/vscode-extension/src/webview-ui/postcss.config.js +++ b/packages/vscode-extension/src/webview-ui/postcss.config.js @@ -1,6 +1,9 @@ +// packages/vscode-extension/src/webview-ui/postcss.config.js + export default { plugins: { - tailwindcss: {}, + // CORREÇÃO: Usamos o novo pacote aqui. + '@tailwindcss/postcss': {}, autoprefixer: {}, }, } \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/src/App.tsx b/packages/vscode-extension/src/webview-ui/src/App.tsx index e69de29b..6898ed47 100644 --- a/packages/vscode-extension/src/webview-ui/src/App.tsx +++ b/packages/vscode-extension/src/webview-ui/src/App.tsx @@ -0,0 +1,209 @@ +import React, { useState, useEffect } from 'react'; +import Dashboard from './components/Dashboard'; +import ProjectView from './components/ProjectView'; +import StatusBar from './components/StatusBar'; +import NotificationPanel from './components/NotificationPanel'; +import CommandPalette from './components/CommandPalette'; + +// Mock VSCode API for development +const mockVSCode = { + postMessage: (message: { type: string; payload?: unknown }) => { + console.log('VSCode message:', message); + } +}; + +// Tipagem para a API do VS Code, uma boa prática. +interface VsCodeApi { + postMessage(message: { type: string; payload?: unknown }): void; +} + +// Declaração global para que o TypeScript conheça a função do VS Code. +declare global { + interface Window { + acquireVsCodeApi(): VsCodeApi; + } +} + +interface Notification { + id: string; + type: 'info' | 'warning' | 'error' | 'success' | 'tip'; + title: string; + message: string; + actions?: Array<{ + label: string; + action: string; + primary?: boolean; + }>; + timestamp: Date; + dismissed?: boolean; +} + +// Estado inicial para as estatísticas que receberemos. +const initialStats = { + files: 0, +}; + +function App() { + const [currentView] = useState<'dashboard' | 'project'>('dashboard'); + const [notifications, setNotifications] = useState([ + { + id: '1', + type: 'tip', + title: 'Welcome to StackCode!', + message: 'Get started by initializing your project or exploring the dashboard.', + actions: [ + { label: 'Initialize', action: 'stackcode.init', primary: true }, + { label: 'Learn More', action: 'stackcode.config' } + ], + timestamp: new Date() + } + ]); + const [commandPaletteOpen, setCommandPaletteOpen] = useState(false); + const [currentBranch, setCurrentBranch] = useState('main'); + const [hasChanges, setHasChanges] = useState(false); + const [lastAction, setLastAction] = useState('Ready'); + const [, setStats] = useState(initialStats); + const [isReady, setIsReady] = useState(false); + const [vscode] = useState(() => { + return typeof window !== 'undefined' && 'acquireVsCodeApi' in window + ? (window as { acquireVsCodeApi: () => VsCodeApi }).acquireVsCodeApi() + : mockVSCode; + }); + + useEffect(() => { + // Listen for keyboard shortcuts + const handleKeyDown = (e: KeyboardEvent) => { + if ((e.metaKey || e.ctrlKey) && e.key === 'k') { + e.preventDefault(); + setCommandPaletteOpen(true); + } + if (e.key === 'Escape') { + setCommandPaletteOpen(false); + } + }; + + document.addEventListener('keydown', handleKeyDown); + return () => document.removeEventListener('keydown', handleKeyDown); + }, []); + + useEffect(() => { + // Listener para mensagens vindas da extensão (o "backend"). + const handleMessage = (event: MessageEvent) => { + const message = event.data; + console.log('Message received from extension:', message); + + switch (message.type) { + case 'updateStats': + setStats(prevStats => ({ ...prevStats, ...message.payload })); + break; + case 'updateBranch': + setCurrentBranch(message.payload?.branch || 'main'); + break; + case 'updateChanges': + setHasChanges(message.payload?.hasChanges || false); + break; + } + }; + + window.addEventListener('message', handleMessage); + + // Informa à extensão que a UI está pronta para receber dados. + vscode.postMessage({ type: 'webviewReady' }); + setIsReady(true); + + // Função de limpeza para remover o listener. + return () => { + window.removeEventListener('message', handleMessage); + }; + }, [vscode]); + + const handleCommand = (command: string) => { + console.log('Executing command:', command); + setLastAction(`Executed: ${command}`); + + // Send message to VSCode + vscode.postMessage({ type: command }); + + // Add success notification + const newNotification: Notification = { + id: Date.now().toString(), + type: 'success', + title: 'Command Executed', + message: `Successfully executed: ${command}`, + timestamp: new Date() + }; + + setNotifications(prev => [newNotification, ...prev]); + }; + + const handleNotificationDismiss = (id: string) => { + setNotifications(prev => prev.filter(n => n.id !== id)); + }; + + const handleNotificationAction = (action: string) => { + handleCommand(action); + }; + + const handleQuickAction = (action: string) => { + handleCommand(action); + }; + + if (!isReady) { + return ( +
+
+
+

Initializing StackCode Dashboard...

+
+
+ ); + } + + return ( +
+ {/* Main Content */} +
+ {/* Sidebar - Project View */} +
+ +
+ + {/* Main Panel */} +
+ {currentView === 'dashboard' ? ( + + ) : ( +
+

Project View

+

Project details and management tools will be displayed here.

+
+ )} +
+
+ + {/* Status Bar */} + + + {/* Notifications */} + + + {/* Command Palette */} + setCommandPaletteOpen(false)} + onCommand={handleCommand} + /> +
+ ); +} + +export default App; \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/src/components/CommandPalette.tsx b/packages/vscode-extension/src/webview-ui/src/components/CommandPalette.tsx index e69de29b..dbb9aaee 100644 --- a/packages/vscode-extension/src/webview-ui/src/components/CommandPalette.tsx +++ b/packages/vscode-extension/src/webview-ui/src/components/CommandPalette.tsx @@ -0,0 +1,244 @@ +import React, { useState, useEffect, useRef } from 'react'; +import { + Search, + Command, + GitBranch, + Settings, + Package, + Shield, + Book, + FolderOpen, + GitCommit, + BarChart3 +} from 'lucide-react'; + +interface CommandItem { + id: string; + title: string; + description: string; + icon: React.ReactNode; + command: string; + category: string; + keywords: string[]; +} + +interface CommandPaletteProps { + isOpen: boolean; + onClose: () => void; + onCommand: (command: string) => void; +} + +const CommandPalette: React.FC = ({ + isOpen, + onClose, + onCommand +}) => { + const [query, setQuery] = useState(''); + const [selectedIndex, setSelectedIndex] = useState(0); + const inputRef = useRef(null); + + const commands: CommandItem[] = [ + { + id: 'init', + title: 'Initialize Project', + description: 'Set up StackCode scaffolding for your project', + icon: , + command: 'stackcode.init', + category: 'Project', + keywords: ['init', 'setup', 'scaffold', 'create'] + }, + { + id: 'generate-readme', + title: 'Generate README', + description: 'Create a comprehensive README.md file', + icon: , + command: 'stackcode.generate.readme', + category: 'Generate', + keywords: ['readme', 'documentation', 'docs', 'generate'] + }, + { + id: 'generate-gitignore', + title: 'Generate .gitignore', + description: 'Create .gitignore based on project type', + icon: , + command: 'stackcode.generate.gitignore', + category: 'Generate', + keywords: ['gitignore', 'ignore', 'git', 'generate'] + }, + { + id: 'start-feature', + title: 'Start Feature Branch', + description: 'Begin a new feature using GitFlow', + icon: , + command: 'stackcode.git.start', + category: 'Git', + keywords: ['feature', 'branch', 'git', 'start', 'flow'] + }, + { + id: 'commit', + title: 'Smart Commit', + description: 'Make a conventional commit with validation', + icon: , + command: 'stackcode.commit', + category: 'Git', + keywords: ['commit', 'conventional', 'message', 'git'] + }, + { + id: 'validate', + title: 'Validate Project', + description: 'Check project structure and best practices', + icon: , + command: 'stackcode.validate', + category: 'Tools', + keywords: ['validate', 'check', 'best practices', 'lint'] + }, + { + id: 'release', + title: 'Create Release', + description: 'Create a new release with automated versioning', + icon: , + command: 'stackcode.release', + category: 'Release', + keywords: ['release', 'version', 'publish', 'deploy'] + }, + { + id: 'config', + title: 'Configuration', + description: 'Configure StackCode settings', + icon: , + command: 'stackcode.config', + category: 'Settings', + keywords: ['config', 'settings', 'preferences', 'setup'] + }, + { + id: 'dashboard', + title: 'Show Dashboard', + description: 'Open the interactive StackCode dashboard', + icon: , + command: 'stackcode.dashboard', + category: 'View', + keywords: ['dashboard', 'overview', 'stats', 'view'] + } + ]; + + const filteredCommands = commands.filter(command => { + const searchTerm = query.toLowerCase(); + return ( + command.title.toLowerCase().includes(searchTerm) || + command.description.toLowerCase().includes(searchTerm) || + command.category.toLowerCase().includes(searchTerm) || + command.keywords.some(keyword => keyword.includes(searchTerm)) + ); + }); + + useEffect(() => { + if (isOpen && inputRef.current) { + inputRef.current.focus(); + } + }, [isOpen]); + + useEffect(() => { + setSelectedIndex(0); + }, [query]); + + const handleKeyDown = (e: React.KeyboardEvent) => { + switch (e.key) { + case 'ArrowDown': + e.preventDefault(); + setSelectedIndex(prev => + prev < filteredCommands.length - 1 ? prev + 1 : 0 + ); + break; + case 'ArrowUp': + e.preventDefault(); + setSelectedIndex(prev => + prev > 0 ? prev - 1 : filteredCommands.length - 1 + ); + break; + case 'Enter': + e.preventDefault(); + if (filteredCommands[selectedIndex]) { + handleCommand(filteredCommands[selectedIndex].command); + } + break; + case 'Escape': + e.preventDefault(); + onClose(); + break; + } + }; + + const handleCommand = (command: string) => { + onCommand(command); + onClose(); + setQuery(''); + }; + + if (!isOpen) return null; + + return ( +
+
+ {/* Header */} +
+ + setQuery(e.target.value)} + onKeyDown={handleKeyDown} + className="flex-1 bg-transparent text-white placeholder-slate-400 outline-none" + /> +
+ + + + K +
+
+ + {/* Commands List */} +
+ {filteredCommands.length === 0 ? ( +
+ +

No commands found

+
+ ) : ( +
+ {filteredCommands.map((command, index) => ( + + ))} +
+ )} +
+
+
+ ); +}; + +export default CommandPalette; \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/src/components/Dashboard.tsx b/packages/vscode-extension/src/webview-ui/src/components/Dashboard.tsx index e69de29b..72ac48a7 100644 --- a/packages/vscode-extension/src/webview-ui/src/components/Dashboard.tsx +++ b/packages/vscode-extension/src/webview-ui/src/components/Dashboard.tsx @@ -0,0 +1,306 @@ +import React, { useState, useEffect } from 'react'; +import { + Rocket, + Zap, + GitBranch, + FileText, + CheckCircle, + Star, + Package, + GitCommit, + FolderOpen, + Book, + Shield, + TrendingUp, + Activity, + Users, + Code +} from 'lucide-react'; + +interface DashboardProps { + vscode?: { + postMessage: (message: { type: string; payload?: unknown }) => void; + }; +} + +interface ProjectStats { + files: number; + branches: number; + commits: number; + issues: number; + contributors: number; + linesOfCode: number; +} + +interface ActivityItem { + id: string; + type: 'commit' | 'branch' | 'file' | 'release'; + title: string; + description: string; + timestamp: string; + icon: React.ReactNode; +} + +const Dashboard: React.FC = ({ vscode }) => { + const [stats] = useState({ + files: 23, + branches: 5, + commits: 42, + issues: 0, + contributors: 3, + linesOfCode: 1247 + }); + + const [activities] = useState([ + { + id: '1', + type: 'release', + title: 'VS Code Extension Created', + description: 'Successfully packaged and installed StackCode extension', + timestamp: '2 min ago', + icon: + }, + { + id: '2', + type: 'commit', + title: 'Project Compiled', + description: 'TypeScript compilation completed successfully', + timestamp: '5 min ago', + icon: + }, + { + id: '3', + type: 'file', + title: 'README Updated', + description: 'Added new documentation sections', + timestamp: '15 min ago', + icon: + }, + { + id: '4', + type: 'branch', + title: 'Feature Branch', + description: 'Created feature/vscode-proactive-notifications', + timestamp: '30 min ago', + icon: + } + ]); + + const sendMessage = (type: string) => { + if (vscode) { + vscode.postMessage({ type }); + } + }; + + const quickActions = [ + { + id: 'stackcode.init', + title: 'Initialize Project', + description: 'Set up StackCode scaffolding', + icon: , + color: 'from-blue-500 to-blue-600', + onClick: () => sendMessage('stackcode.init') + }, + { + id: 'stackcode.generate.readme', + title: 'Generate README', + description: 'Create comprehensive docs', + icon: , + color: 'from-green-500 to-green-600', + onClick: () => sendMessage('stackcode.generate.readme') + }, + { + id: 'stackcode.git.start', + title: 'Start Feature', + description: 'Begin new development', + icon: , + color: 'from-purple-500 to-purple-600', + onClick: () => sendMessage('stackcode.git.start') + }, + { + id: 'stackcode.commit', + title: 'Smart Commit', + description: 'Conventional commits', + icon: , + color: 'from-orange-500 to-orange-600', + onClick: () => sendMessage('stackcode.commit') + }, + { + id: 'stackcode.validate', + title: 'Validate Project', + description: 'Check best practices', + icon: , + color: 'from-red-500 to-red-600', + onClick: () => sendMessage('stackcode.validate') + }, + { + id: 'stackcode.release', + title: 'Create Release', + description: 'Package and deploy', + icon: , + color: 'from-indigo-500 to-indigo-600', + onClick: () => sendMessage('stackcode.release') + } + ]; + + const tips = [ + { + title: '🚀 Quick Start', + description: 'Use Ctrl+Shift+P and type "StackCode" to access all commands quickly!' + }, + { + title: '🔄 Auto Monitor', + description: 'The extension automatically monitors your files and suggests improvements.' + }, + { + title: '🎯 Git Flow', + description: 'Follow best practices with automated feature, hotfix, and release workflows.' + }, + { + title: '📊 Analytics', + description: 'Track your development progress with built-in project analytics.' + } + ]; + + useEffect(() => { + // Animate numbers on load + const animateNumbers = () => { + const elements = document.querySelectorAll('.animate-number'); + elements.forEach((el) => { + const target = parseInt(el.textContent || '0'); + let current = 0; + const increment = target / 30; + const timer = setInterval(() => { + current += increment; + if (current >= target) { + el.textContent = target.toString(); + clearInterval(timer); + } else { + el.textContent = Math.floor(current).toString(); + } + }, 50); + }); + }; + + setTimeout(animateNumbers, 100); + }, []); + + return ( +
+ {/* Header */} +
+
+
+
+ +

+ StackCode +

+
+

+ Your Complete Development Assistant +

+
+
+
+
+ +
+ {/* Stats Grid */} +
+ {[ + { label: 'Files', value: stats.files, icon: , color: 'text-blue-400' }, + { label: 'Branches', value: stats.branches, icon: , color: 'text-green-400' }, + { label: 'Commits', value: stats.commits, icon: , color: 'text-purple-400' }, + { label: 'Issues', value: stats.issues, icon: , color: 'text-red-400' }, + { label: 'Contributors', value: stats.contributors, icon: , color: 'text-orange-400' }, + { label: 'Lines', value: stats.linesOfCode, icon: , color: 'text-indigo-400' } + ].map((stat, index) => ( +
+
+
+ {stat.icon} +
+ +
+
{stat.value}
+
{stat.label}
+
+ ))} +
+ + {/* Main Content Grid */} +
+ {/* Quick Actions */} +
+
+
+ +

Quick Actions

+
+
+ {quickActions.map((action) => ( + + ))} +
+
+
+ + {/* Recent Activity */} +
+
+ +

Recent Activity

+
+
+ {activities.map((activity) => ( +
+
+ {activity.icon} +
+
+

{activity.title}

+

{activity.description}

+ {activity.timestamp} +
+
+ ))} +
+
+
+ + {/* Pro Tips */} +
+
+ +

Pro Tips

+
+
+ {tips.map((tip, index) => ( +
+

{tip.title}

+

{tip.description}

+
+ ))} +
+
+
+
+ ); +}; + +export default Dashboard; diff --git a/packages/vscode-extension/src/webview-ui/src/components/NotificationPanel.tsx b/packages/vscode-extension/src/webview-ui/src/components/NotificationPanel.tsx index e69de29b..410c4024 100644 --- a/packages/vscode-extension/src/webview-ui/src/components/NotificationPanel.tsx +++ b/packages/vscode-extension/src/webview-ui/src/components/NotificationPanel.tsx @@ -0,0 +1,142 @@ +import React, { useState, useEffect } from 'react'; +import { + X, + CheckCircle, + AlertTriangle, + Info, + AlertCircle, + Lightbulb +} from 'lucide-react'; + +interface Notification { + id: string; + type: 'info' | 'warning' | 'error' | 'success' | 'tip'; + title: string; + message: string; + actions?: Array<{ + label: string; + action: string; + primary?: boolean; + }>; + timestamp: Date; + dismissed?: boolean; +} + +interface NotificationPanelProps { + notifications: Notification[]; + onDismiss: (id: string) => void; + onAction: (action: string) => void; +} + +const NotificationPanel: React.FC = ({ + notifications, + onDismiss, + onAction +}) => { + const [visibleNotifications, setVisibleNotifications] = useState([]); + + useEffect(() => { + setVisibleNotifications(notifications.filter(n => !n.dismissed)); + }, [notifications]); + + const getNotificationIcon = (type: string) => { + switch (type) { + case 'success': + return ; + case 'warning': + return ; + case 'error': + return ; + case 'tip': + return ; + default: + return ; + } + }; + + const getNotificationBorder = (type: string) => { + switch (type) { + case 'success': + return 'border-l-green-400'; + case 'warning': + return 'border-l-yellow-400'; + case 'error': + return 'border-l-red-400'; + case 'tip': + return 'border-l-blue-400'; + default: + return 'border-l-slate-400'; + } + }; + + const handleDismiss = (id: string) => { + setVisibleNotifications(prev => prev.filter(n => n.id !== id)); + onDismiss(id); + }; + + const handleAction = (action: string, notificationId: string) => { + onAction(action); + handleDismiss(notificationId); + }; + + if (visibleNotifications.length === 0) { + return null; + } + + return ( +
+ {visibleNotifications.map((notification) => ( +
+
+
+ {getNotificationIcon(notification.type)} +
+ +
+

+ {notification.title} +

+

+ {notification.message} +

+ + {notification.actions && notification.actions.length > 0 && ( +
+ {notification.actions.map((action, index) => ( + + ))} +
+ )} + +
+ {notification.timestamp.toLocaleTimeString()} +
+
+ + +
+
+ ))} +
+ ); +}; + +export default NotificationPanel; \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/src/components/ProjectView.tsx b/packages/vscode-extension/src/webview-ui/src/components/ProjectView.tsx index e69de29b..8d9cca1f 100644 --- a/packages/vscode-extension/src/webview-ui/src/components/ProjectView.tsx +++ b/packages/vscode-extension/src/webview-ui/src/components/ProjectView.tsx @@ -0,0 +1,254 @@ +import React, { useState } from 'react'; +import { + ChevronDown, + ChevronRight, + GitBranch, + Settings, + Zap, + Book, + Shield, + GitCommit, + Package, + Flame, + BarChart3, + HelpCircle, + Play, + FolderOpen, + Rocket +} from 'lucide-react'; + +interface TreeItem { + id: string; + label: string; + icon: React.ReactNode; + description?: string; + command?: string; + children?: TreeItem[]; + expanded?: boolean; +} + +interface ProjectViewProps { + onCommand?: (command: string) => void; +} + +const ProjectView: React.FC = ({ onCommand }) => { + const [treeData, setTreeData] = useState([ + { + id: 'stackcode-project', + label: 'StackCode Project', + icon: , + expanded: true, + children: [ + { + id: 'quick-actions', + label: 'Quick Actions', + icon: , + expanded: true, + children: [ + { + id: 'init-project', + label: 'Initialize Project', + icon: , + description: 'Set up StackCode scaffolding', + command: 'stackcode.init' + }, + { + id: 'generate-readme', + label: 'Generate README', + icon: , + description: 'Create comprehensive documentation', + command: 'stackcode.generate.readme' + }, + { + id: 'generate-gitignore', + label: 'Generate .gitignore', + icon: , + description: 'Create .gitignore based on project type', + command: 'stackcode.generate.gitignore' + }, + { + id: 'validate-project', + label: 'Validate Project', + icon: , + description: 'Check project structure and best practices', + command: 'stackcode.validate' + } + ] + }, + { + id: 'git-workflow', + label: 'Git Workflow', + icon: , + expanded: true, + children: [ + { + id: 'start-feature', + label: 'Start Feature', + icon: , + description: 'Begin a new feature using GitFlow', + command: 'stackcode.git.start' + }, + { + id: 'create-hotfix', + label: 'Create Hotfix', + icon: , + description: 'Create a hotfix branch for urgent fixes', + command: 'stackcode.git.finish' + }, + { + id: 'make-release', + label: 'Make Release', + icon: , + description: 'Create a new release with automated versioning', + command: 'stackcode.release' + }, + { + id: 'commit-changes', + label: 'Commit Changes', + icon: , + description: 'Make a conventional commit with validation', + command: 'stackcode.commit' + } + ] + }, + { + id: 'project-tools', + label: 'Project Tools', + icon: , + expanded: false, + children: [ + { + id: 'configuration', + label: 'Configuration', + icon: , + description: 'Configure StackCode settings', + command: 'stackcode.config' + }, + { + id: 'show-dashboard', + label: 'Show Dashboard', + icon: , + description: 'Open the interactive StackCode dashboard', + command: 'stackcode.dashboard' + }, + { + id: 'project-stats', + label: 'View Project Stats', + icon: , + description: 'See detailed project statistics', + command: 'stackcode.validate' + }, + { + id: 'help-docs', + label: 'Help & Documentation', + icon: , + description: 'Access StackCode documentation', + command: 'stackcode.config' + } + ] + } + ] + } + ]); + + const toggleExpanded = (id: string) => { + const updateTree = (items: TreeItem[]): TreeItem[] => { + return items.map(item => { + if (item.id === id) { + return { ...item, expanded: !item.expanded }; + } + if (item.children) { + return { ...item, children: updateTree(item.children) }; + } + return item; + }); + }; + + setTreeData(updateTree(treeData)); + }; + + const handleCommand = (command: string) => { + if (onCommand) { + onCommand(command); + } + }; + + const renderTreeItem = (item: TreeItem, level: number = 0) => { + const hasChildren = item.children && item.children.length > 0; + const isExpanded = item.expanded; + + return ( +
+
0 ? 'ml-4' : '' + }`} + onClick={() => { + if (hasChildren) { + toggleExpanded(item.id); + } else if (item.command) { + handleCommand(item.command); + } + }} + style={{ paddingLeft: `${level * 16 + 8}px` }} + > + {hasChildren && ( +
+ {isExpanded ? ( + + ) : ( + + )} +
+ )} + + {!hasChildren &&
} + +
+ {item.icon} +
+ +
+
+ {item.label} +
+ {item.description && ( +
+ {item.description} +
+ )} +
+ + {item.command && ( +
+ +
+ )} +
+ + {hasChildren && isExpanded && ( +
+ {item.children!.map(child => renderTreeItem(child, level + 1))} +
+ )} +
+ ); + }; + + return ( +
+
+
+ +

StackCode

+
+ +
+ {treeData.map(item => renderTreeItem(item))} +
+
+
+ ); +}; + +export default ProjectView; \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/src/components/StatusBar.tsx b/packages/vscode-extension/src/webview-ui/src/components/StatusBar.tsx index e69de29b..8252433f 100644 --- a/packages/vscode-extension/src/webview-ui/src/components/StatusBar.tsx +++ b/packages/vscode-extension/src/webview-ui/src/components/StatusBar.tsx @@ -0,0 +1,74 @@ +import React, { useState, useEffect } from 'react'; +import { GitBranch, CheckCircle, AlertTriangle, Clock, Zap } from 'lucide-react'; + +interface StatusBarProps { + currentBranch?: string; + hasChanges?: boolean; + lastAction?: string; + onQuickAction?: (action: string) => void; +} + +const StatusBar: React.FC = ({ + currentBranch = 'main', + hasChanges = false, + lastAction = 'Ready', + onQuickAction +}) => { + const [time, setTime] = useState(new Date()); + + useEffect(() => { + const timer = setInterval(() => { + setTime(new Date()); + }, 1000); + + return () => clearInterval(timer); + }, []); + + const getStatusColor = () => { + if (hasChanges) return 'text-yellow-400'; + if (currentBranch === 'main' || currentBranch === 'master') return 'text-red-400'; + return 'text-green-400'; + }; + + const getStatusIcon = () => { + if (hasChanges) return ; + return ; + }; + + return ( +
+
+ {/* Git Status */} +
+ + {currentBranch} + {getStatusIcon()} +
+ + {/* Last Action */} +
+ + {lastAction} +
+
+ +
+ {/* Quick Actions */} + + + {/* Time */} +
+ {time.toLocaleTimeString()} +
+
+
+ ); +}; + +export default StatusBar; \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/src/index.css b/packages/vscode-extension/src/webview-ui/src/index.css index e69de29b..9793e45e 100644 --- a/packages/vscode-extension/src/webview-ui/src/index.css +++ b/packages/vscode-extension/src/webview-ui/src/index.css @@ -0,0 +1,256 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +/* Estilos base para garantir compatibilidade com VS Code */ +@layer base { + * { + margin: 0; + padding: 0; + box-sizing: border-box; + } + + html, + body, + #root { + height: 100%; + overflow: hidden; + } + + body { + font-family: var(--vscode-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif); + font-size: var(--vscode-font-size, 13px); + color: var(--vscode-editor-foreground, #cccccc); + background-color: var(--vscode-editor-background, #1e1e1e); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + } + + /* Garantir que o container principal use toda a altura */ + #root { + display: flex; + flex-direction: column; + } +} + +/* Cores customizadas essenciais - tons mais suaves para VS Code */ +@layer utilities { + /* Backgrounds slate - integrados com VS Code theme */ + .bg-slate-700 { background-color: var(--vscode-sideBar-background, #252526); } + .bg-slate-800 { background-color: var(--vscode-editor-background, #1e1e1e); } + .bg-slate-900 { background-color: var(--vscode-panel-background, #181818); } + .bg-slate-700\/50 { background-color: rgba(37, 37, 38, 0.5); } + .bg-slate-800\/30 { background-color: rgba(30, 30, 30, 0.3); } + .bg-slate-800\/50 { background-color: rgba(30, 30, 30, 0.5); } + .bg-slate-800\/70 { background-color: rgba(30, 30, 30, 0.7); } + .bg-slate-700\/30 { background-color: rgba(37, 37, 38, 0.3); } + + /* Background extras */ + .bg-white\/5 { background-color: rgba(255, 255, 255, 0.05); } + .bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); } + .bg-white\/20 { background-color: rgba(255, 255, 255, 0.2); } + .bg-black\/20 { background-color: rgba(0, 0, 0, 0.2); } + + /* Text colors - mais integradas com VS Code */ + .text-blue-100 { color: #dbeafe; } + .text-blue-200 { color: #bfdbfe; } + .text-blue-400 { color: #60a5fa; } + .text-green-400 { color: #4ade80; } + .text-purple-400 { color: #a78bfa; } + .text-red-400 { color: #f87171; } + .text-orange-400 { color: #fb923c; } + .text-indigo-400 { color: #818cf8; } + .text-yellow-400 { color: #facc15; } + .text-white { color: var(--vscode-editor-foreground, #ffffff); } + .text-slate-300 { color: var(--vscode-descriptionForeground, #cccccc99); } + .text-slate-400 { color: var(--vscode-disabledForeground, #cccccc80); } + .text-slate-500 { color: var(--vscode-widget-shadow, #00000026); } + + /* Border colors - mais sutis */ + .border-slate-600 { border-color: var(--vscode-panel-border, #80808059); } + .border-slate-700 { border-color: var(--vscode-widget-border, #303031); } + + /* Tamanhos */ + .w-4 { width: 1rem; } + .w-5 { width: 1.25rem; } + .w-6 { width: 1.5rem; } + .w-8 { width: 2rem; } + .w-10 { width: 2.5rem; } + .w-12 { width: 3rem; } + .w-48 { width: 12rem; } + .w-64 { width: 16rem; } + .w-80 { width: 20rem; } + + .h-4 { height: 1rem; } + .h-5 { height: 1.25rem; } + .h-6 { height: 1.5rem; } + .h-8 { height: 2rem; } + .h-10 { height: 2.5rem; } + .h-12 { height: 3rem; } + .h-48 { height: 12rem; } + .h-64 { height: 16rem; } + .h-80 { height: 20rem; } + + .max-w-7xl { max-width: 80rem; } + .max-h-80 { max-height: 20rem; } + + /* Grid e flex */ + .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } + .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } + + /* Padding e margin */ + .p-3 { padding: 0.75rem; } + .p-4 { padding: 1rem; } + .p-6 { padding: 1.5rem; } + .p-8 { padding: 2rem; } + .px-3 { padding-left: 0.75rem; padding-right: 0.75rem; } + .px-4 { padding-left: 1rem; padding-right: 1rem; } + .py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; } + .py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; } + .mb-1 { margin-bottom: 0.25rem; } + .mb-2 { margin-bottom: 0.5rem; } + .mb-3 { margin-bottom: 0.75rem; } + .mb-4 { margin-bottom: 1rem; } + .mb-6 { margin-bottom: 1.5rem; } + .mt-1 { margin-top: 0.25rem; } + .mt-2 { margin-top: 0.5rem; } + .gap-2 { gap: 0.5rem; } + .gap-3 { gap: 0.75rem; } + .gap-4 { gap: 1rem; } + .gap-8 { gap: 2rem; } + .space-y-4 > * + * { margin-top: 1rem; } + .space-y-8 > * + * { margin-top: 2rem; } + + /* Gradientes - tons mais suaves e VS Code integrados */ + .from-blue-500 { --tw-gradient-from: #3b82f6; } + .to-blue-600 { --tw-gradient-to: #2563eb; } + .from-blue-600 { --tw-gradient-from: #2563eb; } + .via-purple-600 { --tw-gradient-via: #7c3aed; } + .to-blue-800 { --tw-gradient-to: #1e40af; } + .from-green-500 { --tw-gradient-from: #22c55e; } + .to-green-600 { --tw-gradient-to: #16a34a; } + .from-purple-500 { --tw-gradient-from: #8b5cf6; } + .to-purple-600 { --tw-gradient-to: #7c3aed; } + .from-orange-500 { --tw-gradient-from: #f97316; } + .to-orange-600 { --tw-gradient-to: #ea580c; } + .from-red-500 { --tw-gradient-from: #ef4444; } + .to-red-600 { --tw-gradient-to: #dc2626; } + .from-indigo-500 { --tw-gradient-from: #6366f1; } + .to-indigo-600 { --tw-gradient-to: #4f46e5; } + .from-white { --tw-gradient-from: #ffffff; } + .to-blue-200 { --tw-gradient-to: #bfdbfe; } + .from-slate-700\/50 { --tw-gradient-from: rgba(37, 37, 38, 0.4); } + .to-slate-800\/50 { --tw-gradient-to: rgba(30, 30, 30, 0.4); } + .from-slate-600\/50 { --tw-gradient-from: rgba(45, 45, 46, 0.4); } + .to-slate-700\/50 { --tw-gradient-to: rgba(37, 37, 38, 0.4); } + .from-transparent { --tw-gradient-from: transparent; } + .via-white\/20 { --tw-gradient-via: rgba(255, 255, 255, 0.1); } + .to-transparent { --tw-gradient-to: transparent; } + + /* Bordas arredondadas */ + .rounded-md { border-radius: 0.375rem; } + .rounded-lg { border-radius: 0.5rem; } + .rounded-xl { border-radius: 0.75rem; } + .rounded-2xl { border-radius: 1rem; } + + /* Textos */ + .text-xs { font-size: 0.75rem; line-height: 1rem; } + .text-sm { font-size: 0.875rem; line-height: 1.25rem; } + .text-xl { font-size: 1.25rem; line-height: 1.75rem; } + .text-2xl { font-size: 1.5rem; line-height: 2rem; } + .text-4xl { font-size: 2.25rem; line-height: 2.5rem; } + .font-light { font-weight: 300; } + .font-medium { font-weight: 500; } + .font-semibold { font-weight: 600; } + .font-bold { font-weight: 700; } + .leading-relaxed { line-height: 1.625; } + + /* Animações */ + .animate-pulse { + animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; + } + @keyframes pulse { + 0%, 100% { opacity: 1; } + 50% { opacity: .5; } + } + + .animate-spin { + animation: spin 1s linear infinite; + } + @keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } + + .animate-slide-in { + animation: slideIn 0.3s ease-out; + } + @keyframes slideIn { + 0% { + transform: translateX(100%); + opacity: 0; + } + 100% { + transform: translateX(0); + opacity: 1; + } + } + + /* Responsividade */ + @media (min-width: 768px) { + .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } + .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } + } + + @media (min-width: 1024px) { + .lg\:col-span-2 { grid-column: span 2 / span 2; } + .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } + .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } + .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } + } + + /* Estados hover */ + @media (hover: hover) { + .hover\:bg-slate-700\/30:hover { background-color: rgba(51, 65, 85, 0.3); } + .hover\:bg-slate-800\/70:hover { background-color: rgba(30, 41, 59, 0.7); } + .hover\:from-slate-600\/50:hover { --tw-gradient-from: rgba(71, 85, 105, 0.5); } + .hover\:to-slate-700\/50:hover { --tw-gradient-to: rgba(51, 65, 85, 0.5); } + .hover\:scale-105:hover { transform: scale(1.05); } + .hover\:shadow-2xl:hover { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); } + .group:hover .group-hover\:opacity-100 { opacity: 1; } + .group:hover .group-hover\:translate-x-full { transform: translateX(100%); } + } + + /* VS Code specific */ + .text-vscode { + color: var(--vscode-editor-foreground, #cccccc); + } + + .bg-vscode { + background-color: var(--vscode-editor-background, #1e1e1e); + } + + .border-vscode { + border-color: var(--vscode-widget-border, #454545); + } + + /* Scrollbar customizada para combinar com VS Code */ + .custom-scrollbar::-webkit-scrollbar { + width: 14px; + } + + .custom-scrollbar::-webkit-scrollbar-track { + background: var(--vscode-scrollbarSlider-background, transparent); + } + + .custom-scrollbar::-webkit-scrollbar-thumb { + background-color: var(--vscode-scrollbarSlider-background, #79797966); + border-radius: 6px; + border: 3px solid transparent; + background-clip: content-box; + } + + .custom-scrollbar::-webkit-scrollbar-thumb:hover { + background-color: var(--vscode-scrollbarSlider-hoverBackground, #646464b3); + } +} \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/src/main.tsx b/packages/vscode-extension/src/webview-ui/src/main.tsx index e69de29b..886ad41c 100644 --- a/packages/vscode-extension/src/webview-ui/src/main.tsx +++ b/packages/vscode-extension/src/webview-ui/src/main.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import App from './App'; +import './index.css'; + +ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( + + + , +); \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/tailwind.config.js b/packages/vscode-extension/src/webview-ui/tailwind.config.js index f494b1bd..9d2479e8 100644 --- a/packages/vscode-extension/src/webview-ui/tailwind.config.js +++ b/packages/vscode-extension/src/webview-ui/tailwind.config.js @@ -4,16 +4,153 @@ export default { "./index.html", "./src/**/*.{js,ts,jsx,tsx}", ], + safelist: [ + // Cores de texto frequentemente usadas + 'text-blue-400', 'text-green-400', 'text-purple-400', 'text-red-400', + 'text-orange-400', 'text-indigo-400', 'text-yellow-400', 'text-white', + 'text-slate-300', 'text-slate-400', 'text-slate-500', + + // Backgrounds + 'bg-slate-700', 'bg-slate-800', 'bg-slate-900', 'bg-slate-700/50', 'bg-slate-800/30', + 'bg-slate-800/50', 'bg-slate-800/70', 'bg-white/5', 'bg-white/10', 'bg-white/20', + 'bg-black/20', + + // Borders + 'border-slate-600', 'border-slate-700', 'border-l-4', + + // Gradients + 'from-blue-500', 'to-blue-600', 'from-blue-600', 'via-purple-600', 'to-blue-800', + 'from-green-500', 'to-green-600', 'from-purple-500', 'to-purple-600', + 'from-orange-500', 'to-orange-600', 'from-red-500', 'to-red-600', + 'from-indigo-500', 'to-indigo-600', 'from-white', 'to-blue-200', + 'from-slate-700/50', 'to-slate-800/50', 'from-slate-600/50', 'to-slate-700/50', + 'from-transparent', 'via-white/20', 'to-transparent', + + // Animações + 'animate-spin', 'animate-pulse', 'animate-bounce', + + // Tamanhos e espaçamentos + 'w-4', 'w-5', 'w-6', 'w-8', 'w-10', 'w-12', 'w-48', 'w-64', 'w-80', + 'h-4', 'h-5', 'h-6', 'h-8', 'h-10', 'h-12', 'h-48', 'h-64', 'h-80', + 'max-w-7xl', 'max-h-80', + + // Flexbox e Grid + 'lg:col-span-2', 'md:grid-cols-2', 'lg:grid-cols-3', 'lg:grid-cols-4', 'lg:grid-cols-6', + 'grid-cols-2', 'grid-cols-3', + + // Responsividade + 'md:grid-cols-3', 'lg:grid-cols-6', + + // Estados hover + 'hover:bg-slate-700/30', 'hover:bg-slate-800/70', 'hover:from-slate-600/50', + 'hover:to-slate-700/50', 'hover:scale-105', 'hover:shadow-2xl', + 'group-hover:opacity-100', 'group-hover:translate-x-full', + + // Transformações + 'scale-105', '-translate-x-full', 'translate-x-full', '-translate-y-32', + 'translate-x-32', 'translate-y-24', '-translate-x-24', + + // Backdrop + 'backdrop-blur-sm', + + // Z-index + 'z-10', + + // Opacidade + 'opacity-90', 'opacity-100', + + // Transições + 'transition-all', 'transition-colors', 'transition-opacity', 'transition-transform', + 'duration-150', 'duration-200', 'duration-300', 'duration-700', + ], theme: { extend: { colors: { - // Cores que podem ser usadas para mimetizar o tema do VS Code + // Cores específicas do VS Code (fallbacks para quando CSS vars não estão disponíveis) vscode: { - background: 'var(--vscode-editor-background)', - foreground: 'var(--vscode-editor-foreground)', - // ... outras cores que você definiu - } - } + background: 'var(--vscode-editor-background, #1e1e1e)', + foreground: 'var(--vscode-editor-foreground, #cccccc)', + selection: 'var(--vscode-editor-selectionBackground, #264f78)', + hover: 'var(--vscode-list-hoverBackground, #2a2d2e)', + active: 'var(--vscode-list-activeSelectionBackground, #0e639c)', + border: 'var(--vscode-widget-border, #454545)', + accent: 'var(--vscode-focusBorder, #007acc)', + button: 'var(--vscode-button-background, #0e639c)', + buttonHover: 'var(--vscode-button-hoverBackground, #1177bb)', + input: 'var(--vscode-input-background, #3c3c3c)', + sidebar: 'var(--vscode-sideBar-background, #252526)', + panel: 'var(--vscode-panel-background, #1e1e1e)', + }, + // Cores do tema padrão para garantir consistência + slate: { + 50: '#f8fafc', + 100: '#f1f5f9', + 200: '#e2e8f0', + 300: '#cbd5e1', + 400: '#94a3b8', + 500: '#64748b', + 600: '#475569', + 700: '#334155', + 800: '#1e293b', + 900: '#0f172a', + 950: '#020617', + }, + blue: { + 50: '#eff6ff', + 100: '#dbeafe', + 200: '#bfdbfe', + 300: '#93c5fd', + 400: '#60a5fa', + 500: '#3b82f6', + 600: '#2563eb', + 700: '#1d4ed8', + 800: '#1e40af', + 900: '#1e3a8a', + 950: '#172554', + }, + green: { + 400: '#4ade80', + 500: '#22c55e', + 600: '#16a34a', + }, + red: { + 400: '#f87171', + 500: '#ef4444', + 600: '#dc2626', + }, + yellow: { + 400: '#facc15', + 500: '#eab308', + 600: '#ca8a04', + }, + purple: { + 400: '#a78bfa', + 500: '#8b5cf6', + 600: '#7c3aed', + }, + orange: { + 400: '#fb923c', + 500: '#f97316', + 600: '#ea580c', + }, + indigo: { + 400: '#818cf8', + 500: '#6366f1', + 600: '#4f46e5', + }, + }, + animation: { + 'spin': 'spin 1s linear infinite', + 'pulse': 'pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite', + 'bounce': 'bounce 1s infinite', + }, + fontFamily: { + mono: ['var(--vscode-editor-font-family, Consolas)', 'Monaco', 'Courier New', 'monospace'], + sans: ['var(--vscode-font-family, -apple-system)', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'sans-serif'], + }, + fontSize: { + 'vscode': 'var(--vscode-font-size, 13px)', + }, }, }, plugins: [], diff --git a/packages/vscode-extension/src/webview-ui/tsconfig.json b/packages/vscode-extension/src/webview-ui/tsconfig.json index d0104edb..7d6eab50 100644 --- a/packages/vscode-extension/src/webview-ui/tsconfig.json +++ b/packages/vscode-extension/src/webview-ui/tsconfig.json @@ -1,21 +1,18 @@ +// ARQUIVO DE REFERÊNCIA: packages/vscode-extension/src/webview-ui/tsconfig.json { "compilerOptions": { - "target": "ES2020", - "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], + "target": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ESNext"], + "jsx": "react-jsx", "module": "ESNext", - "skipLibCheck": true, - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, + "moduleResolution": "bundler", // Também é bom usar bundler aqui "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, - "jsx": "react-jsx", "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true + "allowSyntheticDefaultImports": true + // ...outras regras de strictness que você queira }, - "include": ["src"], + "include": ["src"], // Ele só precisa "olhar" para a pasta src da UI "references": [{ "path": "./tsconfig.node.json" }] } \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/tsconfig.node.json b/packages/vscode-extension/src/webview-ui/tsconfig.node.json index 216fa6a8..9f33e70a 100644 --- a/packages/vscode-extension/src/webview-ui/tsconfig.node.json +++ b/packages/vscode-extension/src/webview-ui/tsconfig.node.json @@ -1,14 +1,11 @@ -// packages/vscode-extension/src/webview-ui/tsconfig.node.json - +// ARQUIVO-ALVO: packages/vscode-extension/src/webview-ui/tsconfig.node.json { "compilerOptions": { "composite": true, "skipLibCheck": true, "module": "ESNext", - // Altere esta linha de 'bundler' para 'NodeNext' ou 'bundler' - // 'bundler' é o mais recomendado para ambientes de build modernos como Vite. - "moduleResolution": "bundler", + "moduleResolution": "bundler", // <<< ESTA É A LINHA MAIS IMPORTANTE "allowSyntheticDefaultImports": true }, - "include": ["vite.config.ts"] + "include": ["vite.config.ts", "postcss.config.js", "tailwind.config.js"] // Adicionei os outros arquivos de config aqui por boa prática } \ No newline at end of file diff --git a/packages/vscode-extension/src/webview-ui/vite.config.ts b/packages/vscode-extension/src/webview-ui/vite.config.ts index 02f112e7..98418a52 100644 --- a/packages/vscode-extension/src/webview-ui/vite.config.ts +++ b/packages/vscode-extension/src/webview-ui/vite.config.ts @@ -1,19 +1,24 @@ +// packages/vscode-extension/src/webview-ui/vite.config.ts + import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; +import path from 'path'; -// https://vitejs.dev/config/ export default defineConfig({ + root: path.resolve(__dirname), + + // Configuração do CSS com PostCSS + css: { + postcss: path.resolve(__dirname, 'postcss.config.js'), + }, + plugins: [react()], + build: { - // Gera os artefatos de build na pasta 'dist/webview-ui' - // dentro do pacote da extensão, para não poluir a raiz. - outDir: '../../dist/webview-ui', + outDir: path.resolve(__dirname, '..', '..', 'dist', 'webview-ui'), + manifest: true, rollupOptions: { - output: { - entryFileNames: `assets/[name].js`, - chunkFileNames: `assets/[name].js`, - assetFileNames: `assets/[name].[ext]`, - }, + // ... }, }, }); \ No newline at end of file diff --git a/packages/vscode-extension/tsconfig.json b/packages/vscode-extension/tsconfig.json index fedf7eaf..56d7c6dd 100644 --- a/packages/vscode-extension/tsconfig.json +++ b/packages/vscode-extension/tsconfig.json @@ -1,11 +1,10 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - // VS Code Extension specific overrides "module": "CommonJS", "target": "ES2020", "outDir": "out", - "lib": ["ES2020", "DOM"], // Add DOM for console and other browser APIs + "lib": ["ES2020", "DOM"], "sourceMap": true, "rootDir": "src", "strict": true, @@ -14,10 +13,15 @@ "allowSyntheticDefaultImports": true, "skipLibCheck": true, "types": ["jest", "node", "vscode"], - // Override base config for VS Code extensions - "declaration": false, // Not needed for extensions - "composite": false // Not needed for extensions + "declaration": false, + "composite": false }, "include": ["src/**/*"], - "exclude": ["node_modules", "out", "**/*.test.ts"] -} + "exclude": [ + "node_modules", + "out", + "dist", + "**/*.test.ts", + "src/webview-ui" + ] +} \ No newline at end of file From 91b5fa332f9d55e922654852702eca1fd5d3582d Mon Sep 17 00:00:00 2001 From: Yago Azevedo Borba <140000816+YagoBorba@users.noreply.github.com> Date: Fri, 8 Aug 2025 16:56:49 +0000 Subject: [PATCH 3/3] =?UTF-8?q?refactor(vscode-extension):=20=F0=9F=94=A7?= =?UTF-8?q?=20Enhance=20webview=20debugging=20and=20CSP=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🐛 FIXES & IMPROVEMENTS: - Enhanced Content Security Policy for better React app loading - Added comprehensive debug logging for webview HTML generation - Improved error handling and fallback UI for development mode - Added loading indicators and React mount detection - Fixed ESLint configuration to ignore compiled files and build outputs 🔧 WEBVIEW ENHANCEMENTS: - Added 'unsafe-inline' and 'unsafe-eval' to CSP for React compatibility - Implemented loading state with timeout detection for React mount failures - Enhanced manifest reading with detailed console logging - Improved fallback HTML with better error reporting 🧹 CODE QUALITY: - Updated ESLint config to ignore out/, dist/, test/, and config files - Applied consistent code formatting across all files - Cleaned up build artifacts and compilation outputs - Enhanced VS Code workspace configuration 📋 TESTING & VALIDATION: - All lint checks now pass without errors - Build system validates successfully - TypeScript compilation without issues - Proper formatting applied to all source files This commit focuses on improving the webview debugging experience and ensuring the React application loads correctly within the VS Code extension environment. --- .github/COMMIT_CONVENTION.md | 29 +- .github/chatmodes/teste.chatmode.md | 2 +- .github/instructions/teste.instructions.md | 2 +- .vscode/extensions.json | 8 +- .vscode/launch.json | 4 +- .vscode/settings.json | 2 +- .vscode/tasks.json | 2 +- eslint.config.mjs | 15 +- .../results.json | 2 +- .../out/commands/BaseCommand.js | 120 ++-- .../out/commands/CommitCommand.js | 31 +- .../out/commands/ConfigCommand.js | 162 +++-- .../out/commands/GenerateCommand.js | 365 ++++++----- .../out/commands/GitCommand.js | 310 +++++---- .../out/commands/InitCommand.js | 296 +++++---- .../out/commands/ReleaseCommand.js | 122 ++-- .../out/commands/ValidateCommand.js | 119 ++-- .../out/config/ConfigurationManager.js | 129 ++-- packages/vscode-extension/out/extension.js | 277 +++++--- .../vscode-extension/out/extension.js.map | 2 +- .../out/monitors/FileMonitor.js | 277 ++++---- .../out/monitors/GitMonitor.js | 364 ++++++----- .../ProactiveNotificationManager.js | 425 +++++++------ .../out/providers/DashboardProvider.backup.js | 381 ++++++----- .../providers/DashboardProvider.backup.js.map | 2 +- .../out/providers/DashboardProvider.js | 381 ++++++----- .../out/providers/DashboardProvider.js.map | 2 +- .../out/providers/ProjectViewProvider.js | 600 +++++++++--------- .../out/test/__mocks__/vscode.js | 92 +-- packages/vscode-extension/out/types.js | 2 +- packages/vscode-extension/src/extension.ts | 10 +- .../src/providers/DashboardProvider.backup.ts | 354 ++++++----- .../src/providers/DashboardProvider.ts | 354 ++++++----- .../src/webview-ui/index.html | 4 +- .../src/webview-ui/postcss.config.js | 4 +- .../src/webview-ui/src/App.tsx | 95 +-- .../src/components/CommandPalette.tsx | 148 ++--- .../webview-ui/src/components/Dashboard.tsx | 241 ++++--- .../src/components/NotificationPanel.tsx | 62 +- .../webview-ui/src/components/ProjectView.tsx | 162 +++-- .../webview-ui/src/components/StatusBar.tsx | 31 +- .../src/webview-ui/src/index.css | 539 ++++++++++++---- .../src/webview-ui/src/main.tsx | 12 +- .../src/webview-ui/tailwind.config.js | 298 +++++---- .../src/webview-ui/tsconfig.json | 2 +- .../src/webview-ui/tsconfig.node.json | 2 +- .../src/webview-ui/vite.config.ts | 18 +- packages/vscode-extension/tsconfig.json | 16 +- 48 files changed, 3986 insertions(+), 2891 deletions(-) diff --git a/.github/COMMIT_CONVENTION.md b/.github/COMMIT_CONVENTION.md index dba1bf80..4178ab22 100644 --- a/.github/COMMIT_CONVENTION.md +++ b/.github/COMMIT_CONVENTION.md @@ -1,6 +1,7 @@ # Conventional Commits Reference ## Format + ``` [optional scope]: @@ -11,18 +12,18 @@ ## Common Types with Emojis -| Emoji | Code | Type | Description | -|-------|------|------|-------------| -| ✨ | `:sparkles:` | `feat` | Introduce new features | -| 🐛 | `:bug:` | `fix` | Fix a bug | -| 📝 | `:memo:` | `docs` | Add or update documentation | -| 🎨 | `:art:` | `style` | Improve structure/format of code | -| ♻️ | `:recycle:` | `refactor` | Refactor code | -| ⚡️ | `:zap:` | `perf` | Improve performance | -| ✅ | `:white_check_mark:` | `test` | Add, update, or pass tests | -| 🔧 | `:wrench:` | `chore` | Add or update configuration files | -| 🚀 | `:rocket:` | `build` | Deploy stuff | -| 👷 | `:construction_worker:` | `ci` | Add or update CI build system | +| Emoji | Code | Type | Description | +| ----- | ----------------------- | ---------- | --------------------------------- | +| ✨ | `:sparkles:` | `feat` | Introduce new features | +| 🐛 | `:bug:` | `fix` | Fix a bug | +| 📝 | `:memo:` | `docs` | Add or update documentation | +| 🎨 | `:art:` | `style` | Improve structure/format of code | +| ♻️ | `:recycle:` | `refactor` | Refactor code | +| ⚡️ | `:zap:` | `perf` | Improve performance | +| ✅ | `:white_check_mark:` | `test` | Add, update, or pass tests | +| 🔧 | `:wrench:` | `chore` | Add or update configuration files | +| 🚀 | `:rocket:` | `build` | Deploy stuff | +| 👷 | `:construction_worker:` | `ci` | Add or update CI build system | ## Examples @@ -44,17 +45,21 @@ git commit -m "🔧 chore: update ESLint configuration for TypeScript" ``` ## Breaking Changes + Add `!` after the type for breaking changes: + ```bash git commit -m "💥 feat!: remove deprecated authentication methods" ``` ## Scope Guidelines + - Use lowercase - Be specific but concise - Examples: `auth`, `api`, `ui`, `core`, `cli`, `docs` ## Body and Footer + - Use imperative mood ("add" not "added") - Explain the what and why, not the how - Reference issues: `Closes #123`, `Fixes #456` diff --git a/.github/chatmodes/teste.chatmode.md b/.github/chatmodes/teste.chatmode.md index 0bbbe5b0..81778ab2 100644 --- a/.github/chatmodes/teste.chatmode.md +++ b/.github/chatmodes/teste.chatmode.md @@ -40,4 +40,4 @@ Este modo ativa um comportamento de **parceria intelectual** combinado com exper - Edição de arquivos com contexto completo - Terminal para operações de desenvolvimento - Documentação técnica detalhada -``` \ No newline at end of file +``` diff --git a/.github/instructions/teste.instructions.md b/.github/instructions/teste.instructions.md index 48f57e84..5681675d 100644 --- a/.github/instructions/teste.instructions.md +++ b/.github/instructions/teste.instructions.md @@ -54,4 +54,4 @@ Principais tipos: - Use linguagem simples e clara - Preserve contexto e histórico da conversa - Se desviar do tema, redirecione gentilmente para programação mantendo postura construtiva -``` \ No newline at end of file +``` diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 91cd9197..8bb9f486 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,8 +1,4 @@ { - "recommendations": [ - "ms-vscode.vscode-json" - ], - "unwantedRecommendations": [ - "equinusocio.vsc-material-theme-icons" - ] + "recommendations": ["ms-vscode.vscode-json"], + "unwantedRecommendations": ["equinusocio.vsc-material-theme-icons"] } diff --git a/.vscode/launch.json b/.vscode/launch.json index 2c47bb0c..007f6ebe 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,7 +8,9 @@ "name": "Run VSCode Extension", "type": "extensionHost", "request": "launch", - "args": ["--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-extension"], + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-extension" + ], "outFiles": ["${workspaceFolder}/packages/vscode-extension/out/**/*.js"], "preLaunchTask": "npm: compile:ext" }, diff --git a/.vscode/settings.json b/.vscode/settings.json index 58213ff5..ca8dc151 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "files.associations": { "*.json": "jsonc", - "tsconfig*.json": "jsonc", + "tsconfig*.json": "jsonc", "launch.json": "jsonc", "tasks.json": "jsonc", "package.json": "jsonc", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index b67a06b8..b7ae3c4d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -24,7 +24,7 @@ }, { "label": "npm: build", - "type": "shell", + "type": "shell", "command": "npm", "args": ["run", "build"], "options": { diff --git a/eslint.config.mjs b/eslint.config.mjs index a74a4e20..78e0ab04 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -4,7 +4,20 @@ import js from "@eslint/js"; export default [ { - ignores: ["node_modules/", "dist/", "coverage/", "packages/*/dist/"], + ignores: [ + "node_modules/", + "dist/", + "coverage/", + "packages/*/dist/", + "packages/*/out/", + "packages/*/build/", + "packages/**/test/", + "packages/**/__mocks__/", + "**/*.js.map", + "**/vite.config.*", + "**/tailwind.config.*", + "**/postcss.config.*", + ], }, js.configs.recommended, ...tseslint.configs.recommended, diff --git a/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json b/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json index 6a80e0d9..62d44269 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":6.982812000000024,"failed":false}],[":test/github.test.ts",{"duration":5.412007999999986,"failed":false}],[":test/validator.test.ts",{"duration":3.9987890000000164,"failed":false}]]} \ No newline at end of file +{"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 diff --git a/packages/vscode-extension/out/commands/BaseCommand.js b/packages/vscode-extension/out/commands/BaseCommand.js index 6cdfd572..26326af0 100644 --- a/packages/vscode-extension/out/commands/BaseCommand.js +++ b/packages/vscode-extension/out/commands/BaseCommand.js @@ -1,58 +1,84 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.BaseCommand = void 0; const vscode = __importStar(require("vscode")); class BaseCommand { - async showError(message) { - vscode.window.showErrorMessage(`StackCode: ${message}`); - } - async showWarning(message) { - vscode.window.showWarningMessage(`StackCode: ${message}`); - } - async showInfo(message) { - vscode.window.showInformationMessage(`StackCode: ${message}`); - } - async showSuccess(message) { - vscode.window.showInformationMessage(`✅ ${message}`); - } - getCurrentWorkspaceFolder() { - return vscode.workspace.workspaceFolders?.[0]; - } - async runTerminalCommand(command, cwd) { - const terminal = vscode.window.createTerminal({ - name: "StackCode", - cwd: cwd || this.getCurrentWorkspaceFolder()?.uri.fsPath, - }); - terminal.sendText(command); - terminal.show(); - } - async confirmAction(message, confirmText = "Yes") { - const result = await vscode.window.showWarningMessage(message, { modal: true }, confirmText, "Cancel"); - return result === confirmText; - } + async showError(message) { + vscode.window.showErrorMessage(`StackCode: ${message}`); + } + async showWarning(message) { + vscode.window.showWarningMessage(`StackCode: ${message}`); + } + async showInfo(message) { + vscode.window.showInformationMessage(`StackCode: ${message}`); + } + async showSuccess(message) { + vscode.window.showInformationMessage(`✅ ${message}`); + } + getCurrentWorkspaceFolder() { + return vscode.workspace.workspaceFolders?.[0]; + } + async runTerminalCommand(command, cwd) { + const terminal = vscode.window.createTerminal({ + name: "StackCode", + cwd: cwd || this.getCurrentWorkspaceFolder()?.uri.fsPath, + }); + terminal.sendText(command); + terminal.show(); + } + async confirmAction(message, confirmText = "Yes") { + const result = await vscode.window.showWarningMessage( + message, + { modal: true }, + confirmText, + "Cancel", + ); + return result === confirmText; + } } exports.BaseCommand = BaseCommand; -//# sourceMappingURL=BaseCommand.js.map \ No newline at end of file +//# sourceMappingURL=BaseCommand.js.map diff --git a/packages/vscode-extension/out/commands/CommitCommand.js b/packages/vscode-extension/out/commands/CommitCommand.js index e9c8d180..48be7bb3 100644 --- a/packages/vscode-extension/out/commands/CommitCommand.js +++ b/packages/vscode-extension/out/commands/CommitCommand.js @@ -3,22 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.CommitCommand = void 0; const BaseCommand_1 = require("./BaseCommand"); class CommitCommand extends BaseCommand_1.BaseCommand { - async execute() { - try { - const workspaceFolder = this.getCurrentWorkspaceFolder(); - if (!workspaceFolder) { - this.showError("No workspace folder found"); - 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!"); - } - catch (error) { - this.showError(`Failed to open commit dialog: ${error}`); - } + async execute() { + try { + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + 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!"); + } catch (error) { + this.showError(`Failed to open commit dialog: ${error}`); } + } } exports.CommitCommand = CommitCommand; -//# sourceMappingURL=CommitCommand.js.map \ No newline at end of file +//# sourceMappingURL=CommitCommand.js.map diff --git a/packages/vscode-extension/out/commands/ConfigCommand.js b/packages/vscode-extension/out/commands/ConfigCommand.js index 62dabaac..e7e74aab 100644 --- a/packages/vscode-extension/out/commands/ConfigCommand.js +++ b/packages/vscode-extension/out/commands/ConfigCommand.js @@ -1,82 +1,110 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConfigCommand = void 0; const vscode = __importStar(require("vscode")); const BaseCommand_1 = require("./BaseCommand"); class ConfigCommand extends BaseCommand_1.BaseCommand { - async execute() { + async execute() { + try { + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + return; + } + const action = await vscode.window.showQuickPick( + [ + { + label: "Open StackCode Settings", + description: "Configure StackCode extension settings", + }, + { + label: "Open Project Config", + description: "Edit .stackcoderc.json file", + }, + { + label: "Create Project Config", + description: "Create a new .stackcoderc.json file", + }, + ], + { + placeHolder: "What would you like to configure?", + }, + ); + if (!action) { + return; + } + if (action.label === "Open StackCode Settings") { + vscode.commands.executeCommand( + "workbench.action.openSettings", + "stackcode", + ); + } else if (action.label === "Open Project Config") { + const configPath = vscode.Uri.joinPath( + workspaceFolder.uri, + ".stackcoderc.json", + ); try { - const workspaceFolder = this.getCurrentWorkspaceFolder(); - if (!workspaceFolder) { - this.showError("No workspace folder found"); - return; - } - const action = await vscode.window.showQuickPick([ - { - label: "Open StackCode Settings", - description: "Configure StackCode extension settings", - }, - { - label: "Open Project Config", - description: "Edit .stackcoderc.json file", - }, - { - label: "Create Project Config", - description: "Create a new .stackcoderc.json file", - }, - ], { - placeHolder: "What would you like to configure?", - }); - if (!action) { - return; - } - if (action.label === "Open StackCode Settings") { - vscode.commands.executeCommand("workbench.action.openSettings", "stackcode"); - } - else if (action.label === "Open Project Config") { - const configPath = vscode.Uri.joinPath(workspaceFolder.uri, ".stackcoderc.json"); - try { - 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.'); - } - } - else if (action.label === "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!"); - } - } - catch (error) { - this.showError(`Failed to open configuration: ${error}`); + 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.', + ); } + } else if (action.label === "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!"); + } + } catch (error) { + this.showError(`Failed to open configuration: ${error}`); } + } } exports.ConfigCommand = ConfigCommand; -//# sourceMappingURL=ConfigCommand.js.map \ No newline at end of file +//# sourceMappingURL=ConfigCommand.js.map diff --git a/packages/vscode-extension/out/commands/GenerateCommand.js b/packages/vscode-extension/out/commands/GenerateCommand.js index 2030b473..48af3434 100644 --- a/packages/vscode-extension/out/commands/GenerateCommand.js +++ b/packages/vscode-extension/out/commands/GenerateCommand.js @@ -1,181 +1,220 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GenerateCommand = void 0; const vscode = __importStar(require("vscode")); const BaseCommand_1 = require("./BaseCommand"); const path = __importStar(require("path")); class GenerateCommand extends BaseCommand_1.BaseCommand { - async execute() { - const option = await vscode.window.showQuickPick([ - { - label: "README.md", - description: "Generate a comprehensive README file", - }, - { - label: ".gitignore", - description: "Generate a .gitignore file based on project type", - }, - { - label: "Both", - description: "Generate both README.md and .gitignore", - }, - ], { - placeHolder: "What would you like to generate?", - }); - if (!option) { - return; - } - if (option.label === "README.md") { - await this.generateReadme(); - } - else if (option.label === ".gitignore") { - await this.generateGitignore(); - } - else if (option.label === "Both") { - await this.generateReadme(); - await this.generateGitignore(); - } + async execute() { + const option = await vscode.window.showQuickPick( + [ + { + label: "README.md", + description: "Generate a comprehensive README file", + }, + { + label: ".gitignore", + description: "Generate a .gitignore file based on project type", + }, + { + label: "Both", + description: "Generate both README.md and .gitignore", + }, + ], + { + placeHolder: "What would you like to generate?", + }, + ); + if (!option) { + return; } - async generateReadme() { - try { - const workspaceFolder = this.getCurrentWorkspaceFolder(); - if (!workspaceFolder) { - this.showError("No workspace folder found"); - return; - } - const readmePath = path.join(workspaceFolder.uri.fsPath, "README.md"); - // Check if README already exists - 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"); - if (!overwrite) { - return; - } - } - catch { - // File doesn't exist, which is fine - } - vscode.window.withProgress({ - location: vscode.ProgressLocation.Notification, - title: "Generating README.md", - cancellable: false, - }, async (progress) => { - progress.report({ - increment: 0, - message: "Analyzing project structure...", - }); - // Use StackCode CLI for generation - const command = `npx @stackcode/cli generate readme`; - progress.report({ increment: 50, message: "Generating content..." }); - await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); - progress.report({ - increment: 100, - message: "README.md generated successfully!", - }); - }); - this.showSuccess("README.md has been generated successfully!"); - // 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"); - if (openFile === "Open File") { - const document = await vscode.workspace.openTextDocument(readmePath); - await vscode.window.showTextDocument(document); - } - } - catch (error) { - this.showError(`Failed to generate README.md: ${error}`); - } + if (option.label === "README.md") { + await this.generateReadme(); + } else if (option.label === ".gitignore") { + await this.generateGitignore(); + } else if (option.label === "Both") { + await this.generateReadme(); + await this.generateGitignore(); } - async generateGitignore() { - try { - const workspaceFolder = this.getCurrentWorkspaceFolder(); - if (!workspaceFolder) { - this.showError("No workspace folder found"); - return; - } - const gitignorePath = path.join(workspaceFolder.uri.fsPath, ".gitignore"); - // Check if .gitignore already exists - 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"); - if (!overwrite) { - return; - } - } - catch { - // File doesn't exist, which is fine - } - // 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" }, - ], { - placeHolder: "Select project type for .gitignore", - }); - if (!projectType) { - return; - } - vscode.window.withProgress({ - location: vscode.ProgressLocation.Notification, - title: "Generating .gitignore", - cancellable: false, - }, async (progress) => { - progress.report({ - increment: 0, - message: "Generating .gitignore content...", - }); - // Use StackCode CLI for generation - const command = `npx @stackcode/cli generate gitignore --type="${projectType.label}"`; - progress.report({ increment: 50, message: "Creating file..." }); - await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); - progress.report({ - increment: 100, - message: ".gitignore generated successfully!", - }); - }); - this.showSuccess(".gitignore has been generated successfully!"); - // Ask if user wants to open the file - const openFile = await vscode.window.showInformationMessage("Would you like to open the generated .gitignore?", "Open File"); - if (openFile === "Open File") { - const document = await vscode.workspace.openTextDocument(gitignorePath); - await vscode.window.showTextDocument(document); - } + } + async generateReadme() { + try { + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + return; + } + const readmePath = path.join(workspaceFolder.uri.fsPath, "README.md"); + // Check if README already exists + 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", + ); + if (!overwrite) { + return; } - catch (error) { - this.showError(`Failed to generate .gitignore: ${error}`); + } catch { + // File doesn't exist, which is fine + } + vscode.window.withProgress( + { + location: vscode.ProgressLocation.Notification, + title: "Generating README.md", + cancellable: false, + }, + async (progress) => { + progress.report({ + increment: 0, + message: "Analyzing project structure...", + }); + // Use StackCode CLI for generation + const command = `npx @stackcode/cli generate readme`; + progress.report({ increment: 50, message: "Generating content..." }); + await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); + progress.report({ + increment: 100, + message: "README.md generated successfully!", + }); + }, + ); + this.showSuccess("README.md has been generated successfully!"); + // 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", + ); + if (openFile === "Open File") { + const document = await vscode.workspace.openTextDocument(readmePath); + await vscode.window.showTextDocument(document); + } + } catch (error) { + this.showError(`Failed to generate README.md: ${error}`); + } + } + async generateGitignore() { + try { + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + return; + } + const gitignorePath = path.join(workspaceFolder.uri.fsPath, ".gitignore"); + // Check if .gitignore already exists + 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", + ); + if (!overwrite) { + return; } + } catch { + // File doesn't exist, which is fine + } + // 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" }, + ], + { + placeHolder: "Select project type for .gitignore", + }, + ); + if (!projectType) { + return; + } + vscode.window.withProgress( + { + location: vscode.ProgressLocation.Notification, + title: "Generating .gitignore", + cancellable: false, + }, + async (progress) => { + progress.report({ + increment: 0, + message: "Generating .gitignore content...", + }); + // Use StackCode CLI for generation + const command = `npx @stackcode/cli generate gitignore --type="${projectType.label}"`; + progress.report({ increment: 50, message: "Creating file..." }); + await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); + progress.report({ + increment: 100, + message: ".gitignore generated successfully!", + }); + }, + ); + this.showSuccess(".gitignore has been generated successfully!"); + // Ask if user wants to open the file + const openFile = await vscode.window.showInformationMessage( + "Would you like to open the generated .gitignore?", + "Open File", + ); + if (openFile === "Open File") { + const document = await vscode.workspace.openTextDocument(gitignorePath); + await vscode.window.showTextDocument(document); + } + } catch (error) { + this.showError(`Failed to generate .gitignore: ${error}`); } + } } exports.GenerateCommand = GenerateCommand; -//# sourceMappingURL=GenerateCommand.js.map \ No newline at end of file +//# sourceMappingURL=GenerateCommand.js.map diff --git a/packages/vscode-extension/out/commands/GitCommand.js b/packages/vscode-extension/out/commands/GitCommand.js index 9f7b76fe..235dfc58 100644 --- a/packages/vscode-extension/out/commands/GitCommand.js +++ b/packages/vscode-extension/out/commands/GitCommand.js @@ -1,155 +1,189 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GitCommand = void 0; const vscode = __importStar(require("vscode")); const BaseCommand_1 = require("./BaseCommand"); 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" }, - ], { - placeHolder: "Select Git action", - }); - if (!action) { - return; - } - if (action.label === "start") { - await this.startBranch(); - } - else if (action.label === "finish") { - await this.finishBranch(); - } + async execute() { + const action = await vscode.window.showQuickPick( + [ + { label: "start", description: "Start a new feature branch" }, + { label: "finish", description: "Finish current branch" }, + ], + { + placeHolder: "Select Git action", + }, + ); + if (!action) { + return; } - async startBranch() { - try { - const branchName = await vscode.window.showInputBox({ - prompt: "Enter the name for the new branch", - placeHolder: "new-feature", - validateInput: (value) => { - if (!value) { - return "Branch name is required"; - } - if (!/^[a-zA-Z0-9/_-]+$/.test(value)) { - return "Branch name can only contain letters, numbers, hyphens, underscores and slashes"; - } - return null; - }, - }); - if (!branchName) { - return; - } - 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" }, - ], { - placeHolder: "Select branch type", - }); - if (!branchType) { - return; - } - const workspaceFolder = this.getCurrentWorkspaceFolder(); - if (!workspaceFolder) { - this.showError("No workspace folder found"); - return; - } - vscode.window.withProgress({ - location: vscode.ProgressLocation.Notification, - title: `Creating ${branchType.label} branch: ${branchName}`, - cancellable: false, - }, async (progress) => { - progress.report({ increment: 0, message: "Creating branch..." }); - // 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...", - }); - await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); - progress.report({ - increment: 100, - message: "Branch created successfully!", - }); - }); - this.showSuccess(`Branch ${branchType.label}/${branchName} has been created and checked out!`); - } - catch (error) { - this.showError(`Failed to create branch: ${error}`); - } + if (action.label === "start") { + await this.startBranch(); + } else if (action.label === "finish") { + await this.finishBranch(); } - async finishBranch() { + } + async startBranch() { + try { + const branchName = await vscode.window.showInputBox({ + prompt: "Enter the name for the new branch", + placeHolder: "new-feature", + validateInput: (value) => { + if (!value) { + return "Branch name is required"; + } + if (!/^[a-zA-Z0-9/_-]+$/.test(value)) { + return "Branch name can only contain letters, numbers, hyphens, underscores and slashes"; + } + return null; + }, + }); + if (!branchName) { + return; + } + 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" }, + ], + { + placeHolder: "Select branch type", + }, + ); + if (!branchType) { + return; + } + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + return; + } + vscode.window.withProgress( + { + location: vscode.ProgressLocation.Notification, + title: `Creating ${branchType.label} branch: ${branchName}`, + cancellable: false, + }, + async (progress) => { + progress.report({ increment: 0, message: "Creating branch..." }); + // 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...", + }); + await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); + progress.report({ + increment: 100, + message: "Branch created successfully!", + }); + }, + ); + this.showSuccess( + `Branch ${branchType.label}/${branchName} has been created and checked out!`, + ); + } catch (error) { + this.showError(`Failed to create branch: ${error}`); + } + } + async finishBranch() { + try { + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + return; + } + // Get current branch name + const gitExtension = vscode.extensions.getExtension("vscode.git"); + let currentBranch = "current branch"; + if (gitExtension && gitExtension.isActive) { try { - const workspaceFolder = this.getCurrentWorkspaceFolder(); - if (!workspaceFolder) { - this.showError("No workspace folder found"); - return; - } - // Get current branch name - const gitExtension = vscode.extensions.getExtension("vscode.git"); - let currentBranch = "current branch"; - if (gitExtension && gitExtension.isActive) { - try { - const git = gitExtension.exports; - const api = git.getAPI(1); - const repo = api.repositories[0]; - if (repo && repo.state.HEAD) { - currentBranch = repo.state.HEAD.name || "current branch"; - } - } - catch { - // Fallback to generic message - } - } - const confirm = await this.confirmAction(`Are you sure you want to finish ${currentBranch}? This will merge it back to the base branch.`, "Finish Branch"); - if (!confirm) { - return; - } - vscode.window.withProgress({ - location: vscode.ProgressLocation.Notification, - title: `Finishing branch: ${currentBranch}`, - cancellable: false, - }, async (progress) => { - progress.report({ increment: 0, message: "Merging branch..." }); - // Use StackCode CLI for git operations - const command = `npx @stackcode/cli git finish`; - progress.report({ increment: 50, message: "Cleaning up..." }); - await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); - progress.report({ - increment: 100, - message: "Branch finished successfully!", - }); - }); - this.showSuccess(`Branch ${currentBranch} has been finished and merged!`); - } - catch (error) { - this.showError(`Failed to finish branch: ${error}`); + const git = gitExtension.exports; + const api = git.getAPI(1); + const repo = api.repositories[0]; + if (repo && repo.state.HEAD) { + currentBranch = repo.state.HEAD.name || "current branch"; + } + } catch { + // Fallback to generic message } + } + const confirm = await this.confirmAction( + `Are you sure you want to finish ${currentBranch}? This will merge it back to the base branch.`, + "Finish Branch", + ); + if (!confirm) { + return; + } + vscode.window.withProgress( + { + location: vscode.ProgressLocation.Notification, + title: `Finishing branch: ${currentBranch}`, + cancellable: false, + }, + async (progress) => { + progress.report({ increment: 0, message: "Merging branch..." }); + // Use StackCode CLI for git operations + const command = `npx @stackcode/cli git finish`; + progress.report({ increment: 50, message: "Cleaning up..." }); + await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); + progress.report({ + increment: 100, + message: "Branch finished successfully!", + }); + }, + ); + this.showSuccess(`Branch ${currentBranch} has been finished and merged!`); + } catch (error) { + this.showError(`Failed to finish branch: ${error}`); } + } } exports.GitCommand = GitCommand; -//# sourceMappingURL=GitCommand.js.map \ No newline at end of file +//# sourceMappingURL=GitCommand.js.map diff --git a/packages/vscode-extension/out/commands/InitCommand.js b/packages/vscode-extension/out/commands/InitCommand.js index 7dc17cbf..1e0020ae 100644 --- a/packages/vscode-extension/out/commands/InitCommand.js +++ b/packages/vscode-extension/out/commands/InitCommand.js @@ -1,150 +1,180 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.InitCommand = void 0; const vscode = __importStar(require("vscode")); const BaseCommand_1 = require("./BaseCommand"); 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", - validateInput: (value) => { - if (!value) { - return "Project name is required"; - } - if (!/^[a-zA-Z0-9-_]+$/.test(value)) { - return "Project name can only contain letters, numbers, hyphens and underscores"; - } - return null; - }, - }); - if (!projectName) { - return; - } - const description = await vscode.window.showInputBox({ - prompt: "Enter project description", - placeHolder: "A brief description of your project", - }); - const authorName = await vscode.window.showInputBox({ - prompt: "Enter author name", - placeHolder: "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" }, - ], { - placeHolder: "Select project stack", - }); - if (!stack) { - return; - } - // Get workspace folder or ask for project location - const workspaceFolder = this.getCurrentWorkspaceFolder(); - let projectPath; - if (workspaceFolder) { - projectPath = path.join(workspaceFolder.uri.fsPath, projectName); - } - else { - const folderUris = await vscode.window.showOpenDialog({ - canSelectFolders: true, - canSelectFiles: false, - canSelectMany: false, - openLabel: "Select Project Location", - }); - if (!folderUris || folderUris.length === 0) { - return; - } - projectPath = path.join(folderUris[0].fsPath, projectName); - } - // Check if directory exists - 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"); - if (!overwrite) { - return; - } - } - catch { - // Directory doesn't exist, which is fine - } - // Show progress - vscode.window.withProgress({ - location: vscode.ProgressLocation.Notification, - title: `Initializing project ${projectName}`, - cancellable: false, - }, async (progress) => { - progress.report({ - increment: 0, - message: "Setting up project 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...", - }); - await this.runTerminalCommand(command); - progress.report({ - increment: 100, - message: "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"); - if (openProject === "Open Project") { - const uri = vscode.Uri.file(projectPath); - await vscode.commands.executeCommand("vscode.openFolder", uri, true); - } + async execute() { + try { + // Prompt for project details + const projectName = await vscode.window.showInputBox({ + prompt: "Enter project name", + placeHolder: "my-awesome-project", + validateInput: (value) => { + if (!value) { + return "Project name is required"; + } + if (!/^[a-zA-Z0-9-_]+$/.test(value)) { + return "Project name can only contain letters, numbers, hyphens and underscores"; + } + return null; + }, + }); + if (!projectName) { + return; + } + const description = await vscode.window.showInputBox({ + prompt: "Enter project description", + placeHolder: "A brief description of your project", + }); + const authorName = await vscode.window.showInputBox({ + prompt: "Enter author name", + placeHolder: "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" }, + ], + { + placeHolder: "Select project stack", + }, + ); + if (!stack) { + return; + } + // Get workspace folder or ask for project location + const workspaceFolder = this.getCurrentWorkspaceFolder(); + let projectPath; + if (workspaceFolder) { + projectPath = path.join(workspaceFolder.uri.fsPath, projectName); + } else { + const folderUris = await vscode.window.showOpenDialog({ + canSelectFolders: true, + canSelectFiles: false, + canSelectMany: false, + openLabel: "Select Project Location", + }); + if (!folderUris || folderUris.length === 0) { + return; } - catch (error) { - this.showError(`Failed to initialize project: ${error}`); + projectPath = path.join(folderUris[0].fsPath, projectName); + } + // Check if directory exists + 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", + ); + if (!overwrite) { + return; } + } catch { + // Directory doesn't exist, which is fine + } + // Show progress + vscode.window.withProgress( + { + location: vscode.ProgressLocation.Notification, + title: `Initializing project ${projectName}`, + cancellable: false, + }, + async (progress) => { + progress.report({ + increment: 0, + message: "Setting up project 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...", + }); + await this.runTerminalCommand(command); + progress.report({ + increment: 100, + message: "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", + ); + if (openProject === "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}`); } - async getGitUserName() { - try { - // Try to get git user name from workspace - const terminal = vscode.window.createTerminal({ name: "temp" }); - terminal.sendText("git config user.name"); - terminal.dispose(); - return ""; - } - catch { - return ""; - } + } + async getGitUserName() { + try { + // Try to get git user name from workspace + const terminal = vscode.window.createTerminal({ name: "temp" }); + terminal.sendText("git config user.name"); + terminal.dispose(); + return ""; + } catch { + return ""; } + } } exports.InitCommand = InitCommand; -//# sourceMappingURL=InitCommand.js.map \ No newline at end of file +//# sourceMappingURL=InitCommand.js.map diff --git a/packages/vscode-extension/out/commands/ReleaseCommand.js b/packages/vscode-extension/out/commands/ReleaseCommand.js index d081e393..c7db3a43 100644 --- a/packages/vscode-extension/out/commands/ReleaseCommand.js +++ b/packages/vscode-extension/out/commands/ReleaseCommand.js @@ -1,61 +1,87 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ReleaseCommand = void 0; const vscode = __importStar(require("vscode")); const BaseCommand_1 = require("./BaseCommand"); class ReleaseCommand extends BaseCommand_1.BaseCommand { - async execute() { - try { - const workspaceFolder = this.getCurrentWorkspaceFolder(); - if (!workspaceFolder) { - this.showError("No workspace folder found"); - 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"); - if (!confirm) { - return; - } - vscode.window.withProgress({ - location: vscode.ProgressLocation.Notification, - title: "Creating release", - cancellable: false, - }, async (progress) => { - progress.report({ increment: 0, message: "Preparing release..." }); - // Use StackCode CLI for release - const command = `npx @stackcode/cli release`; - progress.report({ increment: 50, message: "Creating release..." }); - await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); - progress.report({ increment: 100, message: "Release created!" }); - }); - this.showSuccess("Release process started! Check terminal for progress."); - } - catch (error) { - this.showError(`Failed to create release: ${error}`); - } + async execute() { + try { + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + 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", + ); + if (!confirm) { + return; + } + vscode.window.withProgress( + { + location: vscode.ProgressLocation.Notification, + title: "Creating release", + cancellable: false, + }, + async (progress) => { + progress.report({ increment: 0, message: "Preparing release..." }); + // Use StackCode CLI for release + const command = `npx @stackcode/cli release`; + progress.report({ increment: 50, message: "Creating release..." }); + await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); + progress.report({ increment: 100, message: "Release created!" }); + }, + ); + this.showSuccess("Release process started! Check terminal for progress."); + } catch (error) { + this.showError(`Failed to create release: ${error}`); } + } } exports.ReleaseCommand = ReleaseCommand; -//# sourceMappingURL=ReleaseCommand.js.map \ No newline at end of file +//# sourceMappingURL=ReleaseCommand.js.map diff --git a/packages/vscode-extension/out/commands/ValidateCommand.js b/packages/vscode-extension/out/commands/ValidateCommand.js index ff108bb0..d43f5098 100644 --- a/packages/vscode-extension/out/commands/ValidateCommand.js +++ b/packages/vscode-extension/out/commands/ValidateCommand.js @@ -1,60 +1,85 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ValidateCommand = void 0; const vscode = __importStar(require("vscode")); const BaseCommand_1 = require("./BaseCommand"); class ValidateCommand extends BaseCommand_1.BaseCommand { - async execute() { - try { - const workspaceFolder = this.getCurrentWorkspaceFolder(); - if (!workspaceFolder) { - this.showError("No workspace folder found"); - return; - } - vscode.window.withProgress({ - location: vscode.ProgressLocation.Notification, - title: "Validating project structure", - cancellable: false, - }, async (progress) => { - progress.report({ increment: 0, message: "Running validation..." }); - // Use StackCode CLI for validation - const command = `npx @stackcode/cli validate`; - progress.report({ - increment: 50, - message: "Checking project structure...", - }); - await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); - progress.report({ increment: 100, message: "Validation completed!" }); - }); - this.showSuccess("Project validation completed! Check terminal for results."); - } - catch (error) { - this.showError(`Failed to validate project: ${error}`); - } + async execute() { + try { + const workspaceFolder = this.getCurrentWorkspaceFolder(); + if (!workspaceFolder) { + this.showError("No workspace folder found"); + return; + } + vscode.window.withProgress( + { + location: vscode.ProgressLocation.Notification, + title: "Validating project structure", + cancellable: false, + }, + async (progress) => { + progress.report({ increment: 0, message: "Running validation..." }); + // Use StackCode CLI for validation + const command = `npx @stackcode/cli validate`; + progress.report({ + increment: 50, + message: "Checking project structure...", + }); + await this.runTerminalCommand(command, workspaceFolder.uri.fsPath); + progress.report({ increment: 100, message: "Validation completed!" }); + }, + ); + this.showSuccess( + "Project validation completed! Check terminal for results.", + ); + } catch (error) { + this.showError(`Failed to validate project: ${error}`); } + } } exports.ValidateCommand = ValidateCommand; -//# sourceMappingURL=ValidateCommand.js.map \ No newline at end of file +//# sourceMappingURL=ValidateCommand.js.map diff --git a/packages/vscode-extension/out/config/ConfigurationManager.js b/packages/vscode-extension/out/config/ConfigurationManager.js index 51c03700..d7144191 100644 --- a/packages/vscode-extension/out/config/ConfigurationManager.js +++ b/packages/vscode-extension/out/config/ConfigurationManager.js @@ -1,64 +1,89 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConfigurationManager = void 0; const vscode = __importStar(require("vscode")); class ConfigurationManager { - constructor() { + constructor() { + this.configuration = vscode.workspace.getConfiguration("stackcode"); + // Listen for configuration changes + vscode.workspace.onDidChangeConfiguration((event) => { + if (event.affectsConfiguration("stackcode")) { this.configuration = vscode.workspace.getConfiguration("stackcode"); - // Listen for configuration changes - vscode.workspace.onDidChangeConfiguration((event) => { - if (event.affectsConfiguration("stackcode")) { - this.configuration = vscode.workspace.getConfiguration("stackcode"); - } - }); - } - get notificationsEnabled() { - return this.configuration.get("notifications.enabled", true); - } - get branchCheckEnabled() { - return this.configuration.get("notifications.branchCheck", true); - } - get commitCheckEnabled() { - return this.configuration.get("notifications.commitCheck", true); - } - get autoGenerateReadme() { - return this.configuration.get("autoGenerate.readme", false); - } - get autoGenerateGitignore() { - return this.configuration.get("autoGenerate.gitignore", true); - } - get defaultBranchType() { - return this.configuration.get("git.defaultBranchType", "feature"); - } - get dashboardAutoOpen() { - return this.configuration.get("dashboard.autoOpen", false); - } - async updateConfiguration(key, value) { - await this.configuration.update(key, value, vscode.ConfigurationTarget.Workspace); - } + } + }); + } + get notificationsEnabled() { + return this.configuration.get("notifications.enabled", true); + } + get branchCheckEnabled() { + return this.configuration.get("notifications.branchCheck", true); + } + get commitCheckEnabled() { + return this.configuration.get("notifications.commitCheck", true); + } + get autoGenerateReadme() { + return this.configuration.get("autoGenerate.readme", false); + } + get autoGenerateGitignore() { + return this.configuration.get("autoGenerate.gitignore", true); + } + get defaultBranchType() { + return this.configuration.get("git.defaultBranchType", "feature"); + } + get dashboardAutoOpen() { + return this.configuration.get("dashboard.autoOpen", false); + } + async updateConfiguration(key, value) { + await this.configuration.update( + key, + value, + vscode.ConfigurationTarget.Workspace, + ); + } } exports.ConfigurationManager = ConfigurationManager; -//# sourceMappingURL=ConfigurationManager.js.map \ No newline at end of file +//# sourceMappingURL=ConfigurationManager.js.map diff --git a/packages/vscode-extension/out/extension.js b/packages/vscode-extension/out/extension.js index b6b21ab3..13fc77b4 100644 --- a/packages/vscode-extension/out/extension.js +++ b/packages/vscode-extension/out/extension.js @@ -1,27 +1,48 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.deactivate = exports.activate = void 0; const vscode = __importStar(require("vscode")); @@ -53,85 +74,149 @@ let validateCommand; let releaseCommand; let configCommand; function activate(context) { - console.log("[StackCode] Extension is now active!"); - console.log("[StackCode] Workspace folders:", vscode.workspace.workspaceFolders?.length || 0); - console.log("[StackCode] Extension path:", context.extensionPath); - // Initialize configuration manager - configManager = new ConfigurationManager_1.ConfigurationManager(); - // Initialize notification manager - proactiveManager = new ProactiveNotificationManager_1.ProactiveNotificationManager(configManager); - // Initialize monitors - gitMonitor = new GitMonitor_1.GitMonitor(proactiveManager, configManager); - fileMonitor = new FileMonitor_1.FileMonitor(proactiveManager, configManager); - // Initialize providers - dashboardProvider = new DashboardProvider_1.DashboardProvider(context); - projectViewProvider = new ProjectViewProvider_1.ProjectViewProvider(context.workspaceState); - // Initialize commands - initCommand = new InitCommand_1.InitCommand(); - generateCommand = new GenerateCommand_1.GenerateCommand(); - gitCommand = new GitCommand_1.GitCommand(); - commitCommand = new CommitCommand_1.CommitCommand(); - validateCommand = new ValidateCommand_1.ValidateCommand(); - releaseCommand = new ReleaseCommand_1.ReleaseCommand(); - configCommand = new ConfigCommand_1.ConfigCommand(); - // Register webview providers - context.subscriptions.push(vscode.window.registerWebviewViewProvider("stackcode.dashboard", dashboardProvider), vscode.window.registerTreeDataProvider("stackcode.projectView", projectViewProvider)); - // Register all commands - const commands = [ - // Core functionality commands - vscode.commands.registerCommand("stackcode.init", () => initCommand.execute()), - vscode.commands.registerCommand("stackcode.generate.readme", () => generateCommand.generateReadme()), - vscode.commands.registerCommand("stackcode.generate.gitignore", () => generateCommand.generateGitignore()), - vscode.commands.registerCommand("stackcode.git.start", () => gitCommand.startBranch()), - vscode.commands.registerCommand("stackcode.git.finish", () => gitCommand.finishBranch()), - vscode.commands.registerCommand("stackcode.commit", () => commitCommand.execute()), - vscode.commands.registerCommand("stackcode.validate", () => validateCommand.execute()), - vscode.commands.registerCommand("stackcode.release", () => releaseCommand.execute()), - vscode.commands.registerCommand("stackcode.config", () => configCommand.execute()), - vscode.commands.registerCommand("stackcode.dashboard", () => dashboardProvider.show()), - // Legacy commands for backward compatibility - vscode.commands.registerCommand("stackcode.createBranch", () => gitCommand.startBranch()), - vscode.commands.registerCommand("stackcode.formatCommitMessage", () => commitCommand.execute()), - vscode.commands.registerCommand("stackcode.checkBestPractices", () => validateCommand.execute()), - // Project view commands - vscode.commands.registerCommand("stackcode.projectView.refresh", () => projectViewProvider.refresh()), - // Webview commands - vscode.commands.registerCommand("webviewReady", () => { - console.log("[StackCode] Webview is ready!"); - // Pode enviar dados iniciais aqui se necessário - }), - vscode.commands.registerCommand("stackcode.webview.init", () => initCommand.execute()), - vscode.commands.registerCommand("stackcode.webview.generate.readme", () => generateCommand.generateReadme()), - vscode.commands.registerCommand("stackcode.webview.generate.gitignore", () => generateCommand.generateGitignore()), - vscode.commands.registerCommand("stackcode.webview.git.start", () => gitCommand.startBranch()), - vscode.commands.registerCommand("stackcode.webview.commit", () => commitCommand.execute()), - vscode.commands.registerCommand("stackcode.webview.validate", () => validateCommand.execute()), - ]; - // Add all to context subscriptions for cleanup - context.subscriptions.push(...commands, gitMonitor, fileMonitor, proactiveManager, dashboardProvider); - // Start monitoring - gitMonitor.startMonitoring(); - fileMonitor.startMonitoring(); - // Auto-open dashboard if configured - if (configManager.dashboardAutoOpen) { - setTimeout(() => { - dashboardProvider.show(); - }, 1000); - } - // Show welcome message - proactiveManager.showWelcomeMessage(); + console.log("[StackCode] Extension is now active!"); + console.log( + "[StackCode] Workspace folders:", + vscode.workspace.workspaceFolders?.length || 0, + ); + console.log("[StackCode] Extension path:", context.extensionPath); + // Initialize configuration manager + configManager = new ConfigurationManager_1.ConfigurationManager(); + // Initialize notification manager + proactiveManager = + new ProactiveNotificationManager_1.ProactiveNotificationManager( + configManager, + ); + // Initialize monitors + gitMonitor = new GitMonitor_1.GitMonitor(proactiveManager, configManager); + fileMonitor = new FileMonitor_1.FileMonitor(proactiveManager, configManager); + // Initialize providers + dashboardProvider = new DashboardProvider_1.DashboardProvider(context); + projectViewProvider = new ProjectViewProvider_1.ProjectViewProvider( + context.workspaceState, + ); + // Initialize commands + initCommand = new InitCommand_1.InitCommand(); + generateCommand = new GenerateCommand_1.GenerateCommand(); + gitCommand = new GitCommand_1.GitCommand(); + commitCommand = new CommitCommand_1.CommitCommand(); + validateCommand = new ValidateCommand_1.ValidateCommand(); + releaseCommand = new ReleaseCommand_1.ReleaseCommand(); + configCommand = new ConfigCommand_1.ConfigCommand(); + // Register webview providers + context.subscriptions.push( + vscode.window.registerWebviewViewProvider( + "stackcode.dashboard", + dashboardProvider, + ), + vscode.window.registerTreeDataProvider( + "stackcode.projectView", + projectViewProvider, + ), + ); + // Register all commands + const commands = [ + // Core functionality commands + vscode.commands.registerCommand("stackcode.init", () => + initCommand.execute(), + ), + vscode.commands.registerCommand("stackcode.generate.readme", () => + generateCommand.generateReadme(), + ), + vscode.commands.registerCommand("stackcode.generate.gitignore", () => + generateCommand.generateGitignore(), + ), + vscode.commands.registerCommand("stackcode.git.start", () => + gitCommand.startBranch(), + ), + vscode.commands.registerCommand("stackcode.git.finish", () => + gitCommand.finishBranch(), + ), + vscode.commands.registerCommand("stackcode.commit", () => + commitCommand.execute(), + ), + vscode.commands.registerCommand("stackcode.validate", () => + validateCommand.execute(), + ), + vscode.commands.registerCommand("stackcode.release", () => + releaseCommand.execute(), + ), + vscode.commands.registerCommand("stackcode.config", () => + configCommand.execute(), + ), + vscode.commands.registerCommand("stackcode.dashboard", () => + dashboardProvider.show(), + ), + // Legacy commands for backward compatibility + vscode.commands.registerCommand("stackcode.createBranch", () => + gitCommand.startBranch(), + ), + vscode.commands.registerCommand("stackcode.formatCommitMessage", () => + commitCommand.execute(), + ), + vscode.commands.registerCommand("stackcode.checkBestPractices", () => + validateCommand.execute(), + ), + // Project view commands + vscode.commands.registerCommand("stackcode.projectView.refresh", () => + projectViewProvider.refresh(), + ), + // Webview commands + vscode.commands.registerCommand("webviewReady", () => { + console.log("[StackCode] Webview is ready!"); + // Pode enviar dados iniciais aqui se necessário + }), + vscode.commands.registerCommand("stackcode.webview.init", () => + initCommand.execute(), + ), + vscode.commands.registerCommand("stackcode.webview.generate.readme", () => + generateCommand.generateReadme(), + ), + vscode.commands.registerCommand( + "stackcode.webview.generate.gitignore", + () => generateCommand.generateGitignore(), + ), + vscode.commands.registerCommand("stackcode.webview.git.start", () => + gitCommand.startBranch(), + ), + vscode.commands.registerCommand("stackcode.webview.commit", () => + commitCommand.execute(), + ), + vscode.commands.registerCommand("stackcode.webview.validate", () => + validateCommand.execute(), + ), + ]; + // Add all to context subscriptions for cleanup + context.subscriptions.push( + ...commands, + gitMonitor, + fileMonitor, + proactiveManager, + dashboardProvider, + ); + // Start monitoring + gitMonitor.startMonitoring(); + fileMonitor.startMonitoring(); + // Auto-open dashboard if configured + if (configManager.dashboardAutoOpen) { + setTimeout(() => { + dashboardProvider.show(); + }, 1000); + } + // Show welcome message + proactiveManager.showWelcomeMessage(); } exports.activate = activate; function deactivate() { - if (gitMonitor) { - gitMonitor.dispose(); - } - if (fileMonitor) { - fileMonitor.dispose(); - } - if (proactiveManager) { - proactiveManager.dispose(); - } + if (gitMonitor) { + gitMonitor.dispose(); + } + if (fileMonitor) { + fileMonitor.dispose(); + } + if (proactiveManager) { + proactiveManager.dispose(); + } } exports.deactivate = deactivate; -//# sourceMappingURL=extension.js.map \ No newline at end of file +//# sourceMappingURL=extension.js.map diff --git a/packages/vscode-extension/out/extension.js.map b/packages/vscode-extension/out/extension.js.map index 237d6608..f76f4f11 100644 --- a/packages/vscode-extension/out/extension.js.map +++ b/packages/vscode-extension/out/extension.js.map @@ -1 +1 @@ -{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,+FAA4F;AAC5F,sDAAmD;AACnD,wDAAqD;AACrD,wEAAqE;AACrE,wDAAqD;AACrD,gEAA6D;AAC7D,sDAAmD;AACnD,4DAAyD;AACzD,gEAA6D;AAC7D,8DAA2D;AAC3D,4DAAyD;AACzD,qEAAkE;AAClE,yEAAsE;AAEtE,IAAI,gBAA8C,CAAC;AACnD,IAAI,UAAsB,CAAC;AAC3B,IAAI,WAAwB,CAAC;AAC7B,IAAI,aAAmC,CAAC;AACxC,IAAI,iBAAoC,CAAC;AACzC,IAAI,mBAAwC,CAAC;AAE7C,oBAAoB;AACpB,IAAI,WAAwB,CAAC;AAC7B,IAAI,eAAgC,CAAC;AACrC,IAAI,UAAsB,CAAC;AAC3B,IAAI,aAA4B,CAAC;AACjC,IAAI,eAAgC,CAAC;AACrC,IAAI,cAA8B,CAAC;AACnC,IAAI,aAA4B,CAAC;AAEjC,SAAgB,QAAQ,CAAC,OAAgC;IACvD,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC;IAC9F,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAElE,mCAAmC;IACnC,aAAa,GAAG,IAAI,2CAAoB,EAAE,CAAC;IAE3C,kCAAkC;IAClC,gBAAgB,GAAG,IAAI,2DAA4B,C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;AAED,SAAgB,UAAU;IACxB,IAAI,UAAU,EAAE;QACd,UAAU,CAAC,OAAO,EAAE,CAAC;KACtB;IACD,IAAI,WAAW,EAAE;QACf,WAAW,CAAC,OAAO,EAAE,CAAC;KACvB;IACD,IAAI,gBAAgB,EAAE;QACpB,gBAAgB,CAAC,OAAO,EAAE,CAAC;KAC5B;AACH,CAAC;AAVD,gCAUC"} \ No newline at end of file +{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,+FAA4F;AAC5F,sDAAmD;AACnD,wDAAqD;AACrD,wEAAqE;AACrE,wDAAqD;AACrD,gEAA6D;AAC7D,sDAAmD;AACnD,4DAAyD;AACzD,gEAA6D;AAC7D,8DAA2D;AAC3D,4DAAyD;AACzD,qEAAkE;AAClE,yEAAsE;AAEtE,IAAI,gBAA8C,CAAC;AACnD,IAAI,UAAsB,CAAC;AAC3B,IAAI,WAAwB,CAAC;AAC7B,IAAI,aAAmC,CAAC;AACxC,IAAI,iBAAoC,CAAC;AACzC,IAAI,mBAAwC,CAAC;AAE7C,oBAAoB;AACpB,IAAI,WAAwB,CAAC;AAC7B,IAAI,eAAgC,CAAC;AACrC,IAAI,UAAsB,CAAC;AAC3B,IAAI,aAA4B,CAAC;AACjC,IAAI,eAAgC,CAAC;AACrC,IAAI,cAA8B,CAAC;AACnC,IAAI,aAA4B,CAAC;AAEjC,SAAgB,QAAQ,CAAC,OAAgC;IACvD,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CACT,gCAAgC,EAChC,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,MAAM,IAAI,CAAC,CAC/C,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAElE,mCAAmC;IACnC,aAAa,GAAG,IAAI,2CAAoB,EAAE,C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AAgB,CAAC,kBAAkB,EAAE,CAAC;AACxC,CAAC;AA7ID,4BA6IC;AAED,SAAgB,UAAU;IACxB,IAAI,UAAU,EAAE;QACd,UAAU,CAAC,OAAO,EAAE,CAAC;KACtB;IACD,IAAI,WAAW,EAAE;QACf,WAAW,CAAC,OAAO,EAAE,CAAC;KACvB;IACD,IAAI,gBAAgB,EAAE;QACpB,gBAAgB,CAAC,OAAO,EAAE,CAAC;KAC5B;AACH,CAAC;AAVD,gCAUC"} \ 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 8b390b56..755dc0ba 100644 --- a/packages/vscode-extension/out/monitors/FileMonitor.js +++ b/packages/vscode-extension/out/monitors/FileMonitor.js @@ -1,137 +1,176 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.FileMonitor = void 0; const vscode = __importStar(require("vscode")); class FileMonitor { - constructor(proactiveManager, configManager) { - this.disposables = []; - this.processedFiles = new Set(); - this.proactiveManager = proactiveManager; - this.configManager = configManager; - } - startMonitoring() { - // Monitor file creation - this.disposables.push(vscode.workspace.onDidCreateFiles((event) => { - for (const file of event.files) { - this.handleFileCreation(file); - } - })); - // Monitor file changes - this.disposables.push(vscode.workspace.onDidChangeTextDocument((event) => { - this.handleFileChange(event); - })); - // Monitor when files are opened - this.disposables.push(vscode.window.onDidChangeActiveTextEditor((editor) => { - if (editor) { - this.handleFileOpen(editor.document.uri); - } - })); - } - async handleFileCreation(fileUri) { - if (!this.configManager.notificationsEnabled) { - return; - } - const fileName = fileUri.path.split("/").pop() || ""; - const fileKey = `${fileUri.toString()}-created`; - if (this.processedFiles.has(fileKey)) { - return; + constructor(proactiveManager, configManager) { + this.disposables = []; + this.processedFiles = new Set(); + this.proactiveManager = proactiveManager; + this.configManager = configManager; + } + startMonitoring() { + // Monitor file creation + this.disposables.push( + vscode.workspace.onDidCreateFiles((event) => { + for (const file of event.files) { + this.handleFileCreation(file); } - this.processedFiles.add(fileKey); - // Suggest generating comprehensive files - if (["README.md", ".gitignore"].includes(fileName)) { - await this.proactiveManager.showFileCreationSuggestion(fileName); + }), + ); + // Monitor file changes + this.disposables.push( + vscode.workspace.onDidChangeTextDocument((event) => { + this.handleFileChange(event); + }), + ); + // Monitor when files are opened + this.disposables.push( + vscode.window.onDidChangeActiveTextEditor((editor) => { + if (editor) { + this.handleFileOpen(editor.document.uri); } + }), + ); + } + async handleFileCreation(fileUri) { + if (!this.configManager.notificationsEnabled) { + return; } - async handleFileChange(event) { - const document = event.document; - // Skip if not a git commit message - if (!document.fileName.includes("COMMIT_EDITMSG")) { - return; - } - const content = document.getText(); - if (content.trim()) { - await this.proactiveManager.showCommitMessageWarning(content); - } + const fileName = fileUri.path.split("/").pop() || ""; + const fileKey = `${fileUri.toString()}-created`; + if (this.processedFiles.has(fileKey)) { + return; } - async handleFileOpen(fileUri) { - const fileName = fileUri.path.split("/").pop() || ""; - const fileKey = `${fileUri.toString()}-opened`; - if (this.processedFiles.has(fileKey)) { - return; - } - this.processedFiles.add(fileKey); - // Check for missing important files when opening project files - if (fileName.endsWith(".js") || - fileName.endsWith(".ts") || - fileName.endsWith(".json")) { - await this.checkProjectStructure(); - } + this.processedFiles.add(fileKey); + // Suggest generating comprehensive files + if (["README.md", ".gitignore"].includes(fileName)) { + await this.proactiveManager.showFileCreationSuggestion(fileName); } - async checkProjectStructure() { - if (!this.configManager.notificationsEnabled) { - return; - } - const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; - if (!workspaceFolder) { - return; - } - try { - const files = await vscode.workspace.fs.readDirectory(workspaceFolder.uri); - const fileNames = files.map(([name]) => name); - const missingFiles = []; - if (!fileNames.includes("README.md")) { - missingFiles.push("README.md"); - } - if (!fileNames.includes(".gitignore")) { - missingFiles.push(".gitignore"); - } - 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 action = await vscode.window.showInformationMessage(message, "Generate Files", "Not Now", "Don't Show Again"); - if (action === "Generate Files") { - // TODO: Implement file generation - vscode.window.showInformationMessage("File generation will be available soon!"); - } - else if (action === "Don't Show Again") { - await this.configManager.updateConfiguration("notifications.enabled", false); - } - } - } - catch (error) { - // Use proper VS Code logging instead of console.log - const outputChannel = vscode.window.createOutputChannel("StackCode"); - outputChannel.appendLine(`Error checking project structure: ${error}`); - } + } + async handleFileChange(event) { + const document = event.document; + // Skip if not a git commit message + if (!document.fileName.includes("COMMIT_EDITMSG")) { + return; + } + const content = document.getText(); + if (content.trim()) { + await this.proactiveManager.showCommitMessageWarning(content); + } + } + async handleFileOpen(fileUri) { + const fileName = fileUri.path.split("/").pop() || ""; + const fileKey = `${fileUri.toString()}-opened`; + if (this.processedFiles.has(fileKey)) { + return; } - dispose() { - this.disposables.forEach((d) => d.dispose()); - this.disposables = []; - this.processedFiles.clear(); + this.processedFiles.add(fileKey); + // Check for missing important files when opening project files + if ( + fileName.endsWith(".js") || + fileName.endsWith(".ts") || + fileName.endsWith(".json") + ) { + await this.checkProjectStructure(); + } + } + async checkProjectStructure() { + if (!this.configManager.notificationsEnabled) { + return; + } + const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; + if (!workspaceFolder) { + return; + } + try { + const files = await vscode.workspace.fs.readDirectory( + workspaceFolder.uri, + ); + const fileNames = files.map(([name]) => name); + const missingFiles = []; + if (!fileNames.includes("README.md")) { + missingFiles.push("README.md"); + } + if (!fileNames.includes(".gitignore")) { + missingFiles.push(".gitignore"); + } + 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 action = await vscode.window.showInformationMessage( + message, + "Generate Files", + "Not Now", + "Don't Show Again", + ); + if (action === "Generate Files") { + // TODO: Implement file generation + vscode.window.showInformationMessage( + "File generation will be available soon!", + ); + } else if (action === "Don't Show Again") { + await this.configManager.updateConfiguration( + "notifications.enabled", + false, + ); + } + } + } catch (error) { + // Use proper VS Code logging instead of console.log + const outputChannel = vscode.window.createOutputChannel("StackCode"); + outputChannel.appendLine(`Error checking project structure: ${error}`); } + } + dispose() { + this.disposables.forEach((d) => d.dispose()); + this.disposables = []; + this.processedFiles.clear(); + } } exports.FileMonitor = FileMonitor; -//# sourceMappingURL=FileMonitor.js.map \ No newline at end of file +//# sourceMappingURL=FileMonitor.js.map diff --git a/packages/vscode-extension/out/monitors/GitMonitor.js b/packages/vscode-extension/out/monitors/GitMonitor.js index 078f0430..4cd5cbbe 100644 --- a/packages/vscode-extension/out/monitors/GitMonitor.js +++ b/packages/vscode-extension/out/monitors/GitMonitor.js @@ -1,190 +1,224 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GitMonitor = void 0; const vscode = __importStar(require("vscode")); class GitMonitor { - constructor(proactiveManager, configManager) { - this.disposables = []; - this.proactiveManager = proactiveManager; - this.configManager = configManager; + constructor(proactiveManager, configManager) { + this.disposables = []; + this.proactiveManager = proactiveManager; + this.configManager = configManager; + } + startMonitoring() { + // Monitor git extension state changes + const gitExtension = vscode.extensions.getExtension("vscode.git"); + if (gitExtension) { + if (gitExtension.isActive) { + this.setupGitMonitoring(); + } else { + gitExtension.activate().then(() => { + this.setupGitMonitoring(); + }); + } } - startMonitoring() { - // Monitor git extension state changes - const gitExtension = vscode.extensions.getExtension("vscode.git"); - if (gitExtension) { - if (gitExtension.isActive) { - this.setupGitMonitoring(); - } - else { - gitExtension.activate().then(() => { - this.setupGitMonitoring(); - }); - } - } - // Monitor workspace folder changes - this.disposables.push(vscode.workspace.onDidChangeWorkspaceFolders(() => { + // Monitor workspace folder changes + this.disposables.push( + vscode.workspace.onDidChangeWorkspaceFolders(() => { + this.checkCurrentBranch(); + }), + ); + // Initial check + setTimeout(() => { + this.checkCurrentBranch(); + }, 2000); + } + setupGitMonitoring() { + try { + const git = vscode.extensions.getExtension("vscode.git")?.exports; + if (git) { + const gitAPI = git.getAPI(1); + this.disposables.push( + gitAPI.onDidChangeState(() => { this.checkCurrentBranch(); - })); - // Initial check - setTimeout(() => { + }), + ); + this.disposables.push( + gitAPI.onDidOpenRepository(() => { this.checkCurrentBranch(); - }, 2000); + }), + ); + } + } catch (error) { + console.log("Failed to setup git monitoring:", error); } - setupGitMonitoring() { - try { - const git = vscode.extensions.getExtension("vscode.git")?.exports; - if (git) { - const gitAPI = git.getAPI(1); - this.disposables.push(gitAPI.onDidChangeState(() => { - this.checkCurrentBranch(); - })); - this.disposables.push(gitAPI.onDidOpenRepository(() => { - this.checkCurrentBranch(); - })); - } - } - catch (error) { - console.log("Failed to setup git monitoring:", error); + } + async checkCurrentBranch() { + try { + const git = vscode.extensions.getExtension("vscode.git")?.exports; + if (git) { + const gitAPI = git.getAPI(1); + const repo = gitAPI.repositories[0]; + if (repo && repo.state.HEAD) { + const currentBranch = repo.state.HEAD.name; + if (currentBranch && currentBranch !== this.lastBranch) { + this.lastBranch = currentBranch; + await this.proactiveManager.showBranchWarning(currentBranch); + } } + } + } catch (error) { + console.log("Error checking current branch:", error); } - async checkCurrentBranch() { - try { - const git = vscode.extensions.getExtension("vscode.git")?.exports; - if (git) { - const gitAPI = git.getAPI(1); - const repo = gitAPI.repositories[0]; - if (repo && repo.state.HEAD) { - const currentBranch = repo.state.HEAD.name; - if (currentBranch && currentBranch !== this.lastBranch) { - this.lastBranch = currentBranch; - await this.proactiveManager.showBranchWarning(currentBranch); - } - } - } + } + async showCreateBranchDialog() { + const branchName = await vscode.window.showInputBox({ + prompt: "Enter the name for the new branch", + placeHolder: "feature/new-feature", + validateInput: (value) => { + if (!value) { + return "Branch name is required"; } - catch (error) { - console.log("Error checking current branch:", error); + if (!/^[a-zA-Z0-9/_-]+$/.test(value)) { + return "Branch name can only contain letters, numbers, hyphens, underscores and slashes"; } - } - async showCreateBranchDialog() { - const branchName = await vscode.window.showInputBox({ - prompt: "Enter the name for the new branch", - placeHolder: "feature/new-feature", - validateInput: (value) => { - if (!value) { - return "Branch name is required"; - } - if (!/^[a-zA-Z0-9/_-]+$/.test(value)) { - return "Branch name can only contain letters, numbers, hyphens, underscores and slashes"; - } - return null; - }, - }); - if (branchName) { - 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" }, - ], { - placeHolder: "Select branch type", - }); - if (branchType) { - const fullBranchName = branchName.includes("/") - ? branchName - : `${branchType.label}/${branchName}`; - try { - const terminal = vscode.window.createTerminal("StackCode Git"); - terminal.sendText(`git checkout -b ${fullBranchName}`); - terminal.show(); - vscode.window.showInformationMessage(`✅ Created and switched to branch: ${fullBranchName}`); - } - catch (error) { - vscode.window.showErrorMessage(`Failed to create branch: ${error}`); - } - } + return null; + }, + }); + if (branchName) { + 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" }, + ], + { + placeHolder: "Select branch type", + }, + ); + if (branchType) { + const fullBranchName = branchName.includes("/") + ? branchName + : `${branchType.label}/${branchName}`; + try { + const terminal = vscode.window.createTerminal("StackCode Git"); + terminal.sendText(`git checkout -b ${fullBranchName}`); + terminal.show(); + vscode.window.showInformationMessage( + `✅ Created and switched to branch: ${fullBranchName}`, + ); + } catch (error) { + vscode.window.showErrorMessage(`Failed to create branch: ${error}`); } + } } - async showCommitMessageDialog() { - const commitType = await vscode.window.showQuickPick([ - { label: "feat", description: "A new feature" }, - { label: "fix", description: "A bug fix" }, - { label: "docs", description: "Documentation changes" }, - { label: "style", description: "Code style changes (formatting, etc)" }, - { label: "refactor", description: "Code refactoring" }, - { label: "perf", description: "Performance improvements" }, - { label: "test", description: "Adding or updating tests" }, - { label: "chore", description: "Maintenance tasks" }, - { label: "build", description: "Build system changes" }, - { label: "ci", description: "CI/CD changes" }, - ], { - placeHolder: "Select commit type", - }); - if (!commitType) { - return; - } - const scope = await vscode.window.showInputBox({ - prompt: "Enter scope (optional)", - placeHolder: "auth, api, ui, etc.", - }); - const description = await vscode.window.showInputBox({ - prompt: "Enter commit description", - placeHolder: "add user authentication", - validateInput: (value) => { - if (!value) { - return "Description is required"; - } - if (value.length > 50) { - return "Description should be 50 characters or less"; - } - return null; - }, - }); - if (!description) { - return; + } + async showCommitMessageDialog() { + const commitType = await vscode.window.showQuickPick( + [ + { label: "feat", description: "A new feature" }, + { label: "fix", description: "A bug fix" }, + { label: "docs", description: "Documentation changes" }, + { label: "style", description: "Code style changes (formatting, etc)" }, + { label: "refactor", description: "Code refactoring" }, + { label: "perf", description: "Performance improvements" }, + { label: "test", description: "Adding or updating tests" }, + { label: "chore", description: "Maintenance tasks" }, + { label: "build", description: "Build system changes" }, + { label: "ci", description: "CI/CD changes" }, + ], + { + placeHolder: "Select commit type", + }, + ); + if (!commitType) { + return; + } + const scope = await vscode.window.showInputBox({ + prompt: "Enter scope (optional)", + placeHolder: "auth, api, ui, etc.", + }); + const description = await vscode.window.showInputBox({ + prompt: "Enter commit description", + placeHolder: "add user authentication", + validateInput: (value) => { + if (!value) { + return "Description is required"; } - let commitMessage = commitType.label; - if (scope) { - commitMessage += `(${scope})`; + if (value.length > 50) { + return "Description should be 50 characters or less"; } - commitMessage += `: ${description}`; - // Copy to clipboard - await vscode.env.clipboard.writeText(commitMessage); - vscode.window - .showInformationMessage(`📋 Commit message copied to clipboard: ${commitMessage}`, "Open Git Panel") - .then((action) => { - if (action === "Open Git Panel") { - vscode.commands.executeCommand("workbench.view.scm"); - } - }); + return null; + }, + }); + if (!description) { + return; } - dispose() { - this.disposables.forEach((d) => d.dispose()); - this.disposables = []; + let commitMessage = commitType.label; + if (scope) { + commitMessage += `(${scope})`; } + commitMessage += `: ${description}`; + // Copy to clipboard + await vscode.env.clipboard.writeText(commitMessage); + vscode.window + .showInformationMessage( + `📋 Commit message copied to clipboard: ${commitMessage}`, + "Open Git Panel", + ) + .then((action) => { + if (action === "Open Git Panel") { + vscode.commands.executeCommand("workbench.view.scm"); + } + }); + } + dispose() { + this.disposables.forEach((d) => d.dispose()); + this.disposables = []; + } } exports.GitMonitor = GitMonitor; -//# sourceMappingURL=GitMonitor.js.map \ No newline at end of file +//# sourceMappingURL=GitMonitor.js.map diff --git a/packages/vscode-extension/out/notifications/ProactiveNotificationManager.js b/packages/vscode-extension/out/notifications/ProactiveNotificationManager.js index ee37fa34..4a6d94f3 100644 --- a/packages/vscode-extension/out/notifications/ProactiveNotificationManager.js +++ b/packages/vscode-extension/out/notifications/ProactiveNotificationManager.js @@ -1,207 +1,268 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ProactiveNotificationManager = void 0; const vscode = __importStar(require("vscode")); class ProactiveNotificationManager { - constructor(configManager) { - this.notificationQueue = []; - this.configManager = configManager; + constructor(configManager) { + this.notificationQueue = []; + this.configManager = configManager; + } + async showWelcomeMessage() { + if (!this.configManager.notificationsEnabled) { + return; } - async showWelcomeMessage() { - if (!this.configManager.notificationsEnabled) { - return; - } - const action = await vscode.window.showInformationMessage("🚀 StackCode is now active! Get proactive suggestions to improve your development workflow.", "Learn More", "Settings"); - if (action === "Learn More") { - vscode.env.openExternal(vscode.Uri.parse("https://github.com/YagoBorba/StackCode")); - } - else if (action === "Settings") { - vscode.commands.executeCommand("workbench.action.openSettings", "stackcode"); - } + const action = await vscode.window.showInformationMessage( + "🚀 StackCode is now active! Get proactive suggestions to improve your development workflow.", + "Learn More", + "Settings", + ); + if (action === "Learn More") { + vscode.env.openExternal( + vscode.Uri.parse("https://github.com/YagoBorba/StackCode"), + ); + } else if (action === "Settings") { + vscode.commands.executeCommand( + "workbench.action.openSettings", + "stackcode", + ); } - async showBranchWarning(currentBranch) { - if (!this.configManager.branchCheckEnabled) { - return; - } - const isMainBranch = ["main", "master", "develop"].includes(currentBranch); - if (isMainBranch) { - const action = await vscode.window.showWarningMessage(`⚠️ You are working on the ${currentBranch} branch. Would you like to create a new feature branch?`, "Create Branch", "Continue", "Don't Show Again"); - if (action === "Create Branch") { - vscode.commands.executeCommand("stackcode.createBranch"); - } - else if (action === "Don't Show Again") { - await this.configManager.updateConfiguration("notifications.branchCheck", false); - } - } + } + async showBranchWarning(currentBranch) { + if (!this.configManager.branchCheckEnabled) { + return; } - async showCommitMessageWarning(message) { - if (!this.configManager.commitCheckEnabled) { - return; - } - const isConventional = this.isConventionalCommit(message); - if (!isConventional) { - const action = await vscode.window.showWarningMessage("💬 We detected you are trying to commit without a conventional message. Would you like help formatting it?", "Format Message", "Continue", "Learn More"); - if (action === "Format Message") { - vscode.commands.executeCommand("stackcode.formatCommitMessage"); - } - else if (action === "Learn More") { - vscode.env.openExternal(vscode.Uri.parse("https://conventionalcommits.org/")); - } - } - } - async showFileCreationSuggestion(fileName) { - if (!this.configManager.notificationsEnabled) { - return; - } - if (fileName === "README.md") { - const action = await vscode.window.showInformationMessage("📝 Would you like to generate a comprehensive README.md using StackCode templates?", "Generate README", "Not Now"); - if (action === "Generate README") { - // TODO: Implement README generation - vscode.window.showInformationMessage("README generation will be available soon!"); - } - } - else if (fileName === ".gitignore") { - const action = await vscode.window.showInformationMessage("🚫 Would you like to generate a .gitignore file based on your project type?", "Generate .gitignore", "Not Now"); - if (action === "Generate .gitignore") { - // TODO: Implement .gitignore generation - vscode.window.showInformationMessage(".gitignore generation will be available soon!"); - } - } + const isMainBranch = ["main", "master", "develop"].includes(currentBranch); + if (isMainBranch) { + const action = await vscode.window.showWarningMessage( + `⚠️ You are working on the ${currentBranch} branch. Would you like to create a new feature branch?`, + "Create Branch", + "Continue", + "Don't Show Again", + ); + if (action === "Create Branch") { + vscode.commands.executeCommand("stackcode.createBranch"); + } else if (action === "Don't Show Again") { + await this.configManager.updateConfiguration( + "notifications.branchCheck", + false, + ); + } } - async runFullBestPracticesCheck() { - const issues = []; - // Check if working on main branch - try { - const gitExtension = vscode.extensions.getExtension("vscode.git")?.exports; - if (gitExtension) { - const repo = gitExtension.getAPI(1).repositories[0]; - if (repo && - ["main", "master", "develop"].includes(repo.state.HEAD?.name || "")) { - issues.push("Working on main/develop branch"); - } - } - } - catch (error) { - // Git extension not available or error accessing it - console.log("Git extension error:", error); - } - // Check for missing files - const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; - if (workspaceFolder) { - const files = await vscode.workspace.fs.readDirectory(workspaceFolder.uri); - const fileNames = files.map(([name]) => name); - if (!fileNames.includes("README.md")) { - issues.push("Missing README.md file"); - } - if (!fileNames.includes(".gitignore")) { - issues.push("Missing .gitignore file"); - } - } - if (issues.length === 0) { - vscode.window.showInformationMessage("✅ All best practices checks passed!"); - } - else { - const message = `Found ${issues.length} potential improvements:\n${issues.map((issue) => `• ${issue}`).join("\n")}`; - vscode.window.showWarningMessage(message, "Fix Issues"); - } + } + async showCommitMessageWarning(message) { + if (!this.configManager.commitCheckEnabled) { + return; } - isConventionalCommit(message) { - const conventionalPattern = /^(feat|fix|docs|style|refactor|perf|test|chore|build|ci)(\(.+\))?: .+/; - return conventionalPattern.test(message); + const isConventional = this.isConventionalCommit(message); + if (!isConventional) { + const action = await vscode.window.showWarningMessage( + "💬 We detected you are trying to commit without a conventional message. Would you like help formatting it?", + "Format Message", + "Continue", + "Learn More", + ); + if (action === "Format Message") { + vscode.commands.executeCommand("stackcode.formatCommitMessage"); + } else if (action === "Learn More") { + vscode.env.openExternal( + vscode.Uri.parse("https://conventionalcommits.org/"), + ); + } } - async handleApplyFix(message) { - // Enhanced fix handling with specific actions - if (message.includes("README")) { - await vscode.commands.executeCommand("stackcode.generate.readme"); - } - else if (message.includes("gitignore")) { - await vscode.commands.executeCommand("stackcode.generate.gitignore"); - } - else if (message.includes("commit")) { - await vscode.commands.executeCommand("stackcode.commit"); - } - else { - await vscode.commands.executeCommand("stackcode.validate"); - } + } + async showFileCreationSuggestion(fileName) { + if (!this.configManager.notificationsEnabled) { + return; } - async handleLearnMore(message) { - const learnMoreUrls = { - "conventional commits": "https://conventionalcommits.org/", - gitflow: "https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow", - readme: "https://www.makeareadme.com/", - "git best practices": "https://sethrobertson.github.io/GitBestPractices/", - }; - const topic = Object.keys(learnMoreUrls).find((key) => message.toLowerCase().includes(key)) || "git best practices"; - await vscode.env.openExternal(vscode.Uri.parse(learnMoreUrls[topic])); + if (fileName === "README.md") { + const action = await vscode.window.showInformationMessage( + "📝 Would you like to generate a comprehensive README.md using StackCode templates?", + "Generate README", + "Not Now", + ); + if (action === "Generate README") { + // TODO: Implement README generation + vscode.window.showInformationMessage( + "README generation will be available soon!", + ); + } + } else if (fileName === ".gitignore") { + const action = await vscode.window.showInformationMessage( + "🚫 Would you like to generate a .gitignore file based on your project type?", + "Generate .gitignore", + "Not Now", + ); + if (action === "Generate .gitignore") { + // TODO: Implement .gitignore generation + vscode.window.showInformationMessage( + ".gitignore generation will be available soon!", + ); + } } - async handleStartWorkflow(workflowType) { - switch (workflowType) { - case "feature": - await vscode.commands.executeCommand("stackcode.git.feature.start"); - break; - case "hotfix": - await vscode.commands.executeCommand("stackcode.git.hotfix.start"); - break; - case "release": - await vscode.commands.executeCommand("stackcode.release"); - break; - default: - await vscode.commands.executeCommand("stackcode.git.feature.start"); + } + async runFullBestPracticesCheck() { + const issues = []; + // Check if working on main branch + try { + const gitExtension = + vscode.extensions.getExtension("vscode.git")?.exports; + if (gitExtension) { + const repo = gitExtension.getAPI(1).repositories[0]; + if ( + repo && + ["main", "master", "develop"].includes(repo.state.HEAD?.name || "") + ) { + issues.push("Working on main/develop branch"); } + } + } catch (error) { + // Git extension not available or error accessing it + console.log("Git extension error:", error); } - async handleConfigureWorkflow() { - await vscode.commands.executeCommand("stackcode.config"); + // Check for missing files + const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; + if (workspaceFolder) { + const files = await vscode.workspace.fs.readDirectory( + workspaceFolder.uri, + ); + const fileNames = files.map(([name]) => name); + if (!fileNames.includes("README.md")) { + issues.push("Missing README.md file"); + } + if (!fileNames.includes(".gitignore")) { + issues.push("Missing .gitignore file"); + } } - async handleFixProjectIssue(issue) { - if (issue.includes("README")) { - await vscode.commands.executeCommand("stackcode.generate.readme"); - } - else if (issue.includes("gitignore")) { - await vscode.commands.executeCommand("stackcode.generate.gitignore"); - } - else { - await vscode.commands.executeCommand("stackcode.validate"); - } + if (issues.length === 0) { + vscode.window.showInformationMessage( + "✅ All best practices checks passed!", + ); + } else { + const message = `Found ${issues.length} potential improvements:\n${issues.map((issue) => `• ${issue}`).join("\n")}`; + vscode.window.showWarningMessage(message, "Fix Issues"); + } + } + isConventionalCommit(message) { + const conventionalPattern = + /^(feat|fix|docs|style|refactor|perf|test|chore|build|ci)(\(.+\))?: .+/; + return conventionalPattern.test(message); + } + async handleApplyFix(message) { + // Enhanced fix handling with specific actions + if (message.includes("README")) { + await vscode.commands.executeCommand("stackcode.generate.readme"); + } else if (message.includes("gitignore")) { + await vscode.commands.executeCommand("stackcode.generate.gitignore"); + } else if (message.includes("commit")) { + await vscode.commands.executeCommand("stackcode.commit"); + } else { + await vscode.commands.executeCommand("stackcode.validate"); } - async handleShowDetails(issue) { - const outputChannel = vscode.window.createOutputChannel("StackCode Details"); - outputChannel.appendLine(`=== Project Issue Details ===`); - outputChannel.appendLine(`Issue: ${issue}`); - outputChannel.appendLine(`Timestamp: ${new Date().toISOString()}`); - outputChannel.appendLine(`Workspace: ${vscode.workspace.name || "Unknown"}`); - outputChannel.appendLine(""); - outputChannel.appendLine("Suggested Actions:"); - outputChannel.appendLine("1. Run project validation"); - outputChannel.appendLine("2. Check project structure"); - outputChannel.appendLine("3. Review best practices"); - outputChannel.show(); + } + async handleLearnMore(message) { + const learnMoreUrls = { + "conventional commits": "https://conventionalcommits.org/", + gitflow: + "https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow", + readme: "https://www.makeareadme.com/", + "git best practices": "https://sethrobertson.github.io/GitBestPractices/", + }; + const topic = + Object.keys(learnMoreUrls).find((key) => + message.toLowerCase().includes(key), + ) || "git best practices"; + await vscode.env.openExternal(vscode.Uri.parse(learnMoreUrls[topic])); + } + async handleStartWorkflow(workflowType) { + switch (workflowType) { + case "feature": + await vscode.commands.executeCommand("stackcode.git.feature.start"); + break; + case "hotfix": + await vscode.commands.executeCommand("stackcode.git.hotfix.start"); + break; + case "release": + await vscode.commands.executeCommand("stackcode.release"); + break; + default: + await vscode.commands.executeCommand("stackcode.git.feature.start"); } - dispose() { - // Cleanup if needed + } + async handleConfigureWorkflow() { + await vscode.commands.executeCommand("stackcode.config"); + } + async handleFixProjectIssue(issue) { + if (issue.includes("README")) { + await vscode.commands.executeCommand("stackcode.generate.readme"); + } else if (issue.includes("gitignore")) { + await vscode.commands.executeCommand("stackcode.generate.gitignore"); + } else { + await vscode.commands.executeCommand("stackcode.validate"); } + } + async handleShowDetails(issue) { + const outputChannel = + vscode.window.createOutputChannel("StackCode Details"); + outputChannel.appendLine(`=== Project Issue Details ===`); + outputChannel.appendLine(`Issue: ${issue}`); + outputChannel.appendLine(`Timestamp: ${new Date().toISOString()}`); + outputChannel.appendLine( + `Workspace: ${vscode.workspace.name || "Unknown"}`, + ); + outputChannel.appendLine(""); + outputChannel.appendLine("Suggested Actions:"); + outputChannel.appendLine("1. Run project validation"); + outputChannel.appendLine("2. Check project structure"); + outputChannel.appendLine("3. Review best practices"); + outputChannel.show(); + } + dispose() { + // Cleanup if needed + } } exports.ProactiveNotificationManager = ProactiveNotificationManager; -//# sourceMappingURL=ProactiveNotificationManager.js.map \ No newline at end of file +//# sourceMappingURL=ProactiveNotificationManager.js.map diff --git a/packages/vscode-extension/out/providers/DashboardProvider.backup.js b/packages/vscode-extension/out/providers/DashboardProvider.backup.js index 213458c8..ebf17cfa 100644 --- a/packages/vscode-extension/out/providers/DashboardProvider.backup.js +++ b/packages/vscode-extension/out/providers/DashboardProvider.backup.js @@ -1,163 +1,220 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.DashboardProvider = void 0; const vscode = __importStar(require("vscode")); const path = __importStar(require("path")); const fs = __importStar(require("fs")); class DashboardProvider { - constructor(context) { - this._disposables = []; - this._extensionUri = context.extensionUri; - } - resolveWebviewView(webviewView, + constructor(context) { + this._disposables = []; + this._extensionUri = context.extensionUri; + } + resolveWebviewView( + webviewView, // eslint-disable-next-line @typescript-eslint/no-unused-vars - context, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - token) { - this._view = webviewView; - webviewView.webview.options = { - enableScripts: true, - localResourceRoots: [vscode.Uri.joinPath(this._extensionUri, 'dist')], - }; - webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); - webviewView.webview.onDidReceiveMessage(async (data) => { - console.log(`[StackCode] Received command from webview: ${data.type}`); - try { - // Tratar comandos específicos do webview - switch (data.type) { - case 'webviewReady': - console.log('[StackCode] Webview reported ready, sending initial data'); - this.updateProjectStats(); - return; - case 'refreshStats': - this.updateProjectStats(); - return; - default: - // Executar comando normal do VS Code - await vscode.commands.executeCommand(data.type, data.payload); - } - } - catch (error) { - console.error(`[StackCode] Error executing command ${data.type}:`, error); - this.sendMessage({ - type: 'commandError', - payload: { command: data.type, error: error instanceof Error ? error.message : 'Unknown error' } - }); - } - }, undefined, this._disposables); - // WebviewView doesn't have onDidBecomeVisible, so we'll update stats immediately - this.updateProjectStats(); - } - sendMessage(message) { - if (this._view) { - this._view.webview.postMessage(message); + context, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + token, + ) { + this._view = webviewView; + webviewView.webview.options = { + enableScripts: true, + localResourceRoots: [vscode.Uri.joinPath(this._extensionUri, "dist")], + }; + webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); + webviewView.webview.onDidReceiveMessage( + async (data) => { + console.log(`[StackCode] Received command from webview: ${data.type}`); + try { + // Tratar comandos específicos do webview + switch (data.type) { + case "webviewReady": + console.log( + "[StackCode] Webview reported ready, sending initial data", + ); + this.updateProjectStats(); + return; + case "refreshStats": + this.updateProjectStats(); + return; + default: + // Executar comando normal do VS Code + await vscode.commands.executeCommand(data.type, data.payload); + } + } catch (error) { + console.error( + `[StackCode] Error executing command ${data.type}:`, + error, + ); + this.sendMessage({ + type: "commandError", + payload: { + command: data.type, + error: error instanceof Error ? error.message : "Unknown error", + }, + }); } + }, + undefined, + this._disposables, + ); + // WebviewView doesn't have onDidBecomeVisible, so we'll update stats immediately + this.updateProjectStats(); + } + sendMessage(message) { + if (this._view) { + this._view.webview.postMessage(message); } - show() { - if (this._view) { - this._view.show?.(true); - } - else { - // If view is not created yet, trigger the creation by executing the show command - vscode.commands.executeCommand('workbench.view.extension.stackcode'); - } + } + show() { + if (this._view) { + this._view.show?.(true); + } else { + // If view is not created yet, trigger the creation by executing the show command + vscode.commands.executeCommand("workbench.view.extension.stackcode"); } - async updateProjectStats() { - if (!this._view) { - console.log('[StackCode] No view available for stats update'); - return; - } - const workspaceFolders = vscode.workspace.workspaceFolders; - console.log('[StackCode] Workspace folders:', workspaceFolders?.length || 0); - console.log('[StackCode] Workspace name:', vscode.workspace.name); - console.log('[StackCode] Workspace file:', vscode.workspace.workspaceFile?.toString()); - if (!workspaceFolders || workspaceFolders.length === 0) { - console.log('[StackCode] No workspace folders found, using alternative detection'); - // Fallback: usar informações do contexto da extensão - const extensionWorkspace = path.dirname(path.dirname(path.dirname(this._extensionUri.fsPath))); - console.log('[StackCode] Extension workspace path:', extensionWorkspace); - this.sendMessage({ - type: 'updateStats', - payload: { - files: 0, - workspaceName: 'StackCode (Debug)', - workspacePath: extensionWorkspace, - mode: 'development' - } - }); - return; - } - try { - const files = await vscode.workspace.findFiles('**/*', '**/node_modules/**', 1000); - console.log('[StackCode] Found files:', files.length); - this.sendMessage({ - type: 'updateStats', - payload: { - files: files.length, - workspaceName: workspaceFolders[0].name, - workspacePath: workspaceFolders[0].uri.fsPath, - mode: 'production' - }, - }); - } - catch (e) { - console.error("[StackCode] Error fetching project stats:", e); - this.sendMessage({ - type: 'updateStats', - payload: { files: 0, error: 'Failed to scan files' } - }); - } + } + async updateProjectStats() { + if (!this._view) { + console.log("[StackCode] No view available for stats update"); + return; } - _getHtmlForWebview(webview) { - const nonce = getNonce(); - const buildPath = vscode.Uri.joinPath(this._extensionUri, 'dist', 'webview-ui'); - // Lê o manifest.json do Vite - const manifestPath = path.join(buildPath.fsPath, '.vite', 'manifest.json'); - console.log('[StackCode] Build path:', buildPath.fsPath); - console.log('[StackCode] Manifest path:', manifestPath); - console.log('[StackCode] Manifest exists:', fs.existsSync(manifestPath)); - try { - const manifestContent = fs.readFileSync(manifestPath, 'utf-8'); - const manifest = JSON.parse(manifestContent); - console.log('[StackCode] Manifest content:', manifest); - // Pega os arquivos do manifest do Vite - const indexEntry = manifest['index.html']; - const scriptFile = indexEntry.file; - const cssFiles = indexEntry.css || []; - const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(buildPath, scriptFile)); - const cssUris = cssFiles.map((cssFile) => webview.asWebviewUri(vscode.Uri.joinPath(buildPath, cssFile))); - console.log('[StackCode] Script URI:', scriptUri.toString()); - console.log('[StackCode] CSS URIs:', cssUris.map((uri) => uri.toString())); - return ` + const workspaceFolders = vscode.workspace.workspaceFolders; + console.log( + "[StackCode] Workspace folders:", + workspaceFolders?.length || 0, + ); + console.log("[StackCode] Workspace name:", vscode.workspace.name); + console.log( + "[StackCode] Workspace file:", + vscode.workspace.workspaceFile?.toString(), + ); + if (!workspaceFolders || workspaceFolders.length === 0) { + console.log( + "[StackCode] No workspace folders found, using alternative detection", + ); + // Fallback: usar informações do contexto da extensão + const extensionWorkspace = path.dirname( + path.dirname(path.dirname(this._extensionUri.fsPath)), + ); + console.log("[StackCode] Extension workspace path:", extensionWorkspace); + this.sendMessage({ + type: "updateStats", + payload: { + files: 0, + workspaceName: "StackCode (Debug)", + workspacePath: extensionWorkspace, + mode: "development", + }, + }); + return; + } + try { + const files = await vscode.workspace.findFiles( + "**/*", + "**/node_modules/**", + 1000, + ); + console.log("[StackCode] Found files:", files.length); + this.sendMessage({ + type: "updateStats", + payload: { + files: files.length, + workspaceName: workspaceFolders[0].name, + workspacePath: workspaceFolders[0].uri.fsPath, + mode: "production", + }, + }); + } catch (e) { + console.error("[StackCode] Error fetching project stats:", e); + this.sendMessage({ + type: "updateStats", + payload: { files: 0, error: "Failed to scan files" }, + }); + } + } + _getHtmlForWebview(webview) { + const nonce = getNonce(); + const buildPath = vscode.Uri.joinPath( + this._extensionUri, + "dist", + "webview-ui", + ); + // Lê o manifest.json do Vite + const manifestPath = path.join(buildPath.fsPath, ".vite", "manifest.json"); + console.log("[StackCode] Build path:", buildPath.fsPath); + console.log("[StackCode] Manifest path:", manifestPath); + console.log("[StackCode] Manifest exists:", fs.existsSync(manifestPath)); + try { + const manifestContent = fs.readFileSync(manifestPath, "utf-8"); + const manifest = JSON.parse(manifestContent); + console.log("[StackCode] Manifest content:", manifest); + // Pega os arquivos do manifest do Vite + const indexEntry = manifest["index.html"]; + const scriptFile = indexEntry.file; + const cssFiles = indexEntry.css || []; + const scriptUri = webview.asWebviewUri( + vscode.Uri.joinPath(buildPath, scriptFile), + ); + const cssUris = cssFiles.map((cssFile) => + webview.asWebviewUri(vscode.Uri.joinPath(buildPath, cssFile)), + ); + console.log("[StackCode] Script URI:", scriptUri.toString()); + console.log( + "[StackCode] CSS URIs:", + cssUris.map((uri) => uri.toString()), + ); + return ` - ${cssUris.map((uri) => ``).join('\n ')} + ${cssUris.map((uri) => ``).join("\n ")} StackCode Dashboard @@ -190,11 +247,10 @@ class DashboardProvider { `; - } - catch (error) { - console.error("[StackCode] Error reading manifest:", error); - // Fallback melhorado para desenvolvimento - return ` + } catch (error) { + console.error("[StackCode] Error reading manifest:", error); + // Fallback melhorado para desenvolvimento + return ` @@ -240,33 +296,34 @@ class DashboardProvider {

Execute: npm run build:ui

- Erro: ${error instanceof Error ? error.message : 'Manifest não encontrado'} + Erro: ${error instanceof Error ? error.message : "Manifest não encontrado"}

Status da extensão: ✅ Ativa

-

Workspace: ${vscode.workspace.workspaceFolders?.[0]?.name || 'Nenhum'}

+

Workspace: ${vscode.workspace.workspaceFolders?.[0]?.name || "Nenhum"}

`; - } } - // CORREÇÃO: Adicionando o método dispose para conformidade. - dispose() { - while (this._disposables.length) { - const x = this._disposables.pop(); - if (x) { - x.dispose(); - } - } + } + // CORREÇÃO: Adicionando o método dispose para conformidade. + dispose() { + while (this._disposables.length) { + const x = this._disposables.pop(); + if (x) { + x.dispose(); + } } + } } exports.DashboardProvider = DashboardProvider; DashboardProvider.viewType = "stackcode.dashboard"; function getNonce() { - let text = ''; - const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - for (let i = 0; i < 32; i++) { - text += possible.charAt(Math.floor(Math.random() * possible.length)); - } - return text; + let text = ""; + const possible = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + for (let i = 0; i < 32; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } + return text; } -//# sourceMappingURL=DashboardProvider.backup.js.map \ No newline at end of file +//# sourceMappingURL=DashboardProvider.backup.js.map diff --git a/packages/vscode-extension/out/providers/DashboardProvider.backup.js.map b/packages/vscode-extension/out/providers/DashboardProvider.backup.js.map index 47460414..88fe2446 100644 --- a/packages/vscode-extension/out/providers/DashboardProvider.backup.js.map +++ b/packages/vscode-extension/out/providers/DashboardProvider.backup.js.map @@ -1 +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,OAAO;QACV,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;YAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;YAClC,IAAI,CAAC,EAAE;gBACH,CAAC,CAAC,OAAO,EAAE,CAAC;aACf;SACJ;IACL,CAAC;;AAxQL,8CAyQC;AAxQ0B,0BAAQ,GAAG,qBAAqB,CAAC;AA0Q5D,SAAS,QAAQ;IACb,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,MAAM,QAAQ,GAAG,gEAAgE,CAAC;IAClF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;QACzB,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;KACxE;IACD,OAAO,IAAI,CAAC;AAChB,CAAC"} \ No newline at end of file +{"version":3,"file":"DashboardProvider.backup.js","sourceRoot":"","sources":["../../src/providers/DashboardProvider.backup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,2CAA6B;AAC7B,uCAAyB;AAEzB,MAAa,iBAAiB;IAQ5B,YAAY,OAAgC;QAFpC,iBAAY,GAAwB,EAAE,CAAC;QAG7C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAC5C,CAAC;IAEM,kBAAkB,CACvB,WAA+B;IAC/B,6DAA6D;IAC7D,OAAyC;IACzC,6DAA6D;IAC7D,KAA+B;QAE/B,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC;QAEzB,WAAW,CAAC,OAAO,CAAC,OAAO,GAAG;YAC5B,aAAa,EAAE,IAAI;YACnB,kBAAkB,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CA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/vscode-extension/out/providers/DashboardProvider.js b/packages/vscode-extension/out/providers/DashboardProvider.js index 94e2493d..b44af57c 100644 --- a/packages/vscode-extension/out/providers/DashboardProvider.js +++ b/packages/vscode-extension/out/providers/DashboardProvider.js @@ -1,163 +1,220 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.DashboardProvider = void 0; const vscode = __importStar(require("vscode")); const path = __importStar(require("path")); const fs = __importStar(require("fs")); class DashboardProvider { - constructor(context) { - this._disposables = []; - this._extensionUri = context.extensionUri; - } - resolveWebviewView(webviewView, + constructor(context) { + this._disposables = []; + this._extensionUri = context.extensionUri; + } + resolveWebviewView( + webviewView, // eslint-disable-next-line @typescript-eslint/no-unused-vars - context, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - token) { - this._view = webviewView; - webviewView.webview.options = { - enableScripts: true, - localResourceRoots: [vscode.Uri.joinPath(this._extensionUri, 'dist')], - }; - webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); - webviewView.webview.onDidReceiveMessage(async (data) => { - console.log(`[StackCode] Received command from webview: ${data.type}`); - try { - // Tratar comandos específicos do webview - switch (data.type) { - case 'webviewReady': - console.log('[StackCode] Webview reported ready, sending initial data'); - this.updateProjectStats(); - return; - case 'refreshStats': - this.updateProjectStats(); - return; - default: - // Executar comando normal do VS Code - await vscode.commands.executeCommand(data.type, data.payload); - } - } - catch (error) { - console.error(`[StackCode] Error executing command ${data.type}:`, error); - this.sendMessage({ - type: 'commandError', - payload: { command: data.type, error: error instanceof Error ? error.message : 'Unknown error' } - }); - } - }, undefined, this._disposables); - // WebviewView doesn't have onDidBecomeVisible, so we'll update stats immediately - this.updateProjectStats(); - } - sendMessage(message) { - if (this._view) { - this._view.webview.postMessage(message); + context, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + token, + ) { + this._view = webviewView; + webviewView.webview.options = { + enableScripts: true, + localResourceRoots: [vscode.Uri.joinPath(this._extensionUri, "dist")], + }; + webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); + webviewView.webview.onDidReceiveMessage( + async (data) => { + console.log(`[StackCode] Received command from webview: ${data.type}`); + try { + // Tratar comandos específicos do webview + switch (data.type) { + case "webviewReady": + console.log( + "[StackCode] Webview reported ready, sending initial data", + ); + this.updateProjectStats(); + return; + case "refreshStats": + this.updateProjectStats(); + return; + default: + // Executar comando normal do VS Code + await vscode.commands.executeCommand(data.type, data.payload); + } + } catch (error) { + console.error( + `[StackCode] Error executing command ${data.type}:`, + error, + ); + this.sendMessage({ + type: "commandError", + payload: { + command: data.type, + error: error instanceof Error ? error.message : "Unknown error", + }, + }); } + }, + undefined, + this._disposables, + ); + // WebviewView doesn't have onDidBecomeVisible, so we'll update stats immediately + this.updateProjectStats(); + } + sendMessage(message) { + if (this._view) { + this._view.webview.postMessage(message); } - show() { - if (this._view) { - this._view.show?.(true); - } - else { - // If view is not created yet, trigger the creation by executing the show command - vscode.commands.executeCommand('workbench.view.extension.stackcode'); - } + } + show() { + if (this._view) { + this._view.show?.(true); + } else { + // If view is not created yet, trigger the creation by executing the show command + vscode.commands.executeCommand("workbench.view.extension.stackcode"); } - async updateProjectStats() { - if (!this._view) { - console.log('[StackCode] No view available for stats update'); - return; - } - const workspaceFolders = vscode.workspace.workspaceFolders; - console.log('[StackCode] Workspace folders:', workspaceFolders?.length || 0); - console.log('[StackCode] Workspace name:', vscode.workspace.name); - console.log('[StackCode] Workspace file:', vscode.workspace.workspaceFile?.toString()); - if (!workspaceFolders || workspaceFolders.length === 0) { - console.log('[StackCode] No workspace folders found, using alternative detection'); - // Fallback: usar informações do contexto da extensão - const extensionWorkspace = path.dirname(path.dirname(path.dirname(this._extensionUri.fsPath))); - console.log('[StackCode] Extension workspace path:', extensionWorkspace); - this.sendMessage({ - type: 'updateStats', - payload: { - files: 0, - workspaceName: 'StackCode (Debug)', - workspacePath: extensionWorkspace, - mode: 'development' - } - }); - return; - } - try { - const files = await vscode.workspace.findFiles('**/*', '**/node_modules/**', 1000); - console.log('[StackCode] Found files:', files.length); - this.sendMessage({ - type: 'updateStats', - payload: { - files: files.length, - workspaceName: workspaceFolders[0].name, - workspacePath: workspaceFolders[0].uri.fsPath, - mode: 'production' - }, - }); - } - catch (e) { - console.error("[StackCode] Error fetching project stats:", e); - this.sendMessage({ - type: 'updateStats', - payload: { files: 0, error: 'Failed to scan files' } - }); - } + } + async updateProjectStats() { + if (!this._view) { + console.log("[StackCode] No view available for stats update"); + return; } - _getHtmlForWebview(webview) { - const nonce = getNonce(); - const buildPath = vscode.Uri.joinPath(this._extensionUri, 'dist', 'webview-ui'); - // Lê o manifest.json do Vite - const manifestPath = path.join(buildPath.fsPath, '.vite', 'manifest.json'); - console.log('[StackCode] Build path:', buildPath.fsPath); - console.log('[StackCode] Manifest path:', manifestPath); - console.log('[StackCode] Manifest exists:', fs.existsSync(manifestPath)); - try { - const manifestContent = fs.readFileSync(manifestPath, 'utf-8'); - const manifest = JSON.parse(manifestContent); - console.log('[StackCode] Manifest content:', manifest); - // Pega os arquivos do manifest do Vite - const indexEntry = manifest['index.html']; - const scriptFile = indexEntry.file; - const cssFiles = indexEntry.css || []; - const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(buildPath, scriptFile)); - const cssUris = cssFiles.map((cssFile) => webview.asWebviewUri(vscode.Uri.joinPath(buildPath, cssFile))); - console.log('[StackCode] Script URI:', scriptUri.toString()); - console.log('[StackCode] CSS URIs:', cssUris.map((uri) => uri.toString())); - return ` + const workspaceFolders = vscode.workspace.workspaceFolders; + console.log( + "[StackCode] Workspace folders:", + workspaceFolders?.length || 0, + ); + console.log("[StackCode] Workspace name:", vscode.workspace.name); + console.log( + "[StackCode] Workspace file:", + vscode.workspace.workspaceFile?.toString(), + ); + if (!workspaceFolders || workspaceFolders.length === 0) { + console.log( + "[StackCode] No workspace folders found, using alternative detection", + ); + // Fallback: usar informações do contexto da extensão + const extensionWorkspace = path.dirname( + path.dirname(path.dirname(this._extensionUri.fsPath)), + ); + console.log("[StackCode] Extension workspace path:", extensionWorkspace); + this.sendMessage({ + type: "updateStats", + payload: { + files: 0, + workspaceName: "StackCode (Debug)", + workspacePath: extensionWorkspace, + mode: "development", + }, + }); + return; + } + try { + const files = await vscode.workspace.findFiles( + "**/*", + "**/node_modules/**", + 1000, + ); + console.log("[StackCode] Found files:", files.length); + this.sendMessage({ + type: "updateStats", + payload: { + files: files.length, + workspaceName: workspaceFolders[0].name, + workspacePath: workspaceFolders[0].uri.fsPath, + mode: "production", + }, + }); + } catch (e) { + console.error("[StackCode] Error fetching project stats:", e); + this.sendMessage({ + type: "updateStats", + payload: { files: 0, error: "Failed to scan files" }, + }); + } + } + _getHtmlForWebview(webview) { + const nonce = getNonce(); + const buildPath = vscode.Uri.joinPath( + this._extensionUri, + "dist", + "webview-ui", + ); + // Lê o manifest.json do Vite + const manifestPath = path.join(buildPath.fsPath, ".vite", "manifest.json"); + console.log("[StackCode] Build path:", buildPath.fsPath); + console.log("[StackCode] Manifest path:", manifestPath); + console.log("[StackCode] Manifest exists:", fs.existsSync(manifestPath)); + try { + const manifestContent = fs.readFileSync(manifestPath, "utf-8"); + const manifest = JSON.parse(manifestContent); + console.log("[StackCode] Manifest content:", manifest); + // Pega os arquivos do manifest do Vite + const indexEntry = manifest["index.html"]; + const scriptFile = indexEntry.file; + const cssFiles = indexEntry.css || []; + const scriptUri = webview.asWebviewUri( + vscode.Uri.joinPath(buildPath, scriptFile), + ); + const cssUris = cssFiles.map((cssFile) => + webview.asWebviewUri(vscode.Uri.joinPath(buildPath, cssFile)), + ); + console.log("[StackCode] Script URI:", scriptUri.toString()); + console.log( + "[StackCode] CSS URIs:", + cssUris.map((uri) => uri.toString()), + ); + return ` - ${cssUris.map((uri) => ``).join('\n ')} + ${cssUris.map((uri) => ``).join("\n ")} StackCode Dashboard @@ -190,11 +247,10 @@ class DashboardProvider { `; - } - catch (error) { - console.error("[StackCode] Error reading manifest:", error); - // Fallback melhorado para desenvolvimento - return ` + } catch (error) { + console.error("[StackCode] Error reading manifest:", error); + // Fallback melhorado para desenvolvimento + return ` @@ -240,33 +296,34 @@ class DashboardProvider {

Execute: npm run build:ui

- Erro: ${error instanceof Error ? error.message : 'Manifest não encontrado'} + Erro: ${error instanceof Error ? error.message : "Manifest não encontrado"}

Status da extensão: ✅ Ativa

-

Workspace: ${vscode.workspace.workspaceFolders?.[0]?.name || 'Nenhum'}

+

Workspace: ${vscode.workspace.workspaceFolders?.[0]?.name || "Nenhum"}

`; - } } - // CORREÇÃO: Adicionando o método dispose para conformidade. - dispose() { - while (this._disposables.length) { - const x = this._disposables.pop(); - if (x) { - x.dispose(); - } - } + } + // CORREÇÃO: Adicionando o método dispose para conformidade. + dispose() { + while (this._disposables.length) { + const x = this._disposables.pop(); + if (x) { + x.dispose(); + } } + } } exports.DashboardProvider = DashboardProvider; DashboardProvider.viewType = "stackcode.dashboard"; function getNonce() { - let text = ''; - const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - for (let i = 0; i < 32; i++) { - text += possible.charAt(Math.floor(Math.random() * possible.length)); - } - return text; + let text = ""; + const possible = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + for (let i = 0; i < 32; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } + return text; } -//# sourceMappingURL=DashboardProvider.js.map \ No newline at end of file +//# sourceMappingURL=DashboardProvider.js.map diff --git a/packages/vscode-extension/out/providers/DashboardProvider.js.map b/packages/vscode-extension/out/providers/DashboardProvider.js.map index f364f746..f7ba9fec 100644 --- a/packages/vscode-extension/out/providers/DashboardProvider.js.map +++ b/packages/vscode-extension/out/providers/DashboardProvider.js.map @@ -1 +1 @@ -{"version":3,"file":"DashboardProvider.js","sourceRoot":"","sources":["../../src/providers/DashboardProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,2CAA6B;AAC7B,uCAAyB;AAEzB,MAAa,iBAAiB;IAM1B,YAAY,OAAgC;QAFpC,iBAAY,GAAwB,EAAE,CAAC;QAG3C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAC9C,CAAC;IAEM,kBAAkB,CACrB,WAA+B;IAC/B,6DAA6D;IAC7D,OAAyC;IACzC,+DAA+D;IAC/D,KAA+B;QA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AAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;QACzB,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;KACxE;IACD,OAAO,IAAI,CAAC;AAChB,CAAC"} \ No newline at end of file +{"version":3,"file":"DashboardProvider.js","sourceRoot":"","sources":["../../src/providers/DashboardProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,2CAA6B;AAC7B,uCAAyB;AAEzB,MAAa,iBAAiB;IAQ5B,YAAY,OAAgC;QAFpC,iBAAY,GAAwB,EAAE,CAAC;QAG7C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAC5C,CAAC;IAEM,kBAAkB,CACvB,WAA+B;IAC/B,6DAA6D;IAC7D,OAAyC;IACzC,6DAA6D;IAC7D,KAA+B;QAE/B,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC;QAEzB,WAAW,CAAC,OAAO,CAAC,OAAO,GAAG;YAC5B,aAAa,EAAE,IAAI;YACnB,kBAAkB,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;SACtE,CAAC;QAEF,WAAW,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAExE,WAAW,CAAC,OAAO,CAAC,mBAAmB,CACrC,KAAK,EAAE,IAAyC,EAAE,EAAE;YAClD,OAAO,CAAC,GAAG,CAAC,8CAA8C,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YAEvE,IAAI;gBACF,yCAAyC;gBACzC,QAAQ,IAAI,CAAC,IAAI,EAAE;oBACjB,KAAK,cAAc;wBACjB,OAAO,CAAC,GAAG,CACT,0DAA0D,CAC3D,CAAC;wBAC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AAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB;;;wBAG9D,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,QAAQ;;;QAGxE,CAAC;SACJ;IACH,CAAC;IAED,4DAA4D;IACrD,OAAO;QACZ,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;YAC/B,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;YAClC,IAAI,CAAC,EAAE;gBACL,CAAC,CAAC,OAAO,EAAE,CAAC;aACb;SACF;IACH,CAAC;;AAzSH,8CA0SC;AAvSwB,0BAAQ,GAAG,qBAAqB,CAAC;AAyS1D,SAAS,QAAQ;IACf,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,MAAM,QAAQ,GACZ,gEAAgE,CAAC;IACnE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;QAC3B,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;KACtE;IACD,OAAO,IAAI,CAAC;AACd,CAAC"} \ No newline at end of file diff --git a/packages/vscode-extension/out/providers/ProjectViewProvider.js b/packages/vscode-extension/out/providers/ProjectViewProvider.js index da64a272..73617dff 100644 --- a/packages/vscode-extension/out/providers/ProjectViewProvider.js +++ b/packages/vscode-extension/out/providers/ProjectViewProvider.js @@ -1,307 +1,331 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ProjectViewProvider = void 0; const vscode = __importStar(require("vscode")); class ProjectViewProvider { - constructor(workspaceState) { - this.workspaceState = workspaceState; - this._onDidChangeTreeData = new vscode.EventEmitter(); - this.onDidChangeTreeData = this._onDidChangeTreeData.event; - } - refresh() { - this._onDidChangeTreeData.fire(); - } - getTreeItem(element) { - const item = new vscode.TreeItem(element.label, element.collapsibleState); - // Enhanced icons and styling - const iconMap = { - "StackCode Project": "rocket", - "Quick Actions": "zap", - "Initialize Project": "folder-opened", - "Generate README": "book", - "Generate .gitignore": "git-branch", - "Validate Project": "check", - "Git Workflow": "git-commit", - "Start Feature": "git-branch", - "Create Hotfix": "flame", - "Make Release": "package", - "Commit Changes": "git-commit", - "Project Tools": "tools", - Configuration: "gear", - "Show Dashboard": "dashboard", - "View Project Stats": "graph", - "Help & Documentation": "question", + constructor(workspaceState) { + this.workspaceState = workspaceState; + this._onDidChangeTreeData = new vscode.EventEmitter(); + this.onDidChangeTreeData = this._onDidChangeTreeData.event; + } + refresh() { + this._onDidChangeTreeData.fire(); + } + getTreeItem(element) { + const item = new vscode.TreeItem(element.label, element.collapsibleState); + // Enhanced icons and styling + const iconMap = { + "StackCode Project": "rocket", + "Quick Actions": "zap", + "Initialize Project": "folder-opened", + "Generate README": "book", + "Generate .gitignore": "git-branch", + "Validate Project": "check", + "Git Workflow": "git-commit", + "Start Feature": "git-branch", + "Create Hotfix": "flame", + "Make Release": "package", + "Commit Changes": "git-commit", + "Project Tools": "tools", + Configuration: "gear", + "Show Dashboard": "dashboard", + "View Project Stats": "graph", + "Help & Documentation": "question", + }; + // Set icons with theme support + item.iconPath = new vscode.ThemeIcon( + iconMap[element.label] || "circle-filled", + ); + // Add commands for interactive items + if (element.command) { + // Handle both string and Command object types + if (typeof element.command === "string") { + item.command = { + command: element.command, + title: element.label, }; - // Set icons with theme support - item.iconPath = new vscode.ThemeIcon(iconMap[element.label] || "circle-filled"); - // Add commands for interactive items - if (element.command) { - // Handle both string and Command object types - if (typeof element.command === "string") { - item.command = { - command: element.command, - title: element.label, - }; - } - else { - item.command = element.command; - } - // Add hover descriptions - const tooltips = { - "Initialize Project": "Create a new project with StackCode scaffolding", - "Generate README": "Generate a comprehensive README.md file", - "Generate .gitignore": "Generate .gitignore based on project type", - "Validate Project": "Check project structure and best practices", - "Start Feature": "Begin a new feature using GitFlow", - "Create Hotfix": "Create a hotfix branch for urgent fixes", - "Make Release": "Create a new release with automated versioning", - "Commit Changes": "Make a conventional commit with validation", - Configuration: "Configure StackCode settings", - "Show Dashboard": "Open the interactive StackCode dashboard", - "View Project Stats": "See detailed project statistics", - "Help & Documentation": "Access StackCode documentation", - }; - item.tooltip = tooltips[element.label] || element.label; - } - // Style for different types - if (element.children && element.children.length > 0) { - item.contextValue = "stackcode-category"; - } - else if (element.command) { - item.contextValue = "stackcode-action"; - } - return item; + } else { + item.command = element.command; + } + // Add hover descriptions + const tooltips = { + "Initialize Project": "Create a new project with StackCode scaffolding", + "Generate README": "Generate a comprehensive README.md file", + "Generate .gitignore": "Generate .gitignore based on project type", + "Validate Project": "Check project structure and best practices", + "Start Feature": "Begin a new feature using GitFlow", + "Create Hotfix": "Create a hotfix branch for urgent fixes", + "Make Release": "Create a new release with automated versioning", + "Commit Changes": "Make a conventional commit with validation", + Configuration: "Configure StackCode settings", + "Show Dashboard": "Open the interactive StackCode dashboard", + "View Project Stats": "See detailed project statistics", + "Help & Documentation": "Access StackCode documentation", + }; + item.tooltip = tooltips[element.label] || element.label; + } + // Style for different types + if (element.children && element.children.length > 0) { + item.contextValue = "stackcode-category"; + } else if (element.command) { + item.contextValue = "stackcode-action"; } - getChildren(element) { - if (!element) { - // Root level - show main categories with enhanced structure - return Promise.resolve([ + return item; + } + getChildren(element) { + if (!element) { + // Root level - show main categories with enhanced structure + return Promise.resolve([ + { + label: "StackCode Project", + icon: "rocket", + collapsibleState: vscode.TreeItemCollapsibleState.Expanded, + children: [ + { + label: "Quick Actions", + icon: "zap", + collapsibleState: vscode.TreeItemCollapsibleState.Expanded, + children: [ { - label: "StackCode Project", - icon: "rocket", - collapsibleState: vscode.TreeItemCollapsibleState.Expanded, - children: [ - { - label: "Quick Actions", - icon: "zap", - collapsibleState: vscode.TreeItemCollapsibleState.Expanded, - children: [ - { - label: "Initialize Project", - icon: "folder-opened", - collapsibleState: vscode.TreeItemCollapsibleState.None, - command: { - command: "stackcode.init", - title: "Initialize Project", - }, - }, - { - label: "Generate README", - icon: "book", - collapsibleState: vscode.TreeItemCollapsibleState.None, - command: { - command: "stackcode.generate.readme", - title: "Generate README", - }, - }, - { - label: "Generate .gitignore", - icon: "git-branch", - collapsibleState: vscode.TreeItemCollapsibleState.None, - command: { - command: "stackcode.generate.gitignore", - title: "Generate .gitignore", - }, - }, - { - label: "Validate Project", - icon: "check", - collapsibleState: vscode.TreeItemCollapsibleState.None, - command: { - command: "stackcode.validate", - title: "Validate Project", - }, - }, - ], - }, - { - label: "Git Workflow", - icon: "git-commit", - collapsibleState: vscode.TreeItemCollapsibleState.Expanded, - children: [ - { - label: "Start Feature", - icon: "git-branch", - collapsibleState: vscode.TreeItemCollapsibleState.None, - command: { - command: "stackcode.git.feature.start", - title: "Start Feature", - }, - }, - { - label: "Create Hotfix", - icon: "flame", - collapsibleState: vscode.TreeItemCollapsibleState.None, - command: { - command: "stackcode.git.hotfix.start", - title: "Create Hotfix", - }, - }, - { - label: "Make Release", - icon: "package", - collapsibleState: vscode.TreeItemCollapsibleState.None, - command: { - command: "stackcode.release", - title: "Make Release", - }, - }, - { - label: "Commit Changes", - icon: "git-commit", - collapsibleState: vscode.TreeItemCollapsibleState.None, - command: { - command: "stackcode.commit", - title: "Commit Changes", - }, - }, - ], - }, - { - label: "Project Tools", - icon: "tools", - collapsibleState: vscode.TreeItemCollapsibleState.Collapsed, - children: [ - { - label: "Configuration", - icon: "gear", - collapsibleState: vscode.TreeItemCollapsibleState.None, - command: { - command: "stackcode.config", - title: "Configuration", - }, - }, - { - label: "Show Dashboard", - icon: "dashboard", - collapsibleState: vscode.TreeItemCollapsibleState.None, - command: { - command: "stackcode.dashboard.show", - title: "Show Dashboard", - }, - }, - { - label: "View Project Stats", - icon: "graph", - collapsibleState: vscode.TreeItemCollapsibleState.None, - command: { - command: "stackcode.stats.show", - title: "View Project Stats", - }, - }, - { - label: "Help & Documentation", - icon: "question", - collapsibleState: vscode.TreeItemCollapsibleState.None, - command: { - command: "stackcode.help", - title: "Help & Documentation", - }, - }, - ], - }, - ], + label: "Initialize Project", + icon: "folder-opened", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.init", + title: "Initialize Project", + }, }, - ]); - } - else { - return Promise.resolve(element.children || []); - } - } - async getProjectInfo() { - const items = []; - const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; - if (!workspaceFolder) { - return [ { - label: "No workspace", - description: "Open a folder to see project info", - icon: "folder-opened", + label: "Generate README", + icon: "book", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.generate.readme", + title: "Generate README", + }, }, - ]; - } - // Project name - items.push({ - label: workspaceFolder.name, - description: "Project root", - icon: "folder", - }); - // Git status - try { - const gitExtension = vscode.extensions.getExtension("vscode.git"); - if (gitExtension && gitExtension.isActive) { - const git = gitExtension.exports; - const api = git.getAPI(1); - const repo = api.repositories[0]; - if (repo && repo.state.HEAD) { - items.push({ - label: `Branch: ${repo.state.HEAD.name}`, - description: `${repo.state.workingTreeChanges.length} changes`, - icon: "git-branch", - }); - } - } - } - catch { - // Git not available - } - // Quick actions - items.push({ - label: "Initialize Project", - description: "Set up StackCode project", - icon: "play", - command: "stackcode.init", - }, { - label: "Generate Files", - description: "Create README, .gitignore, etc.", - icon: "file-add", - command: "stackcode.generate.readme", - }, { - label: "Start Branch", - description: "Create new feature branch", + { + label: "Generate .gitignore", + icon: "git-branch", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.generate.gitignore", + title: "Generate .gitignore", + }, + }, + { + label: "Validate Project", + icon: "check", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.validate", + title: "Validate Project", + }, + }, + ], + }, + { + label: "Git Workflow", + icon: "git-commit", + collapsibleState: vscode.TreeItemCollapsibleState.Expanded, + children: [ + { + label: "Start Feature", + icon: "git-branch", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.git.feature.start", + title: "Start Feature", + }, + }, + { + label: "Create Hotfix", + icon: "flame", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.git.hotfix.start", + title: "Create Hotfix", + }, + }, + { + label: "Make Release", + icon: "package", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.release", + title: "Make Release", + }, + }, + { + label: "Commit Changes", + icon: "git-commit", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.commit", + title: "Commit Changes", + }, + }, + ], + }, + { + label: "Project Tools", + icon: "tools", + collapsibleState: vscode.TreeItemCollapsibleState.Collapsed, + children: [ + { + label: "Configuration", + icon: "gear", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.config", + title: "Configuration", + }, + }, + { + label: "Show Dashboard", + icon: "dashboard", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.dashboard.show", + title: "Show Dashboard", + }, + }, + { + label: "View Project Stats", + icon: "graph", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.stats.show", + title: "View Project Stats", + }, + }, + { + label: "Help & Documentation", + icon: "question", + collapsibleState: vscode.TreeItemCollapsibleState.None, + command: { + command: "stackcode.help", + title: "Help & Documentation", + }, + }, + ], + }, + ], + }, + ]); + } else { + return Promise.resolve(element.children || []); + } + } + async getProjectInfo() { + const items = []; + const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; + if (!workspaceFolder) { + return [ + { + label: "No workspace", + description: "Open a folder to see project info", + icon: "folder-opened", + }, + ]; + } + // Project name + items.push({ + label: workspaceFolder.name, + description: "Project root", + icon: "folder", + }); + // Git status + try { + const gitExtension = vscode.extensions.getExtension("vscode.git"); + if (gitExtension && gitExtension.isActive) { + const git = gitExtension.exports; + const api = git.getAPI(1); + const repo = api.repositories[0]; + if (repo && repo.state.HEAD) { + items.push({ + label: `Branch: ${repo.state.HEAD.name}`, + description: `${repo.state.workingTreeChanges.length} changes`, icon: "git-branch", - command: "stackcode.git.start", - }, { - label: "Create Commit", - description: "Make conventional commit", - icon: "git-commit", - command: "stackcode.commit", - }); - return items; + }); + } + } + } catch { + // Git not available } + // Quick actions + items.push( + { + label: "Initialize Project", + description: "Set up StackCode project", + icon: "play", + command: "stackcode.init", + }, + { + label: "Generate Files", + description: "Create README, .gitignore, etc.", + icon: "file-add", + command: "stackcode.generate.readme", + }, + { + label: "Start Branch", + description: "Create new feature branch", + icon: "git-branch", + command: "stackcode.git.start", + }, + { + label: "Create Commit", + description: "Make conventional commit", + icon: "git-commit", + command: "stackcode.commit", + }, + ); + return items; + } } exports.ProjectViewProvider = ProjectViewProvider; -//# sourceMappingURL=ProjectViewProvider.js.map \ No newline at end of file +//# sourceMappingURL=ProjectViewProvider.js.map diff --git a/packages/vscode-extension/out/test/__mocks__/vscode.js b/packages/vscode-extension/out/test/__mocks__/vscode.js index 90a9daef..d666f80f 100644 --- a/packages/vscode-extension/out/test/__mocks__/vscode.js +++ b/packages/vscode-extension/out/test/__mocks__/vscode.js @@ -1,58 +1,66 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.ConfigurationTarget = exports.StatusBarAlignment = exports.extensions = exports.commands = exports.workspace = exports.window = void 0; +exports.ConfigurationTarget = + exports.StatusBarAlignment = + exports.extensions = + exports.commands = + exports.workspace = + exports.window = + void 0; const mockConfiguration = { - get: jest.fn((key, defaultValue) => { - const configs = { - "notifications.enabled": true, - "notifications.branchCheck": true, - "notifications.commitCheck": true, - "autoGenerate.readme": false, - "autoGenerate.gitignore": true, - "git.defaultBranchType": "feature", - "dashboard.autoOpen": false, - }; - return configs[key] !== undefined ? configs[key] : defaultValue; - }), - update: jest.fn(), + get: jest.fn((key, defaultValue) => { + const configs = { + "notifications.enabled": true, + "notifications.branchCheck": true, + "notifications.commitCheck": true, + "autoGenerate.readme": false, + "autoGenerate.gitignore": true, + "git.defaultBranchType": "feature", + "dashboard.autoOpen": false, + }; + return configs[key] !== undefined ? configs[key] : defaultValue; + }), + update: jest.fn(), }; exports.window = { - showInformationMessage: jest.fn(), - showWarningMessage: jest.fn(), - showErrorMessage: jest.fn(), - createStatusBarItem: jest.fn(() => ({ - show: jest.fn(), - hide: jest.fn(), - dispose: jest.fn(), - })), + showInformationMessage: jest.fn(), + showWarningMessage: jest.fn(), + showErrorMessage: jest.fn(), + createStatusBarItem: jest.fn(() => ({ + show: jest.fn(), + hide: jest.fn(), + dispose: jest.fn(), + })), }; exports.workspace = { - getConfiguration: jest.fn(() => mockConfiguration), - workspaceFolders: [], - onDidChangeConfiguration: jest.fn(), + getConfiguration: jest.fn(() => mockConfiguration), + workspaceFolders: [], + onDidChangeConfiguration: jest.fn(), }; exports.commands = { - registerCommand: jest.fn(), - executeCommand: jest.fn(), - getCommands: jest.fn(() => Promise.resolve([ - "stackcode.init", - "stackcode.generate.readme", - "stackcode.git.start", - ])), + registerCommand: jest.fn(), + executeCommand: jest.fn(), + getCommands: jest.fn(() => + Promise.resolve([ + "stackcode.init", + "stackcode.generate.readme", + "stackcode.git.start", + ]), + ), }; exports.extensions = { - getExtension: jest.fn(() => ({ - activate: jest.fn(() => Promise.resolve()), - isActive: true, - })), + getExtension: jest.fn(() => ({ + activate: jest.fn(() => Promise.resolve()), + isActive: true, + })), }; exports.StatusBarAlignment = { - Left: 1, - Right: 2, + Left: 1, + Right: 2, }; exports.ConfigurationTarget = { - Global: 1, - Workspace: 2, - WorkspaceFolder: 3, + Global: 1, + Workspace: 2, + WorkspaceFolder: 3, }; -//# sourceMappingURL=vscode.js.map \ No newline at end of file +//# sourceMappingURL=vscode.js.map diff --git a/packages/vscode-extension/out/types.js b/packages/vscode-extension/out/types.js index 11e638d1..270a1e8f 100644 --- a/packages/vscode-extension/out/types.js +++ b/packages/vscode-extension/out/types.js @@ -1,3 +1,3 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file +//# sourceMappingURL=types.js.map diff --git a/packages/vscode-extension/src/extension.ts b/packages/vscode-extension/src/extension.ts index a6cffaec..004baf39 100644 --- a/packages/vscode-extension/src/extension.ts +++ b/packages/vscode-extension/src/extension.ts @@ -31,7 +31,10 @@ let configCommand: ConfigCommand; export function activate(context: vscode.ExtensionContext) { console.log("[StackCode] Extension is now active!"); - console.log("[StackCode] Workspace folders:", vscode.workspace.workspaceFolders?.length || 0); + console.log( + "[StackCode] Workspace folders:", + vscode.workspace.workspaceFolders?.length || 0, + ); console.log("[StackCode] Extension path:", context.extensionPath); // Initialize configuration manager @@ -130,8 +133,9 @@ export function activate(context: vscode.ExtensionContext) { vscode.commands.registerCommand("stackcode.webview.generate.readme", () => generateCommand.generateReadme(), ), - vscode.commands.registerCommand("stackcode.webview.generate.gitignore", () => - generateCommand.generateGitignore(), + vscode.commands.registerCommand( + "stackcode.webview.generate.gitignore", + () => generateCommand.generateGitignore(), ), vscode.commands.registerCommand("stackcode.webview.git.start", () => gitCommand.startBranch(), diff --git a/packages/vscode-extension/src/providers/DashboardProvider.backup.ts b/packages/vscode-extension/src/providers/DashboardProvider.backup.ts index 7dae5723..039f3635 100644 --- a/packages/vscode-extension/src/providers/DashboardProvider.backup.ts +++ b/packages/vscode-extension/src/providers/DashboardProvider.backup.ts @@ -2,171 +2,204 @@ import * as vscode from "vscode"; import * as path from "path"; import * as fs from "fs"; -export class DashboardProvider implements vscode.WebviewViewProvider, vscode.Disposable { - public static readonly viewType = "stackcode.dashboard"; - private _view?: vscode.WebviewView; - private readonly _extensionUri: vscode.Uri; - private _disposables: vscode.Disposable[] = []; +export class DashboardProvider + implements vscode.WebviewViewProvider, vscode.Disposable +{ + public static readonly viewType = "stackcode.dashboard"; + private _view?: vscode.WebviewView; + private readonly _extensionUri: vscode.Uri; + private _disposables: vscode.Disposable[] = []; - constructor(context: vscode.ExtensionContext) { - this._extensionUri = context.extensionUri; - } + constructor(context: vscode.ExtensionContext) { + this._extensionUri = context.extensionUri; + } - public resolveWebviewView( - webviewView: vscode.WebviewView, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - context: vscode.WebviewViewResolveContext, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - token: vscode.CancellationToken, - ) { - this._view = webviewView; + public resolveWebviewView( + webviewView: vscode.WebviewView, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + context: vscode.WebviewViewResolveContext, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + token: vscode.CancellationToken, + ) { + this._view = webviewView; - webviewView.webview.options = { - enableScripts: true, - localResourceRoots: [vscode.Uri.joinPath(this._extensionUri, 'dist')], - }; + webviewView.webview.options = { + enableScripts: true, + localResourceRoots: [vscode.Uri.joinPath(this._extensionUri, "dist")], + }; - webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); + webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); - webviewView.webview.onDidReceiveMessage( - async (data: { type: string; payload?: unknown }) => { - console.log(`[StackCode] Received command from webview: ${data.type}`); - - try { - // Tratar comandos específicos do webview - switch (data.type) { - case 'webviewReady': - console.log('[StackCode] Webview reported ready, sending initial data'); - this.updateProjectStats(); - return; - - case 'refreshStats': - this.updateProjectStats(); - return; - - default: - // Executar comando normal do VS Code - await vscode.commands.executeCommand(data.type, data.payload); - } - } catch (error) { - console.error(`[StackCode] Error executing command ${data.type}:`, error); - this.sendMessage({ - type: 'commandError', - payload: { command: data.type, error: error instanceof Error ? error.message : 'Unknown error' } - }); - } + webviewView.webview.onDidReceiveMessage( + async (data: { type: string; payload?: unknown }) => { + console.log(`[StackCode] Received command from webview: ${data.type}`); + + try { + // Tratar comandos específicos do webview + switch (data.type) { + case "webviewReady": + console.log( + "[StackCode] Webview reported ready, sending initial data", + ); + this.updateProjectStats(); + return; + + case "refreshStats": + this.updateProjectStats(); + return; + + default: + // Executar comando normal do VS Code + await vscode.commands.executeCommand(data.type, data.payload); + } + } catch (error) { + console.error( + `[StackCode] Error executing command ${data.type}:`, + error, + ); + this.sendMessage({ + type: "commandError", + payload: { + command: data.type, + error: error instanceof Error ? error.message : "Unknown error", }, - undefined, - this._disposables - ); + }); + } + }, + undefined, + this._disposables, + ); - // WebviewView doesn't have onDidBecomeVisible, so we'll update stats immediately - this.updateProjectStats(); + // WebviewView doesn't have onDidBecomeVisible, so we'll update stats immediately + this.updateProjectStats(); + } + + public sendMessage(message: { type: string; payload?: unknown }) { + if (this._view) { + this._view.webview.postMessage(message); } + } - public sendMessage(message: { type: string; payload?: unknown }) { - if (this._view) { - this._view.webview.postMessage(message); - } + public show() { + if (this._view) { + this._view.show?.(true); + } else { + // If view is not created yet, trigger the creation by executing the show command + vscode.commands.executeCommand("workbench.view.extension.stackcode"); } + } - public show() { - if (this._view) { - this._view.show?.(true); - } else { - // If view is not created yet, trigger the creation by executing the show command - vscode.commands.executeCommand('workbench.view.extension.stackcode'); - } + private async updateProjectStats() { + if (!this._view) { + console.log("[StackCode] No view available for stats update"); + return; } - private async updateProjectStats() { - if (!this._view) { - console.log('[StackCode] No view available for stats update'); - return; - } + const workspaceFolders = vscode.workspace.workspaceFolders; + console.log( + "[StackCode] Workspace folders:", + workspaceFolders?.length || 0, + ); + console.log("[StackCode] Workspace name:", vscode.workspace.name); + console.log( + "[StackCode] Workspace file:", + vscode.workspace.workspaceFile?.toString(), + ); - const workspaceFolders = vscode.workspace.workspaceFolders; - console.log('[StackCode] Workspace folders:', workspaceFolders?.length || 0); - console.log('[StackCode] Workspace name:', vscode.workspace.name); - console.log('[StackCode] Workspace file:', vscode.workspace.workspaceFile?.toString()); - - if (!workspaceFolders || workspaceFolders.length === 0) { - console.log('[StackCode] No workspace folders found, using alternative detection'); - - // Fallback: usar informações do contexto da extensão - const extensionWorkspace = path.dirname(path.dirname(path.dirname(this._extensionUri.fsPath))); - console.log('[StackCode] Extension workspace path:', extensionWorkspace); - - this.sendMessage({ - type: 'updateStats', - payload: { - files: 0, - workspaceName: 'StackCode (Debug)', - workspacePath: extensionWorkspace, - mode: 'development' - } - }); - return; - } + if (!workspaceFolders || workspaceFolders.length === 0) { + console.log( + "[StackCode] No workspace folders found, using alternative detection", + ); - try { - const files = await vscode.workspace.findFiles('**/*', '**/node_modules/**', 1000); - console.log('[StackCode] Found files:', files.length); - - this.sendMessage({ - type: 'updateStats', - payload: { - files: files.length, - workspaceName: workspaceFolders[0].name, - workspacePath: workspaceFolders[0].uri.fsPath, - mode: 'production' - }, - }); - } catch (e) { - console.error("[StackCode] Error fetching project stats:", e); - this.sendMessage({ - type: 'updateStats', - payload: { files: 0, error: 'Failed to scan files' } - }); - } + // Fallback: usar informações do contexto da extensão + const extensionWorkspace = path.dirname( + path.dirname(path.dirname(this._extensionUri.fsPath)), + ); + console.log("[StackCode] Extension workspace path:", extensionWorkspace); + + this.sendMessage({ + type: "updateStats", + payload: { + files: 0, + workspaceName: "StackCode (Debug)", + workspacePath: extensionWorkspace, + mode: "development", + }, + }); + return; } - private _getHtmlForWebview(webview: vscode.Webview): string { - const nonce = getNonce(); - const buildPath = vscode.Uri.joinPath(this._extensionUri, 'dist', 'webview-ui'); - - // Lê o manifest.json do Vite - const manifestPath = path.join(buildPath.fsPath, '.vite', 'manifest.json'); - - console.log('[StackCode] Build path:', buildPath.fsPath); - console.log('[StackCode] Manifest path:', manifestPath); - console.log('[StackCode] Manifest exists:', fs.existsSync(manifestPath)); - - try { - const manifestContent = fs.readFileSync(manifestPath, 'utf-8'); - const manifest = JSON.parse(manifestContent); - console.log('[StackCode] Manifest content:', manifest); + try { + const files = await vscode.workspace.findFiles( + "**/*", + "**/node_modules/**", + 1000, + ); + console.log("[StackCode] Found files:", files.length); + + this.sendMessage({ + type: "updateStats", + payload: { + files: files.length, + workspaceName: workspaceFolders[0].name, + workspacePath: workspaceFolders[0].uri.fsPath, + mode: "production", + }, + }); + } catch (e) { + console.error("[StackCode] Error fetching project stats:", e); + this.sendMessage({ + type: "updateStats", + payload: { files: 0, error: "Failed to scan files" }, + }); + } + } + + private _getHtmlForWebview(webview: vscode.Webview): string { + const nonce = getNonce(); + const buildPath = vscode.Uri.joinPath( + this._extensionUri, + "dist", + "webview-ui", + ); - // Pega os arquivos do manifest do Vite - const indexEntry = manifest['index.html']; - const scriptFile = indexEntry.file; - const cssFiles = indexEntry.css || []; + // Lê o manifest.json do Vite + const manifestPath = path.join(buildPath.fsPath, ".vite", "manifest.json"); - const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(buildPath, scriptFile)); - const cssUris = cssFiles.map((cssFile: string) => - webview.asWebviewUri(vscode.Uri.joinPath(buildPath, cssFile)) - ); + console.log("[StackCode] Build path:", buildPath.fsPath); + console.log("[StackCode] Manifest path:", manifestPath); + console.log("[StackCode] Manifest exists:", fs.existsSync(manifestPath)); - console.log('[StackCode] Script URI:', scriptUri.toString()); - console.log('[StackCode] CSS URIs:', cssUris.map((uri: vscode.Uri) => uri.toString())); + try { + const manifestContent = fs.readFileSync(manifestPath, "utf-8"); + const manifest = JSON.parse(manifestContent); + console.log("[StackCode] Manifest content:", manifest); - return ` + // Pega os arquivos do manifest do Vite + const indexEntry = manifest["index.html"]; + const scriptFile = indexEntry.file; + const cssFiles = indexEntry.css || []; + + const scriptUri = webview.asWebviewUri( + vscode.Uri.joinPath(buildPath, scriptFile), + ); + const cssUris = cssFiles.map((cssFile: string) => + webview.asWebviewUri(vscode.Uri.joinPath(buildPath, cssFile)), + ); + + console.log("[StackCode] Script URI:", scriptUri.toString()); + console.log( + "[StackCode] CSS URIs:", + cssUris.map((uri: vscode.Uri) => uri.toString()), + ); + + return ` - ${cssUris.map((uri: vscode.Uri) => ``).join('\n ')} + ${cssUris.map((uri: vscode.Uri) => ``).join("\n ")} StackCode Dashboard @@ -199,10 +232,10 @@ export class DashboardProvider implements vscode.WebviewViewProvider, vscode.Dis `; - } catch (error) { - console.error("[StackCode] Error reading manifest:", error); - // Fallback melhorado para desenvolvimento - return ` + } catch (error) { + console.error("[StackCode] Error reading manifest:", error); + // Fallback melhorado para desenvolvimento + return ` @@ -248,32 +281,33 @@ export class DashboardProvider implements vscode.WebviewViewProvider, vscode.Dis

Execute: npm run build:ui

- Erro: ${error instanceof Error ? error.message : 'Manifest não encontrado'} + Erro: ${error instanceof Error ? error.message : "Manifest não encontrado"}

Status da extensão: ✅ Ativa

-

Workspace: ${vscode.workspace.workspaceFolders?.[0]?.name || 'Nenhum'}

+

Workspace: ${vscode.workspace.workspaceFolders?.[0]?.name || "Nenhum"}

`; - } } + } - // CORREÇÃO: Adicionando o método dispose para conformidade. - public dispose() { - while (this._disposables.length) { - const x = this._disposables.pop(); - if (x) { - x.dispose(); - } - } + // CORREÇÃO: Adicionando o método dispose para conformidade. + public dispose() { + while (this._disposables.length) { + const x = this._disposables.pop(); + if (x) { + x.dispose(); + } } + } } function getNonce() { - let text = ''; - const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - for (let i = 0; i < 32; i++) { - text += possible.charAt(Math.floor(Math.random() * possible.length)); - } - return text; + let text = ""; + const possible = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + for (let i = 0; i < 32; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } + return text; } diff --git a/packages/vscode-extension/src/providers/DashboardProvider.ts b/packages/vscode-extension/src/providers/DashboardProvider.ts index 7dae5723..039f3635 100644 --- a/packages/vscode-extension/src/providers/DashboardProvider.ts +++ b/packages/vscode-extension/src/providers/DashboardProvider.ts @@ -2,171 +2,204 @@ import * as vscode from "vscode"; import * as path from "path"; import * as fs from "fs"; -export class DashboardProvider implements vscode.WebviewViewProvider, vscode.Disposable { - public static readonly viewType = "stackcode.dashboard"; - private _view?: vscode.WebviewView; - private readonly _extensionUri: vscode.Uri; - private _disposables: vscode.Disposable[] = []; +export class DashboardProvider + implements vscode.WebviewViewProvider, vscode.Disposable +{ + public static readonly viewType = "stackcode.dashboard"; + private _view?: vscode.WebviewView; + private readonly _extensionUri: vscode.Uri; + private _disposables: vscode.Disposable[] = []; - constructor(context: vscode.ExtensionContext) { - this._extensionUri = context.extensionUri; - } + constructor(context: vscode.ExtensionContext) { + this._extensionUri = context.extensionUri; + } - public resolveWebviewView( - webviewView: vscode.WebviewView, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - context: vscode.WebviewViewResolveContext, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - token: vscode.CancellationToken, - ) { - this._view = webviewView; + public resolveWebviewView( + webviewView: vscode.WebviewView, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + context: vscode.WebviewViewResolveContext, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + token: vscode.CancellationToken, + ) { + this._view = webviewView; - webviewView.webview.options = { - enableScripts: true, - localResourceRoots: [vscode.Uri.joinPath(this._extensionUri, 'dist')], - }; + webviewView.webview.options = { + enableScripts: true, + localResourceRoots: [vscode.Uri.joinPath(this._extensionUri, "dist")], + }; - webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); + webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); - webviewView.webview.onDidReceiveMessage( - async (data: { type: string; payload?: unknown }) => { - console.log(`[StackCode] Received command from webview: ${data.type}`); - - try { - // Tratar comandos específicos do webview - switch (data.type) { - case 'webviewReady': - console.log('[StackCode] Webview reported ready, sending initial data'); - this.updateProjectStats(); - return; - - case 'refreshStats': - this.updateProjectStats(); - return; - - default: - // Executar comando normal do VS Code - await vscode.commands.executeCommand(data.type, data.payload); - } - } catch (error) { - console.error(`[StackCode] Error executing command ${data.type}:`, error); - this.sendMessage({ - type: 'commandError', - payload: { command: data.type, error: error instanceof Error ? error.message : 'Unknown error' } - }); - } + webviewView.webview.onDidReceiveMessage( + async (data: { type: string; payload?: unknown }) => { + console.log(`[StackCode] Received command from webview: ${data.type}`); + + try { + // Tratar comandos específicos do webview + switch (data.type) { + case "webviewReady": + console.log( + "[StackCode] Webview reported ready, sending initial data", + ); + this.updateProjectStats(); + return; + + case "refreshStats": + this.updateProjectStats(); + return; + + default: + // Executar comando normal do VS Code + await vscode.commands.executeCommand(data.type, data.payload); + } + } catch (error) { + console.error( + `[StackCode] Error executing command ${data.type}:`, + error, + ); + this.sendMessage({ + type: "commandError", + payload: { + command: data.type, + error: error instanceof Error ? error.message : "Unknown error", }, - undefined, - this._disposables - ); + }); + } + }, + undefined, + this._disposables, + ); - // WebviewView doesn't have onDidBecomeVisible, so we'll update stats immediately - this.updateProjectStats(); + // WebviewView doesn't have onDidBecomeVisible, so we'll update stats immediately + this.updateProjectStats(); + } + + public sendMessage(message: { type: string; payload?: unknown }) { + if (this._view) { + this._view.webview.postMessage(message); } + } - public sendMessage(message: { type: string; payload?: unknown }) { - if (this._view) { - this._view.webview.postMessage(message); - } + public show() { + if (this._view) { + this._view.show?.(true); + } else { + // If view is not created yet, trigger the creation by executing the show command + vscode.commands.executeCommand("workbench.view.extension.stackcode"); } + } - public show() { - if (this._view) { - this._view.show?.(true); - } else { - // If view is not created yet, trigger the creation by executing the show command - vscode.commands.executeCommand('workbench.view.extension.stackcode'); - } + private async updateProjectStats() { + if (!this._view) { + console.log("[StackCode] No view available for stats update"); + return; } - private async updateProjectStats() { - if (!this._view) { - console.log('[StackCode] No view available for stats update'); - return; - } + const workspaceFolders = vscode.workspace.workspaceFolders; + console.log( + "[StackCode] Workspace folders:", + workspaceFolders?.length || 0, + ); + console.log("[StackCode] Workspace name:", vscode.workspace.name); + console.log( + "[StackCode] Workspace file:", + vscode.workspace.workspaceFile?.toString(), + ); - const workspaceFolders = vscode.workspace.workspaceFolders; - console.log('[StackCode] Workspace folders:', workspaceFolders?.length || 0); - console.log('[StackCode] Workspace name:', vscode.workspace.name); - console.log('[StackCode] Workspace file:', vscode.workspace.workspaceFile?.toString()); - - if (!workspaceFolders || workspaceFolders.length === 0) { - console.log('[StackCode] No workspace folders found, using alternative detection'); - - // Fallback: usar informações do contexto da extensão - const extensionWorkspace = path.dirname(path.dirname(path.dirname(this._extensionUri.fsPath))); - console.log('[StackCode] Extension workspace path:', extensionWorkspace); - - this.sendMessage({ - type: 'updateStats', - payload: { - files: 0, - workspaceName: 'StackCode (Debug)', - workspacePath: extensionWorkspace, - mode: 'development' - } - }); - return; - } + if (!workspaceFolders || workspaceFolders.length === 0) { + console.log( + "[StackCode] No workspace folders found, using alternative detection", + ); - try { - const files = await vscode.workspace.findFiles('**/*', '**/node_modules/**', 1000); - console.log('[StackCode] Found files:', files.length); - - this.sendMessage({ - type: 'updateStats', - payload: { - files: files.length, - workspaceName: workspaceFolders[0].name, - workspacePath: workspaceFolders[0].uri.fsPath, - mode: 'production' - }, - }); - } catch (e) { - console.error("[StackCode] Error fetching project stats:", e); - this.sendMessage({ - type: 'updateStats', - payload: { files: 0, error: 'Failed to scan files' } - }); - } + // Fallback: usar informações do contexto da extensão + const extensionWorkspace = path.dirname( + path.dirname(path.dirname(this._extensionUri.fsPath)), + ); + console.log("[StackCode] Extension workspace path:", extensionWorkspace); + + this.sendMessage({ + type: "updateStats", + payload: { + files: 0, + workspaceName: "StackCode (Debug)", + workspacePath: extensionWorkspace, + mode: "development", + }, + }); + return; } - private _getHtmlForWebview(webview: vscode.Webview): string { - const nonce = getNonce(); - const buildPath = vscode.Uri.joinPath(this._extensionUri, 'dist', 'webview-ui'); - - // Lê o manifest.json do Vite - const manifestPath = path.join(buildPath.fsPath, '.vite', 'manifest.json'); - - console.log('[StackCode] Build path:', buildPath.fsPath); - console.log('[StackCode] Manifest path:', manifestPath); - console.log('[StackCode] Manifest exists:', fs.existsSync(manifestPath)); - - try { - const manifestContent = fs.readFileSync(manifestPath, 'utf-8'); - const manifest = JSON.parse(manifestContent); - console.log('[StackCode] Manifest content:', manifest); + try { + const files = await vscode.workspace.findFiles( + "**/*", + "**/node_modules/**", + 1000, + ); + console.log("[StackCode] Found files:", files.length); + + this.sendMessage({ + type: "updateStats", + payload: { + files: files.length, + workspaceName: workspaceFolders[0].name, + workspacePath: workspaceFolders[0].uri.fsPath, + mode: "production", + }, + }); + } catch (e) { + console.error("[StackCode] Error fetching project stats:", e); + this.sendMessage({ + type: "updateStats", + payload: { files: 0, error: "Failed to scan files" }, + }); + } + } + + private _getHtmlForWebview(webview: vscode.Webview): string { + const nonce = getNonce(); + const buildPath = vscode.Uri.joinPath( + this._extensionUri, + "dist", + "webview-ui", + ); - // Pega os arquivos do manifest do Vite - const indexEntry = manifest['index.html']; - const scriptFile = indexEntry.file; - const cssFiles = indexEntry.css || []; + // Lê o manifest.json do Vite + const manifestPath = path.join(buildPath.fsPath, ".vite", "manifest.json"); - const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(buildPath, scriptFile)); - const cssUris = cssFiles.map((cssFile: string) => - webview.asWebviewUri(vscode.Uri.joinPath(buildPath, cssFile)) - ); + console.log("[StackCode] Build path:", buildPath.fsPath); + console.log("[StackCode] Manifest path:", manifestPath); + console.log("[StackCode] Manifest exists:", fs.existsSync(manifestPath)); - console.log('[StackCode] Script URI:', scriptUri.toString()); - console.log('[StackCode] CSS URIs:', cssUris.map((uri: vscode.Uri) => uri.toString())); + try { + const manifestContent = fs.readFileSync(manifestPath, "utf-8"); + const manifest = JSON.parse(manifestContent); + console.log("[StackCode] Manifest content:", manifest); - return ` + // Pega os arquivos do manifest do Vite + const indexEntry = manifest["index.html"]; + const scriptFile = indexEntry.file; + const cssFiles = indexEntry.css || []; + + const scriptUri = webview.asWebviewUri( + vscode.Uri.joinPath(buildPath, scriptFile), + ); + const cssUris = cssFiles.map((cssFile: string) => + webview.asWebviewUri(vscode.Uri.joinPath(buildPath, cssFile)), + ); + + console.log("[StackCode] Script URI:", scriptUri.toString()); + console.log( + "[StackCode] CSS URIs:", + cssUris.map((uri: vscode.Uri) => uri.toString()), + ); + + return ` - ${cssUris.map((uri: vscode.Uri) => ``).join('\n ')} + ${cssUris.map((uri: vscode.Uri) => ``).join("\n ")} StackCode Dashboard @@ -199,10 +232,10 @@ export class DashboardProvider implements vscode.WebviewViewProvider, vscode.Dis `; - } catch (error) { - console.error("[StackCode] Error reading manifest:", error); - // Fallback melhorado para desenvolvimento - return ` + } catch (error) { + console.error("[StackCode] Error reading manifest:", error); + // Fallback melhorado para desenvolvimento + return ` @@ -248,32 +281,33 @@ export class DashboardProvider implements vscode.WebviewViewProvider, vscode.Dis

Execute: npm run build:ui

- Erro: ${error instanceof Error ? error.message : 'Manifest não encontrado'} + Erro: ${error instanceof Error ? error.message : "Manifest não encontrado"}

Status da extensão: ✅ Ativa

-

Workspace: ${vscode.workspace.workspaceFolders?.[0]?.name || 'Nenhum'}

+

Workspace: ${vscode.workspace.workspaceFolders?.[0]?.name || "Nenhum"}

`; - } } + } - // CORREÇÃO: Adicionando o método dispose para conformidade. - public dispose() { - while (this._disposables.length) { - const x = this._disposables.pop(); - if (x) { - x.dispose(); - } - } + // CORREÇÃO: Adicionando o método dispose para conformidade. + public dispose() { + while (this._disposables.length) { + const x = this._disposables.pop(); + if (x) { + x.dispose(); + } } + } } function getNonce() { - let text = ''; - const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - for (let i = 0; i < 32; i++) { - text += possible.charAt(Math.floor(Math.random() * possible.length)); - } - return text; + let text = ""; + const possible = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + for (let i = 0; i < 32; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } + return text; } diff --git a/packages/vscode-extension/src/webview-ui/index.html b/packages/vscode-extension/src/webview-ui/index.html index e8a29515..0463f8c2 100644 --- a/packages/vscode-extension/src/webview-ui/index.html +++ b/packages/vscode-extension/src/webview-ui/index.html @@ -1,4 +1,4 @@ - + @@ -9,4 +9,4 @@
- \ No newline at end of file + diff --git a/packages/vscode-extension/src/webview-ui/postcss.config.js b/packages/vscode-extension/src/webview-ui/postcss.config.js index 9c3f9ec9..703b0ee9 100644 --- a/packages/vscode-extension/src/webview-ui/postcss.config.js +++ b/packages/vscode-extension/src/webview-ui/postcss.config.js @@ -3,7 +3,7 @@ export default { plugins: { // CORREÇÃO: Usamos o novo pacote aqui. - '@tailwindcss/postcss': {}, + "@tailwindcss/postcss": {}, autoprefixer: {}, }, -} \ No newline at end of file +}; diff --git a/packages/vscode-extension/src/webview-ui/src/App.tsx b/packages/vscode-extension/src/webview-ui/src/App.tsx index 6898ed47..467021ca 100644 --- a/packages/vscode-extension/src/webview-ui/src/App.tsx +++ b/packages/vscode-extension/src/webview-ui/src/App.tsx @@ -1,15 +1,15 @@ -import React, { useState, useEffect } from 'react'; -import Dashboard from './components/Dashboard'; -import ProjectView from './components/ProjectView'; -import StatusBar from './components/StatusBar'; -import NotificationPanel from './components/NotificationPanel'; -import CommandPalette from './components/CommandPalette'; +import React, { useState, useEffect } from "react"; +import Dashboard from "./components/Dashboard"; +import ProjectView from "./components/ProjectView"; +import StatusBar from "./components/StatusBar"; +import NotificationPanel from "./components/NotificationPanel"; +import CommandPalette from "./components/CommandPalette"; // Mock VSCode API for development const mockVSCode = { postMessage: (message: { type: string; payload?: unknown }) => { - console.log('VSCode message:', message); - } + console.log("VSCode message:", message); + }, }; // Tipagem para a API do VS Code, uma boa prática. @@ -26,7 +26,7 @@ declare global { interface Notification { id: string; - type: 'info' | 'warning' | 'error' | 'success' | 'tip'; + type: "info" | "warning" | "error" | "success" | "tip"; title: string; message: string; actions?: Array<{ @@ -44,100 +44,101 @@ const initialStats = { }; function App() { - const [currentView] = useState<'dashboard' | 'project'>('dashboard'); + const [currentView] = useState<"dashboard" | "project">("dashboard"); const [notifications, setNotifications] = useState([ { - id: '1', - type: 'tip', - title: 'Welcome to StackCode!', - message: 'Get started by initializing your project or exploring the dashboard.', + id: "1", + type: "tip", + title: "Welcome to StackCode!", + message: + "Get started by initializing your project or exploring the dashboard.", actions: [ - { label: 'Initialize', action: 'stackcode.init', primary: true }, - { label: 'Learn More', action: 'stackcode.config' } + { label: "Initialize", action: "stackcode.init", primary: true }, + { label: "Learn More", action: "stackcode.config" }, ], - timestamp: new Date() - } + timestamp: new Date(), + }, ]); const [commandPaletteOpen, setCommandPaletteOpen] = useState(false); - const [currentBranch, setCurrentBranch] = useState('main'); + const [currentBranch, setCurrentBranch] = useState("main"); const [hasChanges, setHasChanges] = useState(false); - const [lastAction, setLastAction] = useState('Ready'); + const [lastAction, setLastAction] = useState("Ready"); const [, setStats] = useState(initialStats); const [isReady, setIsReady] = useState(false); const [vscode] = useState(() => { - return typeof window !== 'undefined' && 'acquireVsCodeApi' in window - ? (window as { acquireVsCodeApi: () => VsCodeApi }).acquireVsCodeApi() + return typeof window !== "undefined" && "acquireVsCodeApi" in window + ? (window as { acquireVsCodeApi: () => VsCodeApi }).acquireVsCodeApi() : mockVSCode; }); useEffect(() => { // Listen for keyboard shortcuts const handleKeyDown = (e: KeyboardEvent) => { - if ((e.metaKey || e.ctrlKey) && e.key === 'k') { + if ((e.metaKey || e.ctrlKey) && e.key === "k") { e.preventDefault(); setCommandPaletteOpen(true); } - if (e.key === 'Escape') { + if (e.key === "Escape") { setCommandPaletteOpen(false); } }; - document.addEventListener('keydown', handleKeyDown); - return () => document.removeEventListener('keydown', handleKeyDown); + document.addEventListener("keydown", handleKeyDown); + return () => document.removeEventListener("keydown", handleKeyDown); }, []); useEffect(() => { // Listener para mensagens vindas da extensão (o "backend"). const handleMessage = (event: MessageEvent) => { const message = event.data; - console.log('Message received from extension:', message); + console.log("Message received from extension:", message); switch (message.type) { - case 'updateStats': - setStats(prevStats => ({ ...prevStats, ...message.payload })); + case "updateStats": + setStats((prevStats) => ({ ...prevStats, ...message.payload })); break; - case 'updateBranch': - setCurrentBranch(message.payload?.branch || 'main'); + case "updateBranch": + setCurrentBranch(message.payload?.branch || "main"); break; - case 'updateChanges': + case "updateChanges": setHasChanges(message.payload?.hasChanges || false); break; } }; - window.addEventListener('message', handleMessage); + window.addEventListener("message", handleMessage); // Informa à extensão que a UI está pronta para receber dados. - vscode.postMessage({ type: 'webviewReady' }); + vscode.postMessage({ type: "webviewReady" }); setIsReady(true); // Função de limpeza para remover o listener. return () => { - window.removeEventListener('message', handleMessage); + window.removeEventListener("message", handleMessage); }; }, [vscode]); const handleCommand = (command: string) => { - console.log('Executing command:', command); + console.log("Executing command:", command); setLastAction(`Executed: ${command}`); - + // Send message to VSCode vscode.postMessage({ type: command }); // Add success notification const newNotification: Notification = { id: Date.now().toString(), - type: 'success', - title: 'Command Executed', + type: "success", + title: "Command Executed", message: `Successfully executed: ${command}`, - timestamp: new Date() + timestamp: new Date(), }; - - setNotifications(prev => [newNotification, ...prev]); + + setNotifications((prev) => [newNotification, ...prev]); }; const handleNotificationDismiss = (id: string) => { - setNotifications(prev => prev.filter(n => n.id !== id)); + setNotifications((prev) => prev.filter((n) => n.id !== id)); }; const handleNotificationAction = (action: string) => { @@ -170,12 +171,14 @@ function App() { {/* Main Panel */}
- {currentView === 'dashboard' ? ( + {currentView === "dashboard" ? ( ) : (

Project View

-

Project details and management tools will be displayed here.

+

+ Project details and management tools will be displayed here. +

)}
@@ -206,4 +209,4 @@ function App() { ); } -export default App; \ No newline at end of file +export default App; diff --git a/packages/vscode-extension/src/webview-ui/src/components/CommandPalette.tsx b/packages/vscode-extension/src/webview-ui/src/components/CommandPalette.tsx index dbb9aaee..492dbbd1 100644 --- a/packages/vscode-extension/src/webview-ui/src/components/CommandPalette.tsx +++ b/packages/vscode-extension/src/webview-ui/src/components/CommandPalette.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useRef } from 'react'; +import React, { useState, useEffect, useRef } from "react"; import { Search, Command, @@ -9,8 +9,8 @@ import { Book, FolderOpen, GitCommit, - BarChart3 -} from 'lucide-react'; + BarChart3, +} from "lucide-react"; interface CommandItem { id: string; @@ -31,103 +31,103 @@ interface CommandPaletteProps { const CommandPalette: React.FC = ({ isOpen, onClose, - onCommand + onCommand, }) => { - const [query, setQuery] = useState(''); + const [query, setQuery] = useState(""); const [selectedIndex, setSelectedIndex] = useState(0); const inputRef = useRef(null); const commands: CommandItem[] = [ { - id: 'init', - title: 'Initialize Project', - description: 'Set up StackCode scaffolding for your project', + id: "init", + title: "Initialize Project", + description: "Set up StackCode scaffolding for your project", icon: , - command: 'stackcode.init', - category: 'Project', - keywords: ['init', 'setup', 'scaffold', 'create'] + command: "stackcode.init", + category: "Project", + keywords: ["init", "setup", "scaffold", "create"], }, { - id: 'generate-readme', - title: 'Generate README', - description: 'Create a comprehensive README.md file', + id: "generate-readme", + title: "Generate README", + description: "Create a comprehensive README.md file", icon: , - command: 'stackcode.generate.readme', - category: 'Generate', - keywords: ['readme', 'documentation', 'docs', 'generate'] + command: "stackcode.generate.readme", + category: "Generate", + keywords: ["readme", "documentation", "docs", "generate"], }, { - id: 'generate-gitignore', - title: 'Generate .gitignore', - description: 'Create .gitignore based on project type', + id: "generate-gitignore", + title: "Generate .gitignore", + description: "Create .gitignore based on project type", icon: , - command: 'stackcode.generate.gitignore', - category: 'Generate', - keywords: ['gitignore', 'ignore', 'git', 'generate'] + command: "stackcode.generate.gitignore", + category: "Generate", + keywords: ["gitignore", "ignore", "git", "generate"], }, { - id: 'start-feature', - title: 'Start Feature Branch', - description: 'Begin a new feature using GitFlow', + id: "start-feature", + title: "Start Feature Branch", + description: "Begin a new feature using GitFlow", icon: , - command: 'stackcode.git.start', - category: 'Git', - keywords: ['feature', 'branch', 'git', 'start', 'flow'] + command: "stackcode.git.start", + category: "Git", + keywords: ["feature", "branch", "git", "start", "flow"], }, { - id: 'commit', - title: 'Smart Commit', - description: 'Make a conventional commit with validation', + id: "commit", + title: "Smart Commit", + description: "Make a conventional commit with validation", icon: , - command: 'stackcode.commit', - category: 'Git', - keywords: ['commit', 'conventional', 'message', 'git'] + command: "stackcode.commit", + category: "Git", + keywords: ["commit", "conventional", "message", "git"], }, { - id: 'validate', - title: 'Validate Project', - description: 'Check project structure and best practices', + id: "validate", + title: "Validate Project", + description: "Check project structure and best practices", icon: , - command: 'stackcode.validate', - category: 'Tools', - keywords: ['validate', 'check', 'best practices', 'lint'] + command: "stackcode.validate", + category: "Tools", + keywords: ["validate", "check", "best practices", "lint"], }, { - id: 'release', - title: 'Create Release', - description: 'Create a new release with automated versioning', + id: "release", + title: "Create Release", + description: "Create a new release with automated versioning", icon: , - command: 'stackcode.release', - category: 'Release', - keywords: ['release', 'version', 'publish', 'deploy'] + command: "stackcode.release", + category: "Release", + keywords: ["release", "version", "publish", "deploy"], }, { - id: 'config', - title: 'Configuration', - description: 'Configure StackCode settings', + id: "config", + title: "Configuration", + description: "Configure StackCode settings", icon: , - command: 'stackcode.config', - category: 'Settings', - keywords: ['config', 'settings', 'preferences', 'setup'] + command: "stackcode.config", + category: "Settings", + keywords: ["config", "settings", "preferences", "setup"], }, { - id: 'dashboard', - title: 'Show Dashboard', - description: 'Open the interactive StackCode dashboard', + id: "dashboard", + title: "Show Dashboard", + description: "Open the interactive StackCode dashboard", icon: , - command: 'stackcode.dashboard', - category: 'View', - keywords: ['dashboard', 'overview', 'stats', 'view'] - } + command: "stackcode.dashboard", + category: "View", + keywords: ["dashboard", "overview", "stats", "view"], + }, ]; - const filteredCommands = commands.filter(command => { + const filteredCommands = commands.filter((command) => { const searchTerm = query.toLowerCase(); return ( command.title.toLowerCase().includes(searchTerm) || command.description.toLowerCase().includes(searchTerm) || command.category.toLowerCase().includes(searchTerm) || - command.keywords.some(keyword => keyword.includes(searchTerm)) + command.keywords.some((keyword) => keyword.includes(searchTerm)) ); }); @@ -143,25 +143,25 @@ const CommandPalette: React.FC = ({ const handleKeyDown = (e: React.KeyboardEvent) => { switch (e.key) { - case 'ArrowDown': + case "ArrowDown": e.preventDefault(); - setSelectedIndex(prev => - prev < filteredCommands.length - 1 ? prev + 1 : 0 + setSelectedIndex((prev) => + prev < filteredCommands.length - 1 ? prev + 1 : 0, ); break; - case 'ArrowUp': + case "ArrowUp": e.preventDefault(); - setSelectedIndex(prev => - prev > 0 ? prev - 1 : filteredCommands.length - 1 + setSelectedIndex((prev) => + prev > 0 ? prev - 1 : filteredCommands.length - 1, ); break; - case 'Enter': + case "Enter": e.preventDefault(); if (filteredCommands[selectedIndex]) { handleCommand(filteredCommands[selectedIndex].command); } break; - case 'Escape': + case "Escape": e.preventDefault(); onClose(); break; @@ -171,7 +171,7 @@ const CommandPalette: React.FC = ({ const handleCommand = (command: string) => { onCommand(command); onClose(); - setQuery(''); + setQuery(""); }; if (!isOpen) return null; @@ -213,8 +213,8 @@ const CommandPalette: React.FC = ({ onClick={() => handleCommand(command.command)} className={`w-full flex items-center gap-3 p-3 rounded-lg text-left transition-colors ${ index === selectedIndex - ? 'bg-blue-600/20 border border-blue-500/30' - : 'hover:bg-slate-700/50' + ? "bg-blue-600/20 border border-blue-500/30" + : "hover:bg-slate-700/50" }`} >
@@ -241,4 +241,4 @@ const CommandPalette: React.FC = ({ ); }; -export default CommandPalette; \ No newline at end of file +export default CommandPalette; diff --git a/packages/vscode-extension/src/webview-ui/src/components/Dashboard.tsx b/packages/vscode-extension/src/webview-ui/src/components/Dashboard.tsx index 72ac48a7..e680aca7 100644 --- a/packages/vscode-extension/src/webview-ui/src/components/Dashboard.tsx +++ b/packages/vscode-extension/src/webview-ui/src/components/Dashboard.tsx @@ -1,10 +1,10 @@ -import React, { useState, useEffect } from 'react'; -import { - Rocket, - Zap, - GitBranch, - FileText, - CheckCircle, +import React, { useState, useEffect } from "react"; +import { + Rocket, + Zap, + GitBranch, + FileText, + CheckCircle, Star, Package, GitCommit, @@ -14,8 +14,8 @@ import { TrendingUp, Activity, Users, - Code -} from 'lucide-react'; + Code, +} from "lucide-react"; interface DashboardProps { vscode?: { @@ -34,7 +34,7 @@ interface ProjectStats { interface ActivityItem { id: string; - type: 'commit' | 'branch' | 'file' | 'release'; + type: "commit" | "branch" | "file" | "release"; title: string; description: string; timestamp: string; @@ -48,42 +48,42 @@ const Dashboard: React.FC = ({ vscode }) => { commits: 42, issues: 0, contributors: 3, - linesOfCode: 1247 + linesOfCode: 1247, }); const [activities] = useState([ { - id: '1', - type: 'release', - title: 'VS Code Extension Created', - description: 'Successfully packaged and installed StackCode extension', - timestamp: '2 min ago', - icon: + id: "1", + type: "release", + title: "VS Code Extension Created", + description: "Successfully packaged and installed StackCode extension", + timestamp: "2 min ago", + icon: , }, { - id: '2', - type: 'commit', - title: 'Project Compiled', - description: 'TypeScript compilation completed successfully', - timestamp: '5 min ago', - icon: + id: "2", + type: "commit", + title: "Project Compiled", + description: "TypeScript compilation completed successfully", + timestamp: "5 min ago", + icon: , }, { - id: '3', - type: 'file', - title: 'README Updated', - description: 'Added new documentation sections', - timestamp: '15 min ago', - icon: + id: "3", + type: "file", + title: "README Updated", + description: "Added new documentation sections", + timestamp: "15 min ago", + icon: , }, { - id: '4', - type: 'branch', - title: 'Feature Branch', - description: 'Created feature/vscode-proactive-notifications', - timestamp: '30 min ago', - icon: - } + id: "4", + type: "branch", + title: "Feature Branch", + description: "Created feature/vscode-proactive-notifications", + timestamp: "30 min ago", + icon: , + }, ]); const sendMessage = (type: string) => { @@ -94,80 +94,84 @@ const Dashboard: React.FC = ({ vscode }) => { const quickActions = [ { - id: 'stackcode.init', - title: 'Initialize Project', - description: 'Set up StackCode scaffolding', + id: "stackcode.init", + title: "Initialize Project", + description: "Set up StackCode scaffolding", icon: , - color: 'from-blue-500 to-blue-600', - onClick: () => sendMessage('stackcode.init') + color: "from-blue-500 to-blue-600", + onClick: () => sendMessage("stackcode.init"), }, { - id: 'stackcode.generate.readme', - title: 'Generate README', - description: 'Create comprehensive docs', + id: "stackcode.generate.readme", + title: "Generate README", + description: "Create comprehensive docs", icon: , - color: 'from-green-500 to-green-600', - onClick: () => sendMessage('stackcode.generate.readme') + color: "from-green-500 to-green-600", + onClick: () => sendMessage("stackcode.generate.readme"), }, { - id: 'stackcode.git.start', - title: 'Start Feature', - description: 'Begin new development', + id: "stackcode.git.start", + title: "Start Feature", + description: "Begin new development", icon: , - color: 'from-purple-500 to-purple-600', - onClick: () => sendMessage('stackcode.git.start') + color: "from-purple-500 to-purple-600", + onClick: () => sendMessage("stackcode.git.start"), }, { - id: 'stackcode.commit', - title: 'Smart Commit', - description: 'Conventional commits', + id: "stackcode.commit", + title: "Smart Commit", + description: "Conventional commits", icon: , - color: 'from-orange-500 to-orange-600', - onClick: () => sendMessage('stackcode.commit') + color: "from-orange-500 to-orange-600", + onClick: () => sendMessage("stackcode.commit"), }, { - id: 'stackcode.validate', - title: 'Validate Project', - description: 'Check best practices', + id: "stackcode.validate", + title: "Validate Project", + description: "Check best practices", icon: , - color: 'from-red-500 to-red-600', - onClick: () => sendMessage('stackcode.validate') + color: "from-red-500 to-red-600", + onClick: () => sendMessage("stackcode.validate"), }, { - id: 'stackcode.release', - title: 'Create Release', - description: 'Package and deploy', + id: "stackcode.release", + title: "Create Release", + description: "Package and deploy", icon: , - color: 'from-indigo-500 to-indigo-600', - onClick: () => sendMessage('stackcode.release') - } + color: "from-indigo-500 to-indigo-600", + onClick: () => sendMessage("stackcode.release"), + }, ]; const tips = [ { - title: '🚀 Quick Start', - description: 'Use Ctrl+Shift+P and type "StackCode" to access all commands quickly!' + title: "🚀 Quick Start", + description: + 'Use Ctrl+Shift+P and type "StackCode" to access all commands quickly!', }, { - title: '🔄 Auto Monitor', - description: 'The extension automatically monitors your files and suggests improvements.' + title: "🔄 Auto Monitor", + description: + "The extension automatically monitors your files and suggests improvements.", }, { - title: '🎯 Git Flow', - description: 'Follow best practices with automated feature, hotfix, and release workflows.' + title: "🎯 Git Flow", + description: + "Follow best practices with automated feature, hotfix, and release workflows.", }, { - title: '📊 Analytics', - description: 'Track your development progress with built-in project analytics.' - } + title: "📊 Analytics", + description: + "Track your development progress with built-in project analytics.", + }, ]; useEffect(() => { // Animate numbers on load const animateNumbers = () => { - const elements = document.querySelectorAll('.animate-number'); + const elements = document.querySelectorAll(".animate-number"); elements.forEach((el) => { - const target = parseInt(el.textContent || '0'); + const target = parseInt(el.textContent || "0"); let current = 0; const increment = target / 30; const timer = setInterval(() => { @@ -209,21 +213,54 @@ const Dashboard: React.FC = ({ vscode }) => { {/* Stats Grid */}
{[ - { label: 'Files', value: stats.files, icon: , color: 'text-blue-400' }, - { label: 'Branches', value: stats.branches, icon: , color: 'text-green-400' }, - { label: 'Commits', value: stats.commits, icon: , color: 'text-purple-400' }, - { label: 'Issues', value: stats.issues, icon: , color: 'text-red-400' }, - { label: 'Contributors', value: stats.contributors, icon: , color: 'text-orange-400' }, - { label: 'Lines', value: stats.linesOfCode, icon: , color: 'text-indigo-400' } + { + label: "Files", + value: stats.files, + icon: , + color: "text-blue-400", + }, + { + label: "Branches", + value: stats.branches, + icon: , + color: "text-green-400", + }, + { + label: "Commits", + value: stats.commits, + icon: , + color: "text-purple-400", + }, + { + label: "Issues", + value: stats.issues, + icon: , + color: "text-red-400", + }, + { + label: "Contributors", + value: stats.contributors, + icon: , + color: "text-orange-400", + }, + { + label: "Lines", + value: stats.linesOfCode, + icon: , + color: "text-indigo-400", + }, ].map((stat, index) => ( -
+
-
- {stat.icon} -
+
{stat.icon}
-
{stat.value}
+
+ {stat.value} +
{stat.label}
))} @@ -250,7 +287,9 @@ const Dashboard: React.FC = ({ vscode }) => {
{action.icon}
-

{action.title}

+

+ {action.title} +

{action.description}

@@ -268,14 +307,21 @@ const Dashboard: React.FC = ({ vscode }) => {
{activities.map((activity) => ( -
+
{activity.icon}

{activity.title}

-

{activity.description}

- {activity.timestamp} +

+ {activity.description} +

+ + {activity.timestamp} +
))} @@ -291,9 +337,14 @@ const Dashboard: React.FC = ({ vscode }) => {
{tips.map((tip, index) => ( -
+

{tip.title}

-

{tip.description}

+

+ {tip.description} +

))}
diff --git a/packages/vscode-extension/src/webview-ui/src/components/NotificationPanel.tsx b/packages/vscode-extension/src/webview-ui/src/components/NotificationPanel.tsx index 410c4024..2205fc2d 100644 --- a/packages/vscode-extension/src/webview-ui/src/components/NotificationPanel.tsx +++ b/packages/vscode-extension/src/webview-ui/src/components/NotificationPanel.tsx @@ -1,16 +1,16 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState, useEffect } from "react"; import { X, CheckCircle, AlertTriangle, Info, AlertCircle, - Lightbulb -} from 'lucide-react'; + Lightbulb, +} from "lucide-react"; interface Notification { id: string; - type: 'info' | 'warning' | 'error' | 'success' | 'tip'; + type: "info" | "warning" | "error" | "success" | "tip"; title: string; message: string; actions?: Array<{ @@ -31,23 +31,25 @@ interface NotificationPanelProps { const NotificationPanel: React.FC = ({ notifications, onDismiss, - onAction + onAction, }) => { - const [visibleNotifications, setVisibleNotifications] = useState([]); + const [visibleNotifications, setVisibleNotifications] = useState< + Notification[] + >([]); useEffect(() => { - setVisibleNotifications(notifications.filter(n => !n.dismissed)); + setVisibleNotifications(notifications.filter((n) => !n.dismissed)); }, [notifications]); const getNotificationIcon = (type: string) => { switch (type) { - case 'success': + case "success": return ; - case 'warning': + case "warning": return ; - case 'error': + case "error": return ; - case 'tip': + case "tip": return ; default: return ; @@ -56,21 +58,21 @@ const NotificationPanel: React.FC = ({ const getNotificationBorder = (type: string) => { switch (type) { - case 'success': - return 'border-l-green-400'; - case 'warning': - return 'border-l-yellow-400'; - case 'error': - return 'border-l-red-400'; - case 'tip': - return 'border-l-blue-400'; + case "success": + return "border-l-green-400"; + case "warning": + return "border-l-yellow-400"; + case "error": + return "border-l-red-400"; + case "tip": + return "border-l-blue-400"; default: - return 'border-l-slate-400'; + return "border-l-slate-400"; } }; const handleDismiss = (id: string) => { - setVisibleNotifications(prev => prev.filter(n => n.id !== id)); + setVisibleNotifications((prev) => prev.filter((n) => n.id !== id)); onDismiss(id); }; @@ -94,7 +96,7 @@ const NotificationPanel: React.FC = ({
{getNotificationIcon(notification.type)}
- +

{notification.title} @@ -102,17 +104,19 @@ const NotificationPanel: React.FC = ({

{notification.message}

- + {notification.actions && notification.actions.length > 0 && (
{notification.actions.map((action, index) => (
)} - +
{notification.timestamp.toLocaleTimeString()}

- +
- +
- {treeData.map(item => renderTreeItem(item))} + {treeData.map((item) => renderTreeItem(item))}
); }; -export default ProjectView; \ No newline at end of file +export default ProjectView; diff --git a/packages/vscode-extension/src/webview-ui/src/components/StatusBar.tsx b/packages/vscode-extension/src/webview-ui/src/components/StatusBar.tsx index 8252433f..4f4f678e 100644 --- a/packages/vscode-extension/src/webview-ui/src/components/StatusBar.tsx +++ b/packages/vscode-extension/src/webview-ui/src/components/StatusBar.tsx @@ -1,5 +1,11 @@ -import React, { useState, useEffect } from 'react'; -import { GitBranch, CheckCircle, AlertTriangle, Clock, Zap } from 'lucide-react'; +import React, { useState, useEffect } from "react"; +import { + GitBranch, + CheckCircle, + AlertTriangle, + Clock, + Zap, +} from "lucide-react"; interface StatusBarProps { currentBranch?: string; @@ -9,10 +15,10 @@ interface StatusBarProps { } const StatusBar: React.FC = ({ - currentBranch = 'main', + currentBranch = "main", hasChanges = false, - lastAction = 'Ready', - onQuickAction + lastAction = "Ready", + onQuickAction, }) => { const [time, setTime] = useState(new Date()); @@ -25,9 +31,10 @@ const StatusBar: React.FC = ({ }, []); const getStatusColor = () => { - if (hasChanges) return 'text-yellow-400'; - if (currentBranch === 'main' || currentBranch === 'master') return 'text-red-400'; - return 'text-green-400'; + if (hasChanges) return "text-yellow-400"; + if (currentBranch === "main" || currentBranch === "master") + return "text-red-400"; + return "text-green-400"; }; const getStatusIcon = () => { @@ -55,7 +62,7 @@ const StatusBar: React.FC = ({
{/* Quick Actions */} {/* Time */} -
- {time.toLocaleTimeString()} -
+
{time.toLocaleTimeString()}
); }; -export default StatusBar; \ No newline at end of file +export default StatusBar; diff --git a/packages/vscode-extension/src/webview-ui/src/index.css b/packages/vscode-extension/src/webview-ui/src/index.css index 9793e45e..9b17d402 100644 --- a/packages/vscode-extension/src/webview-ui/src/index.css +++ b/packages/vscode-extension/src/webview-ui/src/index.css @@ -18,7 +18,14 @@ } body { - font-family: var(--vscode-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif); + font-family: var( + --vscode-font-family, + -apple-system, + BlinkMacSystemFont, + "Segoe UI", + Roboto, + sans-serif + ); font-size: var(--vscode-font-size, 13px); color: var(--vscode-editor-foreground, #cccccc); background-color: var(--vscode-editor-background, #1e1e1e); @@ -36,161 +43,395 @@ /* Cores customizadas essenciais - tons mais suaves para VS Code */ @layer utilities { /* Backgrounds slate - integrados com VS Code theme */ - .bg-slate-700 { background-color: var(--vscode-sideBar-background, #252526); } - .bg-slate-800 { background-color: var(--vscode-editor-background, #1e1e1e); } - .bg-slate-900 { background-color: var(--vscode-panel-background, #181818); } - .bg-slate-700\/50 { background-color: rgba(37, 37, 38, 0.5); } - .bg-slate-800\/30 { background-color: rgba(30, 30, 30, 0.3); } - .bg-slate-800\/50 { background-color: rgba(30, 30, 30, 0.5); } - .bg-slate-800\/70 { background-color: rgba(30, 30, 30, 0.7); } - .bg-slate-700\/30 { background-color: rgba(37, 37, 38, 0.3); } - + .bg-slate-700 { + background-color: var(--vscode-sideBar-background, #252526); + } + .bg-slate-800 { + background-color: var(--vscode-editor-background, #1e1e1e); + } + .bg-slate-900 { + background-color: var(--vscode-panel-background, #181818); + } + .bg-slate-700\/50 { + background-color: rgba(37, 37, 38, 0.5); + } + .bg-slate-800\/30 { + background-color: rgba(30, 30, 30, 0.3); + } + .bg-slate-800\/50 { + background-color: rgba(30, 30, 30, 0.5); + } + .bg-slate-800\/70 { + background-color: rgba(30, 30, 30, 0.7); + } + .bg-slate-700\/30 { + background-color: rgba(37, 37, 38, 0.3); + } + /* Background extras */ - .bg-white\/5 { background-color: rgba(255, 255, 255, 0.05); } - .bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); } - .bg-white\/20 { background-color: rgba(255, 255, 255, 0.2); } - .bg-black\/20 { background-color: rgba(0, 0, 0, 0.2); } + .bg-white\/5 { + background-color: rgba(255, 255, 255, 0.05); + } + .bg-white\/10 { + background-color: rgba(255, 255, 255, 0.1); + } + .bg-white\/20 { + background-color: rgba(255, 255, 255, 0.2); + } + .bg-black\/20 { + background-color: rgba(0, 0, 0, 0.2); + } /* Text colors - mais integradas com VS Code */ - .text-blue-100 { color: #dbeafe; } - .text-blue-200 { color: #bfdbfe; } - .text-blue-400 { color: #60a5fa; } - .text-green-400 { color: #4ade80; } - .text-purple-400 { color: #a78bfa; } - .text-red-400 { color: #f87171; } - .text-orange-400 { color: #fb923c; } - .text-indigo-400 { color: #818cf8; } - .text-yellow-400 { color: #facc15; } - .text-white { color: var(--vscode-editor-foreground, #ffffff); } - .text-slate-300 { color: var(--vscode-descriptionForeground, #cccccc99); } - .text-slate-400 { color: var(--vscode-disabledForeground, #cccccc80); } - .text-slate-500 { color: var(--vscode-widget-shadow, #00000026); } + .text-blue-100 { + color: #dbeafe; + } + .text-blue-200 { + color: #bfdbfe; + } + .text-blue-400 { + color: #60a5fa; + } + .text-green-400 { + color: #4ade80; + } + .text-purple-400 { + color: #a78bfa; + } + .text-red-400 { + color: #f87171; + } + .text-orange-400 { + color: #fb923c; + } + .text-indigo-400 { + color: #818cf8; + } + .text-yellow-400 { + color: #facc15; + } + .text-white { + color: var(--vscode-editor-foreground, #ffffff); + } + .text-slate-300 { + color: var(--vscode-descriptionForeground, #cccccc99); + } + .text-slate-400 { + color: var(--vscode-disabledForeground, #cccccc80); + } + .text-slate-500 { + color: var(--vscode-widget-shadow, #00000026); + } /* Border colors - mais sutis */ - .border-slate-600 { border-color: var(--vscode-panel-border, #80808059); } - .border-slate-700 { border-color: var(--vscode-widget-border, #303031); } + .border-slate-600 { + border-color: var(--vscode-panel-border, #80808059); + } + .border-slate-700 { + border-color: var(--vscode-widget-border, #303031); + } /* Tamanhos */ - .w-4 { width: 1rem; } - .w-5 { width: 1.25rem; } - .w-6 { width: 1.5rem; } - .w-8 { width: 2rem; } - .w-10 { width: 2.5rem; } - .w-12 { width: 3rem; } - .w-48 { width: 12rem; } - .w-64 { width: 16rem; } - .w-80 { width: 20rem; } - - .h-4 { height: 1rem; } - .h-5 { height: 1.25rem; } - .h-6 { height: 1.5rem; } - .h-8 { height: 2rem; } - .h-10 { height: 2.5rem; } - .h-12 { height: 3rem; } - .h-48 { height: 12rem; } - .h-64 { height: 16rem; } - .h-80 { height: 20rem; } - - .max-w-7xl { max-width: 80rem; } - .max-h-80 { max-height: 20rem; } + .w-4 { + width: 1rem; + } + .w-5 { + width: 1.25rem; + } + .w-6 { + width: 1.5rem; + } + .w-8 { + width: 2rem; + } + .w-10 { + width: 2.5rem; + } + .w-12 { + width: 3rem; + } + .w-48 { + width: 12rem; + } + .w-64 { + width: 16rem; + } + .w-80 { + width: 20rem; + } + + .h-4 { + height: 1rem; + } + .h-5 { + height: 1.25rem; + } + .h-6 { + height: 1.5rem; + } + .h-8 { + height: 2rem; + } + .h-10 { + height: 2.5rem; + } + .h-12 { + height: 3rem; + } + .h-48 { + height: 12rem; + } + .h-64 { + height: 16rem; + } + .h-80 { + height: 20rem; + } + + .max-w-7xl { + max-width: 80rem; + } + .max-h-80 { + max-height: 20rem; + } /* Grid e flex */ - .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } - .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } - + .grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + .grid-cols-3 { + grid-template-columns: repeat(3, minmax(0, 1fr)); + } + /* Padding e margin */ - .p-3 { padding: 0.75rem; } - .p-4 { padding: 1rem; } - .p-6 { padding: 1.5rem; } - .p-8 { padding: 2rem; } - .px-3 { padding-left: 0.75rem; padding-right: 0.75rem; } - .px-4 { padding-left: 1rem; padding-right: 1rem; } - .py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; } - .py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; } - .mb-1 { margin-bottom: 0.25rem; } - .mb-2 { margin-bottom: 0.5rem; } - .mb-3 { margin-bottom: 0.75rem; } - .mb-4 { margin-bottom: 1rem; } - .mb-6 { margin-bottom: 1.5rem; } - .mt-1 { margin-top: 0.25rem; } - .mt-2 { margin-top: 0.5rem; } - .gap-2 { gap: 0.5rem; } - .gap-3 { gap: 0.75rem; } - .gap-4 { gap: 1rem; } - .gap-8 { gap: 2rem; } - .space-y-4 > * + * { margin-top: 1rem; } - .space-y-8 > * + * { margin-top: 2rem; } + .p-3 { + padding: 0.75rem; + } + .p-4 { + padding: 1rem; + } + .p-6 { + padding: 1.5rem; + } + .p-8 { + padding: 2rem; + } + .px-3 { + padding-left: 0.75rem; + padding-right: 0.75rem; + } + .px-4 { + padding-left: 1rem; + padding-right: 1rem; + } + .py-1 { + padding-top: 0.25rem; + padding-bottom: 0.25rem; + } + .py-2 { + padding-top: 0.5rem; + padding-bottom: 0.5rem; + } + .mb-1 { + margin-bottom: 0.25rem; + } + .mb-2 { + margin-bottom: 0.5rem; + } + .mb-3 { + margin-bottom: 0.75rem; + } + .mb-4 { + margin-bottom: 1rem; + } + .mb-6 { + margin-bottom: 1.5rem; + } + .mt-1 { + margin-top: 0.25rem; + } + .mt-2 { + margin-top: 0.5rem; + } + .gap-2 { + gap: 0.5rem; + } + .gap-3 { + gap: 0.75rem; + } + .gap-4 { + gap: 1rem; + } + .gap-8 { + gap: 2rem; + } + .space-y-4 > * + * { + margin-top: 1rem; + } + .space-y-8 > * + * { + margin-top: 2rem; + } /* Gradientes - tons mais suaves e VS Code integrados */ - .from-blue-500 { --tw-gradient-from: #3b82f6; } - .to-blue-600 { --tw-gradient-to: #2563eb; } - .from-blue-600 { --tw-gradient-from: #2563eb; } - .via-purple-600 { --tw-gradient-via: #7c3aed; } - .to-blue-800 { --tw-gradient-to: #1e40af; } - .from-green-500 { --tw-gradient-from: #22c55e; } - .to-green-600 { --tw-gradient-to: #16a34a; } - .from-purple-500 { --tw-gradient-from: #8b5cf6; } - .to-purple-600 { --tw-gradient-to: #7c3aed; } - .from-orange-500 { --tw-gradient-from: #f97316; } - .to-orange-600 { --tw-gradient-to: #ea580c; } - .from-red-500 { --tw-gradient-from: #ef4444; } - .to-red-600 { --tw-gradient-to: #dc2626; } - .from-indigo-500 { --tw-gradient-from: #6366f1; } - .to-indigo-600 { --tw-gradient-to: #4f46e5; } - .from-white { --tw-gradient-from: #ffffff; } - .to-blue-200 { --tw-gradient-to: #bfdbfe; } - .from-slate-700\/50 { --tw-gradient-from: rgba(37, 37, 38, 0.4); } - .to-slate-800\/50 { --tw-gradient-to: rgba(30, 30, 30, 0.4); } - .from-slate-600\/50 { --tw-gradient-from: rgba(45, 45, 46, 0.4); } - .to-slate-700\/50 { --tw-gradient-to: rgba(37, 37, 38, 0.4); } - .from-transparent { --tw-gradient-from: transparent; } - .via-white\/20 { --tw-gradient-via: rgba(255, 255, 255, 0.1); } - .to-transparent { --tw-gradient-to: transparent; } + .from-blue-500 { + --tw-gradient-from: #3b82f6; + } + .to-blue-600 { + --tw-gradient-to: #2563eb; + } + .from-blue-600 { + --tw-gradient-from: #2563eb; + } + .via-purple-600 { + --tw-gradient-via: #7c3aed; + } + .to-blue-800 { + --tw-gradient-to: #1e40af; + } + .from-green-500 { + --tw-gradient-from: #22c55e; + } + .to-green-600 { + --tw-gradient-to: #16a34a; + } + .from-purple-500 { + --tw-gradient-from: #8b5cf6; + } + .to-purple-600 { + --tw-gradient-to: #7c3aed; + } + .from-orange-500 { + --tw-gradient-from: #f97316; + } + .to-orange-600 { + --tw-gradient-to: #ea580c; + } + .from-red-500 { + --tw-gradient-from: #ef4444; + } + .to-red-600 { + --tw-gradient-to: #dc2626; + } + .from-indigo-500 { + --tw-gradient-from: #6366f1; + } + .to-indigo-600 { + --tw-gradient-to: #4f46e5; + } + .from-white { + --tw-gradient-from: #ffffff; + } + .to-blue-200 { + --tw-gradient-to: #bfdbfe; + } + .from-slate-700\/50 { + --tw-gradient-from: rgba(37, 37, 38, 0.4); + } + .to-slate-800\/50 { + --tw-gradient-to: rgba(30, 30, 30, 0.4); + } + .from-slate-600\/50 { + --tw-gradient-from: rgba(45, 45, 46, 0.4); + } + .to-slate-700\/50 { + --tw-gradient-to: rgba(37, 37, 38, 0.4); + } + .from-transparent { + --tw-gradient-from: transparent; + } + .via-white\/20 { + --tw-gradient-via: rgba(255, 255, 255, 0.1); + } + .to-transparent { + --tw-gradient-to: transparent; + } /* Bordas arredondadas */ - .rounded-md { border-radius: 0.375rem; } - .rounded-lg { border-radius: 0.5rem; } - .rounded-xl { border-radius: 0.75rem; } - .rounded-2xl { border-radius: 1rem; } + .rounded-md { + border-radius: 0.375rem; + } + .rounded-lg { + border-radius: 0.5rem; + } + .rounded-xl { + border-radius: 0.75rem; + } + .rounded-2xl { + border-radius: 1rem; + } /* Textos */ - .text-xs { font-size: 0.75rem; line-height: 1rem; } - .text-sm { font-size: 0.875rem; line-height: 1.25rem; } - .text-xl { font-size: 1.25rem; line-height: 1.75rem; } - .text-2xl { font-size: 1.5rem; line-height: 2rem; } - .text-4xl { font-size: 2.25rem; line-height: 2.5rem; } - .font-light { font-weight: 300; } - .font-medium { font-weight: 500; } - .font-semibold { font-weight: 600; } - .font-bold { font-weight: 700; } - .leading-relaxed { line-height: 1.625; } + .text-xs { + font-size: 0.75rem; + line-height: 1rem; + } + .text-sm { + font-size: 0.875rem; + line-height: 1.25rem; + } + .text-xl { + font-size: 1.25rem; + line-height: 1.75rem; + } + .text-2xl { + font-size: 1.5rem; + line-height: 2rem; + } + .text-4xl { + font-size: 2.25rem; + line-height: 2.5rem; + } + .font-light { + font-weight: 300; + } + .font-medium { + font-weight: 500; + } + .font-semibold { + font-weight: 600; + } + .font-bold { + font-weight: 700; + } + .leading-relaxed { + line-height: 1.625; + } /* Animações */ .animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; } @keyframes pulse { - 0%, 100% { opacity: 1; } - 50% { opacity: .5; } + 0%, + 100% { + opacity: 1; + } + 50% { + opacity: 0.5; + } } .animate-spin { animation: spin 1s linear infinite; } @keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } } .animate-slide-in { animation: slideIn 0.3s ease-out; } @keyframes slideIn { - 0% { + 0% { transform: translateX(100%); opacity: 0; } - 100% { + 100% { transform: translateX(0); opacity: 1; } @@ -198,27 +439,55 @@ /* Responsividade */ @media (min-width: 768px) { - .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } - .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } + .md\:grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + .md\:grid-cols-3 { + grid-template-columns: repeat(3, minmax(0, 1fr)); + } } - + @media (min-width: 1024px) { - .lg\:col-span-2 { grid-column: span 2 / span 2; } - .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } - .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } - .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } + .lg\:col-span-2 { + grid-column: span 2 / span 2; + } + .lg\:grid-cols-3 { + grid-template-columns: repeat(3, minmax(0, 1fr)); + } + .lg\:grid-cols-4 { + grid-template-columns: repeat(4, minmax(0, 1fr)); + } + .lg\:grid-cols-6 { + grid-template-columns: repeat(6, minmax(0, 1fr)); + } } /* Estados hover */ @media (hover: hover) { - .hover\:bg-slate-700\/30:hover { background-color: rgba(51, 65, 85, 0.3); } - .hover\:bg-slate-800\/70:hover { background-color: rgba(30, 41, 59, 0.7); } - .hover\:from-slate-600\/50:hover { --tw-gradient-from: rgba(71, 85, 105, 0.5); } - .hover\:to-slate-700\/50:hover { --tw-gradient-to: rgba(51, 65, 85, 0.5); } - .hover\:scale-105:hover { transform: scale(1.05); } - .hover\:shadow-2xl:hover { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); } - .group:hover .group-hover\:opacity-100 { opacity: 1; } - .group:hover .group-hover\:translate-x-full { transform: translateX(100%); } + .hover\:bg-slate-700\/30:hover { + background-color: rgba(51, 65, 85, 0.3); + } + .hover\:bg-slate-800\/70:hover { + background-color: rgba(30, 41, 59, 0.7); + } + .hover\:from-slate-600\/50:hover { + --tw-gradient-from: rgba(71, 85, 105, 0.5); + } + .hover\:to-slate-700\/50:hover { + --tw-gradient-to: rgba(51, 65, 85, 0.5); + } + .hover\:scale-105:hover { + transform: scale(1.05); + } + .hover\:shadow-2xl:hover { + box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); + } + .group:hover .group-hover\:opacity-100 { + opacity: 1; + } + .group:hover .group-hover\:translate-x-full { + transform: translateX(100%); + } } /* VS Code specific */ @@ -253,4 +522,4 @@ .custom-scrollbar::-webkit-scrollbar-thumb:hover { background-color: var(--vscode-scrollbarSlider-hoverBackground, #646464b3); } -} \ No newline at end of file +} diff --git a/packages/vscode-extension/src/webview-ui/src/main.tsx b/packages/vscode-extension/src/webview-ui/src/main.tsx index 886ad41c..8b1ddb97 100644 --- a/packages/vscode-extension/src/webview-ui/src/main.tsx +++ b/packages/vscode-extension/src/webview-ui/src/main.tsx @@ -1,10 +1,10 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import App from './App'; -import './index.css'; +import React from "react"; +import ReactDOM from "react-dom/client"; +import App from "./App"; +import "./index.css"; -ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( +ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( , -); \ No newline at end of file +); diff --git a/packages/vscode-extension/src/webview-ui/tailwind.config.js b/packages/vscode-extension/src/webview-ui/tailwind.config.js index 9d2479e8..3a7f3dbb 100644 --- a/packages/vscode-extension/src/webview-ui/tailwind.config.js +++ b/packages/vscode-extension/src/webview-ui/tailwind.config.js @@ -1,157 +1,243 @@ /** @type {import('tailwindcss').Config} */ export default { - content: [ - "./index.html", - "./src/**/*.{js,ts,jsx,tsx}", - ], + content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"], safelist: [ // Cores de texto frequentemente usadas - 'text-blue-400', 'text-green-400', 'text-purple-400', 'text-red-400', - 'text-orange-400', 'text-indigo-400', 'text-yellow-400', 'text-white', - 'text-slate-300', 'text-slate-400', 'text-slate-500', - + "text-blue-400", + "text-green-400", + "text-purple-400", + "text-red-400", + "text-orange-400", + "text-indigo-400", + "text-yellow-400", + "text-white", + "text-slate-300", + "text-slate-400", + "text-slate-500", + // Backgrounds - 'bg-slate-700', 'bg-slate-800', 'bg-slate-900', 'bg-slate-700/50', 'bg-slate-800/30', - 'bg-slate-800/50', 'bg-slate-800/70', 'bg-white/5', 'bg-white/10', 'bg-white/20', - 'bg-black/20', - + "bg-slate-700", + "bg-slate-800", + "bg-slate-900", + "bg-slate-700/50", + "bg-slate-800/30", + "bg-slate-800/50", + "bg-slate-800/70", + "bg-white/5", + "bg-white/10", + "bg-white/20", + "bg-black/20", + // Borders - 'border-slate-600', 'border-slate-700', 'border-l-4', - + "border-slate-600", + "border-slate-700", + "border-l-4", + // Gradients - 'from-blue-500', 'to-blue-600', 'from-blue-600', 'via-purple-600', 'to-blue-800', - 'from-green-500', 'to-green-600', 'from-purple-500', 'to-purple-600', - 'from-orange-500', 'to-orange-600', 'from-red-500', 'to-red-600', - 'from-indigo-500', 'to-indigo-600', 'from-white', 'to-blue-200', - 'from-slate-700/50', 'to-slate-800/50', 'from-slate-600/50', 'to-slate-700/50', - 'from-transparent', 'via-white/20', 'to-transparent', - + "from-blue-500", + "to-blue-600", + "from-blue-600", + "via-purple-600", + "to-blue-800", + "from-green-500", + "to-green-600", + "from-purple-500", + "to-purple-600", + "from-orange-500", + "to-orange-600", + "from-red-500", + "to-red-600", + "from-indigo-500", + "to-indigo-600", + "from-white", + "to-blue-200", + "from-slate-700/50", + "to-slate-800/50", + "from-slate-600/50", + "to-slate-700/50", + "from-transparent", + "via-white/20", + "to-transparent", + // Animações - 'animate-spin', 'animate-pulse', 'animate-bounce', - + "animate-spin", + "animate-pulse", + "animate-bounce", + // Tamanhos e espaçamentos - 'w-4', 'w-5', 'w-6', 'w-8', 'w-10', 'w-12', 'w-48', 'w-64', 'w-80', - 'h-4', 'h-5', 'h-6', 'h-8', 'h-10', 'h-12', 'h-48', 'h-64', 'h-80', - 'max-w-7xl', 'max-h-80', - + "w-4", + "w-5", + "w-6", + "w-8", + "w-10", + "w-12", + "w-48", + "w-64", + "w-80", + "h-4", + "h-5", + "h-6", + "h-8", + "h-10", + "h-12", + "h-48", + "h-64", + "h-80", + "max-w-7xl", + "max-h-80", + // Flexbox e Grid - 'lg:col-span-2', 'md:grid-cols-2', 'lg:grid-cols-3', 'lg:grid-cols-4', 'lg:grid-cols-6', - 'grid-cols-2', 'grid-cols-3', - + "lg:col-span-2", + "md:grid-cols-2", + "lg:grid-cols-3", + "lg:grid-cols-4", + "lg:grid-cols-6", + "grid-cols-2", + "grid-cols-3", + // Responsividade - 'md:grid-cols-3', 'lg:grid-cols-6', - + "md:grid-cols-3", + "lg:grid-cols-6", + // Estados hover - 'hover:bg-slate-700/30', 'hover:bg-slate-800/70', 'hover:from-slate-600/50', - 'hover:to-slate-700/50', 'hover:scale-105', 'hover:shadow-2xl', - 'group-hover:opacity-100', 'group-hover:translate-x-full', - + "hover:bg-slate-700/30", + "hover:bg-slate-800/70", + "hover:from-slate-600/50", + "hover:to-slate-700/50", + "hover:scale-105", + "hover:shadow-2xl", + "group-hover:opacity-100", + "group-hover:translate-x-full", + // Transformações - 'scale-105', '-translate-x-full', 'translate-x-full', '-translate-y-32', - 'translate-x-32', 'translate-y-24', '-translate-x-24', - + "scale-105", + "-translate-x-full", + "translate-x-full", + "-translate-y-32", + "translate-x-32", + "translate-y-24", + "-translate-x-24", + // Backdrop - 'backdrop-blur-sm', - + "backdrop-blur-sm", + // Z-index - 'z-10', - + "z-10", + // Opacidade - 'opacity-90', 'opacity-100', - + "opacity-90", + "opacity-100", + // Transições - 'transition-all', 'transition-colors', 'transition-opacity', 'transition-transform', - 'duration-150', 'duration-200', 'duration-300', 'duration-700', + "transition-all", + "transition-colors", + "transition-opacity", + "transition-transform", + "duration-150", + "duration-200", + "duration-300", + "duration-700", ], theme: { extend: { colors: { // Cores específicas do VS Code (fallbacks para quando CSS vars não estão disponíveis) vscode: { - background: 'var(--vscode-editor-background, #1e1e1e)', - foreground: 'var(--vscode-editor-foreground, #cccccc)', - selection: 'var(--vscode-editor-selectionBackground, #264f78)', - hover: 'var(--vscode-list-hoverBackground, #2a2d2e)', - active: 'var(--vscode-list-activeSelectionBackground, #0e639c)', - border: 'var(--vscode-widget-border, #454545)', - accent: 'var(--vscode-focusBorder, #007acc)', - button: 'var(--vscode-button-background, #0e639c)', - buttonHover: 'var(--vscode-button-hoverBackground, #1177bb)', - input: 'var(--vscode-input-background, #3c3c3c)', - sidebar: 'var(--vscode-sideBar-background, #252526)', - panel: 'var(--vscode-panel-background, #1e1e1e)', + background: "var(--vscode-editor-background, #1e1e1e)", + foreground: "var(--vscode-editor-foreground, #cccccc)", + selection: "var(--vscode-editor-selectionBackground, #264f78)", + hover: "var(--vscode-list-hoverBackground, #2a2d2e)", + active: "var(--vscode-list-activeSelectionBackground, #0e639c)", + border: "var(--vscode-widget-border, #454545)", + accent: "var(--vscode-focusBorder, #007acc)", + button: "var(--vscode-button-background, #0e639c)", + buttonHover: "var(--vscode-button-hoverBackground, #1177bb)", + input: "var(--vscode-input-background, #3c3c3c)", + sidebar: "var(--vscode-sideBar-background, #252526)", + panel: "var(--vscode-panel-background, #1e1e1e)", }, // Cores do tema padrão para garantir consistência slate: { - 50: '#f8fafc', - 100: '#f1f5f9', - 200: '#e2e8f0', - 300: '#cbd5e1', - 400: '#94a3b8', - 500: '#64748b', - 600: '#475569', - 700: '#334155', - 800: '#1e293b', - 900: '#0f172a', - 950: '#020617', + 50: "#f8fafc", + 100: "#f1f5f9", + 200: "#e2e8f0", + 300: "#cbd5e1", + 400: "#94a3b8", + 500: "#64748b", + 600: "#475569", + 700: "#334155", + 800: "#1e293b", + 900: "#0f172a", + 950: "#020617", }, blue: { - 50: '#eff6ff', - 100: '#dbeafe', - 200: '#bfdbfe', - 300: '#93c5fd', - 400: '#60a5fa', - 500: '#3b82f6', - 600: '#2563eb', - 700: '#1d4ed8', - 800: '#1e40af', - 900: '#1e3a8a', - 950: '#172554', + 50: "#eff6ff", + 100: "#dbeafe", + 200: "#bfdbfe", + 300: "#93c5fd", + 400: "#60a5fa", + 500: "#3b82f6", + 600: "#2563eb", + 700: "#1d4ed8", + 800: "#1e40af", + 900: "#1e3a8a", + 950: "#172554", }, green: { - 400: '#4ade80', - 500: '#22c55e', - 600: '#16a34a', + 400: "#4ade80", + 500: "#22c55e", + 600: "#16a34a", }, red: { - 400: '#f87171', - 500: '#ef4444', - 600: '#dc2626', + 400: "#f87171", + 500: "#ef4444", + 600: "#dc2626", }, yellow: { - 400: '#facc15', - 500: '#eab308', - 600: '#ca8a04', + 400: "#facc15", + 500: "#eab308", + 600: "#ca8a04", }, purple: { - 400: '#a78bfa', - 500: '#8b5cf6', - 600: '#7c3aed', + 400: "#a78bfa", + 500: "#8b5cf6", + 600: "#7c3aed", }, orange: { - 400: '#fb923c', - 500: '#f97316', - 600: '#ea580c', + 400: "#fb923c", + 500: "#f97316", + 600: "#ea580c", }, indigo: { - 400: '#818cf8', - 500: '#6366f1', - 600: '#4f46e5', + 400: "#818cf8", + 500: "#6366f1", + 600: "#4f46e5", }, }, animation: { - 'spin': 'spin 1s linear infinite', - 'pulse': 'pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite', - 'bounce': 'bounce 1s infinite', + spin: "spin 1s linear infinite", + pulse: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite", + bounce: "bounce 1s infinite", }, fontFamily: { - mono: ['var(--vscode-editor-font-family, Consolas)', 'Monaco', 'Courier New', 'monospace'], - sans: ['var(--vscode-font-family, -apple-system)', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'sans-serif'], + mono: [ + "var(--vscode-editor-font-family, Consolas)", + "Monaco", + "Courier New", + "monospace", + ], + sans: [ + "var(--vscode-font-family, -apple-system)", + "BlinkMacSystemFont", + "Segoe UI", + "Roboto", + "sans-serif", + ], }, fontSize: { - 'vscode': 'var(--vscode-font-size, 13px)', + vscode: "var(--vscode-font-size, 13px)", }, }, }, plugins: [], -} \ No newline at end of file +}; diff --git a/packages/vscode-extension/src/webview-ui/tsconfig.json b/packages/vscode-extension/src/webview-ui/tsconfig.json index 7d6eab50..d3cd2b1a 100644 --- a/packages/vscode-extension/src/webview-ui/tsconfig.json +++ b/packages/vscode-extension/src/webview-ui/tsconfig.json @@ -15,4 +15,4 @@ }, "include": ["src"], // Ele só precisa "olhar" para a pasta src da UI "references": [{ "path": "./tsconfig.node.json" }] -} \ No newline at end of file +} diff --git a/packages/vscode-extension/src/webview-ui/tsconfig.node.json b/packages/vscode-extension/src/webview-ui/tsconfig.node.json index 9f33e70a..ed4e4832 100644 --- a/packages/vscode-extension/src/webview-ui/tsconfig.node.json +++ b/packages/vscode-extension/src/webview-ui/tsconfig.node.json @@ -8,4 +8,4 @@ "allowSyntheticDefaultImports": true }, "include": ["vite.config.ts", "postcss.config.js", "tailwind.config.js"] // Adicionei os outros arquivos de config aqui por boa prática -} \ No newline at end of file +} diff --git a/packages/vscode-extension/src/webview-ui/vite.config.ts b/packages/vscode-extension/src/webview-ui/vite.config.ts index 98418a52..d9f7768a 100644 --- a/packages/vscode-extension/src/webview-ui/vite.config.ts +++ b/packages/vscode-extension/src/webview-ui/vite.config.ts @@ -1,24 +1,24 @@ // packages/vscode-extension/src/webview-ui/vite.config.ts -import { defineConfig } from 'vite'; -import react from '@vitejs/plugin-react'; -import path from 'path'; +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react"; +import path from "path"; export default defineConfig({ - root: path.resolve(__dirname), - + root: path.resolve(__dirname), + // Configuração do CSS com PostCSS css: { - postcss: path.resolve(__dirname, 'postcss.config.js'), + postcss: path.resolve(__dirname, "postcss.config.js"), }, plugins: [react()], - + build: { - outDir: path.resolve(__dirname, '..', '..', 'dist', 'webview-ui'), + outDir: path.resolve(__dirname, "..", "..", "dist", "webview-ui"), manifest: true, rollupOptions: { // ... }, }, -}); \ No newline at end of file +}); diff --git a/packages/vscode-extension/tsconfig.json b/packages/vscode-extension/tsconfig.json index 56d7c6dd..aabf7348 100644 --- a/packages/vscode-extension/tsconfig.json +++ b/packages/vscode-extension/tsconfig.json @@ -4,7 +4,7 @@ "module": "CommonJS", "target": "ES2020", "outDir": "out", - "lib": ["ES2020", "DOM"], + "lib": ["ES2020", "DOM"], "sourceMap": true, "rootDir": "src", "strict": true, @@ -13,15 +13,9 @@ "allowSyntheticDefaultImports": true, "skipLibCheck": true, "types": ["jest", "node", "vscode"], - "declaration": false, - "composite": false + "declaration": false, + "composite": false }, "include": ["src/**/*"], - "exclude": [ - "node_modules", - "out", - "dist", - "**/*.test.ts", - "src/webview-ui" - ] -} \ No newline at end of file + "exclude": ["node_modules", "out", "dist", "**/*.test.ts", "src/webview-ui"] +}