refactor: Address PR review feedback on shared packages

- Standardize vitest to v4.0.16 across all packages
- Clean up type imports in events.ts (remove verbose inline casting)
- Expand skipDirs to support Python, Rust, Go, PHP, Gradle projects
- Document circular dependency prevention in @automaker/types
- Add comprehensive error handling documentation to @automaker/git-utils

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Kacper
2025-12-20 23:03:44 +01:00
parent 67788bee0b
commit 493c392422
6 changed files with 100 additions and 385 deletions

View File

@@ -2,19 +2,21 @@
* Event emitter for streaming events to WebSocket clients
*/
import type { EventType, EventCallback } from "@automaker/types";
// Re-export event types from shared package
export type { EventType, EventCallback } from "@automaker/types";
export type { EventType, EventCallback };
export interface EventEmitter {
emit: (type: import("@automaker/types").EventType, payload: unknown) => void;
subscribe: (callback: import("@automaker/types").EventCallback) => () => void;
emit: (type: EventType, payload: unknown) => void;
subscribe: (callback: EventCallback) => () => void;
}
export function createEventEmitter(): EventEmitter {
const subscribers = new Set<import("@automaker/types").EventCallback>();
const subscribers = new Set<EventCallback>();
return {
emit(type: import("@automaker/types").EventType, payload: unknown) {
emit(type: EventType, payload: unknown) {
for (const callback of subscribers) {
try {
callback(type, payload);
@@ -24,7 +26,7 @@ export function createEventEmitter(): EventEmitter {
}
},
subscribe(callback: import("@automaker/types").EventCallback) {
subscribe(callback: EventCallback) {
subscribers.add(callback);
return () => {
subscribers.delete(callback);