Skip to content

refactor: simplify shimExecFile by removing type casts and promisify#880

Closed
jeremyruppel wants to merge 4 commits intofix/windows-cross-platform-compatfrom
jeremyruppel/simplify-execfile-shim
Closed

refactor: simplify shimExecFile by removing type casts and promisify#880
jeremyruppel wants to merge 4 commits intofix/windows-cross-platform-compatfrom
jeremyruppel/simplify-execfile-shim

Conversation

@jeremyruppel
Copy link
Copy Markdown

I noticed promisify was adding some complexity and making strict typing difficult in this test. This uses Reflect.apply and a generic type parameter instead of as unknown as chains. Also replaces promisify usage in tests with plain Promise callbacks, which eliminates the need for the promisify custom symbol wrapping entirely.

Claude helped 🤖 reviewed by me

EhabY and others added 3 commits April 9, 2026 14:18
…t electron path

Unix-style `VAR=value` syntax in npm scripts doesn't work on Windows.
Added cross-env to build:production, test, test:extension, and test:webview scripts.
Changed vitest.nodeExecutable to point to the actual electron binary instead of
the .bin shim, which doesn't resolve on Windows (only electron.cmd exists there).
- speedtest tests: use process.execPath instead of .cmd wrapper since
  execFile cannot spawn .cmd files on Windows (EINVAL)
- sshProcess tests: use path.join for expected log paths so separators
  match the OS (backslashes on Windows, forward slashes on Unix)
- Build integration tests on project build.
…handling

Use Reflect.apply and a generic type parameter instead of `as unknown as`
chains. Replace promisify usage in tests with plain Promise callbacks,
which eliminates the need for the promisify custom symbol wrapping entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeremyruppel jeremyruppel requested a review from EhabY April 10, 2026 15:16
@jeremyruppel jeremyruppel force-pushed the jeremyruppel/simplify-execfile-shim branch from 1adad24 to f45cc1c Compare April 10, 2026 15:19
@EhabY EhabY force-pushed the fix/windows-cross-platform-compat branch from 0121302 to 12b454f Compare April 10, 2026 16:48
@EhabY
Copy link
Copy Markdown
Collaborator

EhabY commented Apr 10, 2026

Ah actually the reflect usage seems much cleaner than casting as unknown, I've extract what I can from this in a commit here: ee9f912

@EhabY EhabY force-pushed the fix/windows-cross-platform-compat branch from 252a255 to d57a977 Compare April 10, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants