Skip to content

Commit 111cf67

Browse files
authored
Revert "fix: claude as an internal dependency (#1730)" (#1740)
1 parent 1239eec commit 111cf67

4 files changed

Lines changed: 4 additions & 55 deletions

File tree

packages/init/test/__setup__.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,10 @@ vi.mock("log-symbols", async () => {
3939

4040
vi.mock("fs", async () => {
4141
const memfs: typeof import("memfs") = await vi.importActual("memfs");
42-
const _fs: typeof import("node:fs") = await vi.importActual("node:fs");
43-
44-
// Create escape mechanism for realpathSync to allow the Claude SDK to initialize
45-
// The SDK calls realpathSync at module load time, which needs the real filesystem
46-
const realpathSync = (
47-
path: string | Buffer,
48-
options?: { encoding?: BufferEncoding },
49-
) => {
50-
try {
51-
return _fs.realpathSync(path, options);
52-
} catch {
53-
// If real fs fails, try memfs
54-
return memfs.fs.realpathSync(path, options);
55-
}
56-
};
5742

5843
return {
5944
...memfs.fs,
60-
realpathSync,
61-
default: {
62-
...memfs.fs,
63-
realpathSync,
64-
},
45+
default: memfs.fs,
6546
};
6647
});
6748

@@ -104,7 +85,6 @@ vi.mock("@anthropic-ai/claude-agent-sdk", () => {
10485
return {
10586
createClient: vi.fn(),
10687
Agent: vi.fn(),
107-
query: vi.fn(),
10888
};
10989
});
11090

packages/manager/test/__setup__.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,41 +40,28 @@ vi.mock("fs", async () => {
4040
const memfs: typeof import("memfs") = await vi.importActual("memfs");
4141
const _fs: typeof import("node:fs") = await vi.importActual("node:fs");
4242

43-
const realpathSyncFn = (
44-
path: string | Buffer,
45-
options?: { encoding?: BufferEncoding },
46-
) => {
47-
try {
48-
return _fs.realpathSync(path, options);
49-
} catch {
50-
// If real fs fails, try memfs
51-
return memfs.fs.realpathSync(path, options);
52-
}
53-
};
54-
5543
const readFileSync = escapeOnigurumaMethod(
5644
_fs.readFileSync,
5745
memfs.fs.readFileSync,
5846
);
5947
const statSync = escapeOnigurumaMethod(_fs.statSync, memfs.fs.statSync);
6048
const realpathSync = escapeOnigurumaMethod(
61-
realpathSyncFn,
49+
_fs.realpathSync,
6250
memfs.fs.realpathSync,
6351
);
6452

6553
const vscodeOnigurumaFix = {
6654
readFileSync,
6755
statSync,
56+
realpathSync,
6857
};
6958

7059
return {
7160
...memfs.fs,
7261
...vscodeOnigurumaFix,
73-
realpathSync,
7462
default: {
7563
...memfs.fs,
7664
...vscodeOnigurumaFix,
77-
realpathSync,
7865
},
7966
};
8067
});

packages/manager/vite.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export default defineConfig({
1212
"get-port",
1313
"node-fetch",
1414
"file-type",
15-
"@anthropic-ai/claude-agent-sdk",
1615
],
1716
}),
1817
],

packages/slice-machine/test/__setup__.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,27 +79,10 @@ afterAll(() => {
7979

8080
vi.mock("fs", async () => {
8181
const memfs: typeof import("memfs") = await vi.importActual("memfs");
82-
const _fs: typeof import("node:fs") = await vi.importActual("node:fs");
83-
84-
const realpathSync = (
85-
path: string | Buffer,
86-
options?: { encoding?: BufferEncoding },
87-
) => {
88-
try {
89-
return _fs.realpathSync(path, options);
90-
} catch {
91-
// If real fs fails, try memfs
92-
return memfs.fs.realpathSync(path, options);
93-
}
94-
};
9582

9683
return {
9784
...memfs.fs,
98-
realpathSync,
99-
default: {
100-
...memfs.fs,
101-
realpathSync,
102-
},
85+
default: memfs.fs,
10386
};
10487
});
10588

0 commit comments

Comments
 (0)