Skip to content

Commit

Permalink
Fix example type checking and execution on Windows (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianbollinger authored Sep 23, 2024
1 parent d2ed71c commit 8959440
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/brown-seahorses-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/docgen": patch
---

Fixes the type checking and execution of examples on Windows
12 changes: 8 additions & 4 deletions src/Core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,10 @@ const runTscOnExamples = Effect.gen(function*(_) {
const platform = yield* _(process.platform)

const tsconfig = path.normalize(path.join(cwd, config.outDir, "examples", "tsconfig.json"))
const exe = platform === "win32" ? "tsc.cmd" : "tsc"
const command = Command.make(exe, "--noEmit", "--project", tsconfig)
const options = ["--noEmit", "--project", tsconfig]
const command = platform === "win32"
? Command.runInShell(Command.make("tsc.cmd", ...options), true)
: Command.make("tsc", ...options)

yield* _(Effect.logDebug("Running tsc on examples..."))

Expand Down Expand Up @@ -316,8 +318,10 @@ const runTsxOnExamples = Effect.gen(function*(_) {
const examples = path.normalize(path.join(cwd, config.outDir, "examples"))
const tsconfig = path.join(examples, "tsconfig.json")
const index = path.join(examples, "index.ts")
const exe = platform === "win32" ? "tsx.cmd" : "tsx"
const command = Command.make(exe, "--tsconfig", tsconfig, index)
const options = ["--tsconfig", tsconfig, index]
const command = platform === "win32"
? Command.runInShell(Command.make("tsx.cmd", ...options), true)
: Command.make("tsx", ...options)

yield* _(Effect.logDebug("Running tsx on examples..."))

Expand Down

0 comments on commit 8959440

Please sign in to comment.