mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
chore: Enhance type safety and improve code consistency across components
- Added a new `typecheck` script in `package.json` for better type checking in the UI workspace. - Refactored several components to remove unnecessary type assertions and improve type safety, particularly in `new-project-modal.tsx`, `edit-project-dialog.tsx`, and `task-progress-panel.tsx`. - Updated event handling in `git-diff-panel.tsx` to use async functions for better error handling. - Improved type definitions in various files, including `setup-view` and `electron.ts`, to ensure consistent usage of types across the codebase. - Cleaned up global type definitions for better clarity and maintainability. These changes aim to streamline the development process and reduce potential runtime errors.
This commit is contained in:
@@ -348,7 +348,7 @@ export async function setupMockProjectWithFeatures(
|
||||
|
||||
// Also store features in a global variable that the mock electron API can use
|
||||
// This is needed because the board-view loads features from the file system
|
||||
(window as any).__mockFeatures = mockFeatures;
|
||||
(window as { __mockFeatures?: unknown[] }).__mockFeatures = mockFeatures;
|
||||
|
||||
// Disable splash screen in tests
|
||||
sessionStorage.setItem('automaker-splash-shown', 'true');
|
||||
@@ -395,7 +395,9 @@ export async function setupMockProjectWithContextFile(
|
||||
// Set up mock file system with a context file for the feature
|
||||
// This will be used by the mock electron API
|
||||
// Now uses features/{id}/agent-output.md path
|
||||
(window as any).__mockContextFile = {
|
||||
(
|
||||
window as { __mockContextFile?: { featureId: string; path: string; content: string } }
|
||||
).__mockContextFile = {
|
||||
featureId,
|
||||
path: `/mock/test-project/.automaker/features/${featureId}/agent-output.md`,
|
||||
content: contextContent,
|
||||
@@ -455,7 +457,7 @@ export async function setupMockProjectWithInProgressFeatures(
|
||||
|
||||
// Also store features in a global variable that the mock electron API can use
|
||||
// This is needed because the board-view loads features from the file system
|
||||
(window as any).__mockFeatures = mockFeatures;
|
||||
(window as { __mockFeatures?: unknown[] }).__mockFeatures = mockFeatures;
|
||||
}, options);
|
||||
}
|
||||
|
||||
@@ -687,7 +689,9 @@ export async function setupMockProjectWithAgentOutput(
|
||||
|
||||
// Set up mock file system with output content for the feature
|
||||
// Now uses features/{id}/agent-output.md path
|
||||
(window as any).__mockContextFile = {
|
||||
(
|
||||
window as { __mockContextFile?: { featureId: string; path: string; content: string } }
|
||||
).__mockContextFile = {
|
||||
featureId,
|
||||
path: `/mock/test-project/.automaker/features/${featureId}/agent-output.md`,
|
||||
content: outputContent,
|
||||
@@ -747,7 +751,7 @@ export async function setupMockProjectWithWaitingApprovalFeatures(
|
||||
localStorage.setItem('automaker-storage', JSON.stringify(mockState));
|
||||
|
||||
// Also store features in a global variable that the mock electron API can use
|
||||
(window as any).__mockFeatures = mockFeatures;
|
||||
(window as { __mockFeatures?: unknown[] }).__mockFeatures = mockFeatures;
|
||||
}, options);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user