Skip to content

Remove deprecated npm packages, use Node.js built-in#96

Merged
hmlam merged 8 commits intodevfrom
copilot/switch-to-built-in-crypto
Feb 13, 2026
Merged

Remove deprecated npm packages, use Node.js built-in#96
hmlam merged 8 commits intodevfrom
copilot/switch-to-built-in-crypto

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

All three packages (hyco-ws, hyco-websocket, hyco-https) declared a dependency on the deprecated npm crypto shim package. Node.js provides crypto as a built-in module — the npm package is unnecessary.

Changes

  • Removed "crypto": "latest" from package.json in all three packages
  • Removed unused require('crypto') imports from three lib files that imported but never referenced it:
    • hyco-ws/lib/HybridConnectionWebSocketServer.js
    • hyco-websocket/lib/HybridConnectionsWebSocketRequest.js
    • hyco-https/lib/HybridConnectionHttpsServer.js
  • Added unit tests (createRelayToken.test.js) in each package validating HMAC-SHA256 token generation against the built-in module

The require('crypto') calls in the three index.js files are intentionally unchanged — they use crypto.createHmac() for SAS token generation and correctly resolve to the Node.js built-in.

Original prompt

This section details on the original issue you should resolve

<issue_title>Switch to built-in crypto library</issue_title>
<issue_description>I noticed that hyco-ws and hyco-websocket are both dependent on the crypto library. This library however is deprecated and should not be used.</issue_description>

<agent_instructions>Create a new branch and PR to switch from crypto library to built-in. Add a test as well</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…to module

Remove "crypto": "latest" from hyco-websocket, hyco-ws, and hyco-https
package.json files. The require('crypto') calls in source code already
resolve to the built-in Node.js crypto module. Add unit tests to verify
crypto functionality works correctly with the built-in module.

Co-authored-by: jbjordan <108886350+jbjordan@users.noreply.github.com>
Copilot AI changed the title [WIP] Switch to built-in crypto library Remove deprecated npm crypto package in favor of Node.js built-in Feb 13, 2026
Copilot AI requested a review from jbjordan February 13, 2026 20:03
The three lib files imported crypto but never used it. The three
index.js files correctly use require('crypto') for createHmac and
are left unchanged.

Co-authored-by: jbjordan <108886350+jbjordan@users.noreply.github.com>
Copilot AI changed the title Remove deprecated npm crypto package in favor of Node.js built-in Remove deprecated npm crypto package, use Node.js built-in Feb 13, 2026
@jbjordan jbjordan marked this pull request as ready for review February 13, 2026 21:54
@jbjordan jbjordan changed the title Remove deprecated npm crypto package, use Node.js built-in Remove deprecated npm packages, use Node.js built-in Feb 13, 2026
@hmlam hmlam merged commit 2b2fc1c into dev Feb 13, 2026
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.

Switch to built-in crypto library

4 participants

Comments