Repository navigation
Avoid using deprecated Buffer constructor - #490
Open
mbianchidev wants to merge 9 commits into
Open
mbianchidev wants to merge 9 commits into
mbianchidev wants to merge 9 commits into
Conversation
Co-authored-by: mbianchidev <37507190+mbianchidev@users.noreply.github.com>
Co-authored-by: mbianchidev <37507190+mbianchidev@users.noreply.github.com>
Co-authored-by: mbianchidev <37507190+mbianchidev@users.noreply.github.com>
Co-authored-by: mbianchidev <37507190+mbianchidev@users.noreply.github.com>
…recated Avoid deprecated Buffer constructors in runtime dependencies
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add the required .licenses/npm entries for patch-package and its production-reachable transitive dependencies.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Updates runtime dependencies to replace deprecated Buffer constructors and validates the patched dependencies under strict deprecation handling.
Changes:
- Adds
patch-packagewith automatic post-install patching. - Patches
binary,buffers,tunnel, andunzip-stream. - Updates bundled code and adds dependency tests.
- Requires license cache entries for the new production dependency tree.
| File | Description |
|---|---|
patches/unzip-stream+0.3.4.patch |
Replaces deprecated Buffer usage. |
patches/tunnel+0.0.6.patch |
Replaces deprecated Buffer usage. |
patches/buffers+0.1.1.patch |
Replaces deprecated Buffer usage. |
patches/binary+0.3.0.patch |
Replaces deprecated Buffer usage. |
package.json |
Adds patch-package and post-install patching; license cache entries are missing. |
package-lock.json |
Locks the new dependency tree. |
dist/index.js |
Includes patched bundled code. |
__tests__/dependencies.test.ts |
Tests dependencies under strict deprecation handling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: mbianchidev <37507190+mbianchidev@users.noreply.github.com>
…nse-cache Add patch-package license cache
13 of 35 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This pull request addresses the use of deprecated
Bufferconstructors in several runtime dependencies by applying targeted patches and adding automated tests to ensure compliance. It also introducespatch-packageas a dependency and configures it to run automatically after installation.Dependency modernization and maintenance:
patch-packageas a dependency and configured it to run automatically after install via thepostinstallscript inpackage.json. This ensures that necessary patches are always applied to dependencies after installation.Patching runtime dependencies to avoid deprecated Buffer usage:
binary,buffers,tunnel, andunzip-streampackages to replace deprecatednew Buffer()and similar patterns with the recommendedBuffer.from()andBuffer.alloc()APIs, ensuring compatibility with newer Node.js versions and preventing deprecation warnings or errors.Testing and validation:
__tests__/dependencies.test.ts) that verifies the patched dependencies (unzip-stream,binary,buffers, andtunnel) do not trigger deprecated Buffer warnings or errors when run with strict deprecation flags, ensuring the effectiveness of the applied patches.