diff --git a/oxlint-plugin-t3code/package.json b/oxlint-plugin-t3code/package.json index dbcd2c510f08..23af23738169 100644 --- a/oxlint-plugin-t3code/package.json +++ b/oxlint-plugin-t3code/package.json @@ -14,6 +14,7 @@ "devDependencies": { "@effect/language-service": "catalog:", "@effect/vitest": "catalog:", + "@t3tools/shared": "workspace:*", "@types/bun": "catalog:", "typescript": "catalog:", "vite-plus": "catalog:", diff --git a/oxlint-plugin-t3code/test/utils.ts b/oxlint-plugin-t3code/test/utils.ts index eb91d32d7d46..086d8d814ff8 100644 --- a/oxlint-plugin-t3code/test/utils.ts +++ b/oxlint-plugin-t3code/test/utils.ts @@ -1,4 +1,5 @@ import * as NodeServices from "@effect/platform-node/NodeServices"; +import { resolveWindowsSpawn } from "@t3tools/shared/shell"; import { assert, it } from "@effect/vitest"; import * as Data from "effect/Data"; import * as Effect from "effect/Effect"; @@ -112,8 +113,12 @@ export const createOxlintRuleHarness = ( ); yield* fs.writeFileString(sourcePath, source); + const spawn = resolveWindowsSpawn(oxlintBin); const output = yield* spawnAndCollectOutput( - ChildProcess.make(oxlintBin, ["--config", configPath, sourcePath], { cwd: repoRoot }), + ChildProcess.make(spawn.command, ["--config", configPath, sourcePath], { + cwd: repoRoot, + shell: spawn.shell, + }), ); if (output.exitCode !== 0) { diff --git a/packages/effect-acp/package.json b/packages/effect-acp/package.json index 830c4aa45158..be64a6e58bbd 100644 --- a/packages/effect-acp/package.json +++ b/packages/effect-acp/package.json @@ -45,6 +45,7 @@ "@effect/openapi-generator": "catalog:", "@effect/platform-node": "catalog:", "@effect/vitest": "catalog:", + "@t3tools/shared": "workspace:*", "@types/node": "catalog:", "typescript": "catalog:", "vite-plus": "catalog:", diff --git a/packages/effect-acp/src/client.test.ts b/packages/effect-acp/src/client.test.ts index b867231ad7eb..04a5568e5349 100644 --- a/packages/effect-acp/src/client.test.ts +++ b/packages/effect-acp/src/client.test.ts @@ -12,6 +12,7 @@ import * as Stream from "effect/Stream"; import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; import * as NodeServices from "@effect/platform-node/NodeServices"; +import { resolveWindowsSpawn } from "@t3tools/shared/shell"; import { it, assert } from "@effect/vitest"; import * as AcpClient from "./client.ts"; @@ -34,9 +35,10 @@ it.layer(NodeServices.layer)("effect-acp client", (it) => { Effect.gen(function* () { const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; const path = yield* Path.Path; - const command = ChildProcess.make("bun", ["run", yield* mockPeerPath], { + const spawn = resolveWindowsSpawn("bun"); + const command = ChildProcess.make(spawn.command, ["run", yield* mockPeerPath], { cwd: path.join(import.meta.dirname, ".."), - shell: process.platform === "win32", + shell: spawn.shell, ...(env ? { env: { ...process.env, ...env } } : {}), }); return yield* spawner.spawn(command); diff --git a/packages/effect-acp/src/protocol.test.ts b/packages/effect-acp/src/protocol.test.ts index 392b61431e6e..96ce2634889c 100644 --- a/packages/effect-acp/src/protocol.test.ts +++ b/packages/effect-acp/src/protocol.test.ts @@ -11,6 +11,7 @@ import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; import { it, assert } from "@effect/vitest"; import * as NodeServices from "@effect/platform-node/NodeServices"; +import { resolveWindowsSpawn } from "@t3tools/shared/shell"; import * as AcpSchema from "./_generated/schema.gen.ts"; import * as AcpProtocol from "./protocol.ts"; @@ -58,9 +59,10 @@ const makeHandle = (env?: Record) => Effect.gen(function* () { const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; const path = yield* Path.Path; - const command = ChildProcess.make("bun", ["run", yield* mockPeerPath], { + const spawn = resolveWindowsSpawn("bun"); + const command = ChildProcess.make(spawn.command, ["run", yield* mockPeerPath], { cwd: path.join(import.meta.dirname, ".."), - shell: process.platform === "win32", + shell: spawn.shell, ...(env ? { env: { ...process.env, ...env } } : {}), }); return yield* spawner.spawn(command); diff --git a/packages/effect-codex-app-server/package.json b/packages/effect-codex-app-server/package.json index 7c8fa1d86251..798ce496fd94 100644 --- a/packages/effect-codex-app-server/package.json +++ b/packages/effect-codex-app-server/package.json @@ -38,6 +38,7 @@ "@effect/openapi-generator": "catalog:", "@effect/platform-node": "catalog:", "@effect/vitest": "catalog:", + "@t3tools/shared": "workspace:*", "@types/node": "catalog:", "typescript": "catalog:", "vite-plus": "catalog:", diff --git a/packages/effect-codex-app-server/src/client.test.ts b/packages/effect-codex-app-server/src/client.test.ts index 0e0127b1a94f..8d1890a442e2 100644 --- a/packages/effect-codex-app-server/src/client.test.ts +++ b/packages/effect-codex-app-server/src/client.test.ts @@ -7,6 +7,7 @@ import * as Scope from "effect/Scope"; import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"; import * as NodeServices from "@effect/platform-node/NodeServices"; +import { resolveWindowsSpawn } from "@t3tools/shared/shell"; import { assert, it } from "@effect/vitest"; import * as CodexClient from "./client.ts"; @@ -20,9 +21,10 @@ it.layer(NodeServices.layer)("effect-codex-app-server client", (it) => { Effect.gen(function* () { const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; const path = yield* Path.Path; - const command = ChildProcess.make("bun", ["run", yield* mockPeerPath], { + const spawn = resolveWindowsSpawn("bun"); + const command = ChildProcess.make(spawn.command, ["run", yield* mockPeerPath], { cwd: path.join(import.meta.dirname, ".."), - shell: process.platform === "win32", + shell: spawn.shell, }); return yield* spawner.spawn(command); }); @@ -126,10 +128,12 @@ it.layer(NodeServices.layer)("effect-codex-app-server client", (it) => { Effect.gen(function* () { const path = yield* Path.Path; const scope = yield* Scope.make(); + const spawn = resolveWindowsSpawn("bun"); const clientLayer = CodexClient.layerCommand({ - command: "bun", + command: spawn.command, args: ["run", yield* mockPeerPath], cwd: path.join(import.meta.dirname, ".."), + shell: spawn.shell, }); const context = yield* Layer.buildWithScope(clientLayer, scope); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4d1f5e68e9c5..0206eb497de7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -651,6 +651,9 @@ importers: '@effect/vitest': specifier: 4.0.0-beta.78 version: 4.0.0-beta.78(patch_hash=42b87cc47e70d74e62496e7a8261b3fd298ecad4464d209348ab04b96f853a5f)(effect@4.0.0-beta.78(patch_hash=c502bc684210b707dfceb87d8fe6ad6843395af6e19cfc02cd65854898bde2c5)) + '@t3tools/shared': + specifier: workspace:* + version: link:../packages/shared '@types/bun': specifier: 'catalog:' version: 1.3.14 @@ -735,6 +738,9 @@ importers: '@effect/vitest': specifier: 4.0.0-beta.78 version: 4.0.0-beta.78(patch_hash=42b87cc47e70d74e62496e7a8261b3fd298ecad4464d209348ab04b96f853a5f)(effect@4.0.0-beta.78(patch_hash=c502bc684210b707dfceb87d8fe6ad6843395af6e19cfc02cd65854898bde2c5)) + '@t3tools/shared': + specifier: workspace:* + version: link:../shared '@types/node': specifier: ^24.10.13 version: 24.13.2 @@ -766,6 +772,9 @@ importers: '@effect/vitest': specifier: 4.0.0-beta.78 version: 4.0.0-beta.78(patch_hash=42b87cc47e70d74e62496e7a8261b3fd298ecad4464d209348ab04b96f853a5f)(effect@4.0.0-beta.78(patch_hash=c502bc684210b707dfceb87d8fe6ad6843395af6e19cfc02cd65854898bde2c5)) + '@t3tools/shared': + specifier: workspace:* + version: link:../shared '@types/node': specifier: ^24.10.13 version: 24.13.2