mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 08:33:36 +00:00
refactor: consolidate shared packages and eliminate code duplication
- Update 26+ files to import secureFs from @automaker/platform - Create shared type files: github.ts, worktree.ts, claude.ts in libs/types - Create exec-utils.ts for cross-platform shell execution - Delete redundant wrapper files: secure-fs.ts, stream-processor.ts, enhancement-prompts.ts - Update GitHub routes to use createLogError pattern - Add isENOENT helper to routes/common.ts - Fix test imports to use @automaker/prompts and @automaker/platform 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,10 +10,16 @@ vi.mock('child_process', () => ({
|
||||
execSync: vi.fn(),
|
||||
}));
|
||||
|
||||
// Mock secure-fs
|
||||
vi.mock('@/lib/secure-fs.js', () => ({
|
||||
access: vi.fn(),
|
||||
}));
|
||||
// Mock secure-fs from @automaker/platform
|
||||
vi.mock('@automaker/platform', async () => {
|
||||
const actual = await vi.importActual('@automaker/platform');
|
||||
return {
|
||||
...actual,
|
||||
secureFs: {
|
||||
access: vi.fn(),
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
// Mock net
|
||||
vi.mock('net', () => ({
|
||||
@@ -24,7 +30,7 @@ vi.mock('net', () => ({
|
||||
}));
|
||||
|
||||
import { spawn, execSync } from 'child_process';
|
||||
import * as secureFs from '@/lib/secure-fs.js';
|
||||
import { secureFs } from '@automaker/platform';
|
||||
import net from 'net';
|
||||
|
||||
describe('dev-server-service.ts', () => {
|
||||
|
||||
Reference in New Issue
Block a user