-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/multi UI workflow architecture #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Complete migration of CLI and VS Code extension to use shared workflows from @stackcode/core. ## Core Changes - Added centralized workflow system in packages/core/src/workflows.ts - All operations (init, generate, commit, validate, git, release) now use shared workflows - Standardized GitHub API integration with consistent error handling - Enhanced type definitions and comprehensive test coverage ## CLI Modernization - Created CLIAuthManager for secure GitHub token management - Refactored all commands to delegate to core workflows - Removed Configstore dependency in favor of secure file-based token storage - Added comprehensive smoke testing script (scripts/test-cli-commands.sh) ## VS Code Extension Updates - Updated all commands to use core workflows maintaining UI integration - Preserved OAuth2 authentication while standardizing backend operations - Enhanced dashboard and webview integration with shared data layer ## Benefits Achieved - ✅ Consistent behavior across CLI and VS Code interfaces - ✅ Single source of truth for all core operations - ✅ Improved security with proper token management - ✅ Comprehensive test coverage and automated validation - ✅ Enhanced maintainability and code reuse All tests passing. Ready for multi-interface workflow usage.
- Create shared @stackcode/github-auth package with provider-based architecture - Add CLI and VS Code authentication providers with secure token storage - Refactor CLI commands (github, release, ui) to use async authentication facade - Replace VS Code GitHubAuthService with unified auth integration - Align Octokit dependencies and TypeScript project references - Add comprehensive tests for CLI authentication provider - Implement file-based token storage with secure permissions - Support optional token sharing between CLI and VS Code environments Breaking changes: - CLI authentication methods now async (login, logout, getSession) - VS Code authentication service API updated for shared module integration
- Create runIssuesWorkflow() for unified GitHub issues fetching - Add cache management functions (clear, clearExpired, clearRepository) - Implement progress reporting hooks for UI feedback - Add cache statistics and monitoring functions - Export all issues workflow types and interfaces - Update fetchRepositoryIssues() with English docstrings - Add createGitHubRelease() docstring This centralizes all issues business logic in @stackcode/core, enabling consistent behavior across CLI and VS Code extension.
- Update CommitCommand to use runIssuesWorkflow() from core - Update DashboardProvider to use runIssuesWorkflow() from core - Simplify GitHubIssuesService to thin wrapper (marked deprecated) - Remove GitHubIssuesService instantiation from extension.ts - Replace service dependency with GitMonitor in commands This eliminates code duplication and ensures consistent GitHub issues handling between CLI and VS Code extension.
- Add comprehensive docstrings to all release.ts functions - Remove inline comments from workflows.ts for cleaner code - Remove Portuguese comments from vite.config.ts - Update dashboard title from 'Dashboard' to 'StackCode Dashboard' Improves code documentation quality and removes unnecessary comments throughout the codebase.
- Add missing await on getAuthenticatedClient() call - Fixes type error: Promise<Octokit> cannot be used where Octokit is expected Resolves async/await issue preventing GitHub release creation.
- Remove Portuguese comments from github.ts command - Remove Portuguese comments from release.ts command - Ensure all documentation is in English Maintains consistent English-only documentation across CLI.
- Rebuild CLI dist after documentation improvements - Rebuild core dist after issues workflow implementation - Rebuild VS Code extension out after service refactoring - Remove obsolete IMPLEMENTATION.md documentation Updates compiled artifacts to reflect all source code changes.
…k system - Add centralized ProgressManager service for workflow progress tracking - Create progress event types and state management system - Implement ProgressIndicator React component for visual feedback - Add useProgress hook for webview state management - Integrate progress tracking in CommitCommand and ReleaseCommand - Update DashboardProvider to implement WebviewProgressListener - Add real-time progress updates for issues, commit, and release workflows - Implement loading states with spinner, progress bar, and percentage - Add i18n keys for progress messages and UI feedback - Clean up code: remove unnecessary comments, logs, and backup files - Add comprehensive docstrings in English for all new components Breaking Changes: - Commands now require ProgressManager instance - DashboardProvider constructor signature changed to include ProgressManager Closes: Visual integration validation task Implements: Progress feedback for multi-UI workflow architecture
- Parallelize GitHub Actions CI jobs using matrix strategy (60% faster) - Remove 45+ redundant comments across extension codebase - Translate all Portuguese docstrings to English - Fix 8 ESLint violations (prefer-const, no-useless-escape, no-empty, no-unused-vars) - Configure Jest to exclude webview-ui from coverage collection - Prevent mock file duplication by excluding from TypeScript compilation - Add .prettierignore to exclude generated files (out/, coverage/, node_modules/) - Fix empty catch blocks with proper error logging Performance improvements: - CI runtime reduced from ~8-10min to ~3-4min - Tests now run cleanly without warnings Code quality: - All docstrings standardized in English - ESLint: 0 errors - Prettier: 100% formatted - Tests: 75 passing (CLI + Core + Extension)
- Apply Prettier formatting to all packages - Standardize code style and indentation - Fix ESLint warnings in test files - Update package.json formatting Affected packages: - @stackcode/cli - @stackcode/core - @stackcode/github-auth
- Recompile extension with latest changes - Remove duplicate mock files from out/ directory - Update source maps
- Add install-test-deps.sh for dependency installation - Add run-extension-tests.sh for running all extension tests - Make scripts executable
- Add packages/vscode-extension/coverage/ to .gitignore - Prevent committing test coverage reports
…dules - Split monolithic workflows.ts into 6 specialized modules: - workflows/generate.ts: Template generation workflows - workflows/git.ts: Git branch and commit workflows - workflows/init.ts: Project initialization workflows - workflows/release.ts: Version release workflows - workflows/validate.ts: Validation workflows - workflows/index.ts: Centralized exports - Update index.ts to re-export from new workflow modules - Maintain backward compatibility with existing API - Improve maintainability and separation of concerns
- Update import paths to use new workflow module structure - Ensure all existing functionality is properly tested - Maintain 100% test coverage for core package (29/29 tests passing)
- Add explicit type annotations for workflow progress callbacks - Fix implicit 'any' type errors in CommitCommand.ts and GitCommand.ts - Ensure type safety for workflow progress reporting - Maintain proper TypeScript strict mode compliance
- Properly restore workspace folder state in integration tests - Fix async/await patterns for reliable test execution - Ensure clean test isolation and proper cleanup - Achieve 100% test coverage (24/24 tests passing) for VSCode extension
- Document new modular workflow architecture in all languages - Update pt-BR translation with complete architecture details - Update es translation with complete architecture details - Explain separation of concerns across workflow modules - Update module dependency diagrams and descriptions - Provide clear guidance for maintaining the new structure
- Remove empty commands.integration.test.ts file - Remove empty extension.smoke.test.ts file - Fix Jest test suite execution errors - Ensure clean test runs with 24/24 tests passing
Moved issues-workflow.ts into the /workflows directory to align with the new scalable architecture. This change centralizes all workflow orchestration logic, improving consistency and maintainability across the codebase. - Moved to . - Updated all relevant imports and exports to reflect the new file location. - Ensured backward compatibility by re-exporting from the legacy path.
Fixed relative import path after moving issues workflow to the workflows directory. Changed './github.js' to '../github.js' to properly reference the github module from the workflows subdirectory.
Fixed code style issues in workflows.ts and git.ts to comply with Prettier standards.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📋 Description
This PR implements a comprehensive scalable workflow architecture that enables multiple user interfaces (CLI and VS Code Extension) to share the same business logic without code duplication. This architectural refactoring establishes a clear separation between UI interaction layers and core business logic orchestration.
Key Architectural Changes
Workflow Layer Introduction (
@stackcode/core/workflows/)init.ts- Project initialization workflowsgenerate.ts- File generation workflows (README, .gitignore)validate.ts- Validation workflows (commit messages, project structure)git.ts- Git operations (commit, branch management)release.ts- Version management and release workflowsissues.ts- GitHub issues fetching with cachingUnified GitHub Authentication
@stackcode/github-authpackageCLI Modernization
VS Code Extension Updates
Code Quality Improvements
CI/CD Optimization
Benefits Achieved
✅ Zero Code Duplication - Business logic implemented once, used by all UIs
✅ Consistent Behavior - Same workflows ensure identical behavior across interfaces
✅ Easy Testing - Workflows testable independently without UI dependencies
✅ Future-Proof - Easy to add new UIs (web dashboard, mobile app, etc.)
✅ Better Maintainability - Clear separation of concerns and modular architecture
✅ Type Safety - Comprehensive TypeScript types for all workflows
✅ Progress Reporting - Hook-based system for UI-agnostic progress updates
🔗 Related Issue
Fixes #52
🧪 Type of Change
📝 How Has This Been Tested?
scripts/test-cli-commands.shTest Coverage
📷 Screenshots (if applicable)
N/A - This is an architectural refactoring that maintains existing UI/UX
✅ Checklist
🔄 Dependencies
New Package Created
@stackcode/github-auth- Shared authentication layerUpdated Dependencies
📚 Additional Notes
Breaking Changes
CLI Authentication API
VS Code Command Constructors
Migration Guide
All breaking changes are internal to the architecture. External users of the CLI and VS Code extension will not notice any changes in behavior or interface.
For developers extending StackCode:
@stackcode/coreExample:
Future Enhancements
This architecture enables:
All future UIs can reuse the same core workflows without duplicating business logic.
Issue Reference: Closes #52