Skip to content

Conversation

@EhabY
Copy link
Collaborator

@EhabY EhabY commented Nov 14, 2025

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.

@EhabY EhabY force-pushed the remove-node-forge-dependency branch from efa4a61 to 72c86ae Compare November 14, 2025 09:57
@EhabY EhabY requested a review from code-asher November 14, 2025 10:28
Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

@EhabY EhabY force-pushed the remove-node-forge-dependency branch from 2ff6fef to bd045e9 Compare November 17, 2025 18:22
@EhabY EhabY merged commit fa2272a into coder:main Nov 17, 2025
3 checks passed
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