vscode-coder
vscode-coder copied to clipboard
Remove node forge dependency
Replaced the node-forge dependency with @peculiar/x509, which is more modern, lightweight, and still widely adopted (600K+ downloads). I initially attempted to use Node.js's built-in crypto module, but encountered an issue where keyUsage consistently returned undefined in Electron environments.
Testing in Electron Environments
Added comprehensive testing for Electron environments. In the latest commit, all vitest tests now run in Electron, which mirrors the environment VS Code operates in. This introduces a few seconds of additional overhead compared to running them in pure NodeJS env. An alternative approach would be to create a separate command (e.g., yarn test:electron) that runs only the relevant tests in Electron, but this is less robust and could result in missed test coverage as the codebase evolves.
I also explored running these as VS Code integration tests, but this approach has significant limitations. It would require converting the test suite to Mocha and rewriting tests to use VS Code API calls, which would make it difficult to write focused unit tests.
Electron Dependency
Added electron as a dev dependency to ensure proper BoringSSL usage (rather than OpenSSL, which Node.js uses). Note that the current version is the latest release, while VS Code may be running an older version. We should consider pinning to an older Electron version that more closely matches VS Code's environment.