feat: Vendor prod dependency on json-stringify-safe#2910
Conversation
…copy The `nock` project had 2 dependencies - `@mswjs/interceptors`: The network interception library - `json-stringify-safe`: A 30 line json stringify library. This commit replaced the prod dependency on `json-stringify-safe`, with a vendored copy. The modifications I added ate formatting and linting
7c867ee to
39f858d
Compare
Uzlopak
left a comment
There was a problem hiding this comment.
I thought about it. I did not check if json-stringify-safe has unit tests, which you did not integrated. Anyhow it is not important. It only makes sense to vendorize it as is, if you need all Features. If not, i actually recommend to remove branches, which you dont need.
stringify is called always with one parameter, so second and third parameter are unused. So you remove those branches, and have a straight forward solution.
|
@svix-mman |
Looks good to me 👍. Thanks for writing the test suite 😅 Please let me know if you need anything else on my end. |
|
fun fact... i let copilot and chatGPT create the tests.. lol |
|
@Uzlopak I guess I was too late for |
|
Well, actually i wanted to merge main into beta. there was a merge conflict. So i tried to solve it in vcode, and for some reason i basically pushed on to main. Well, we have now nock 15 🚀 |
|
@svix-mman Thanks! |
|
thanks! |
|
🎉 This PR is included in version 15.0.0-beta.10 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The
nockproject had 2 dependencies (In the beta branch)@mswjs/interceptors: The network interception libraryjson-stringify-safe: A 30 line json stringify library.This PR proposes to replace the prod dependency on
json-stringify-safe, with a vendored copy.The modifications I added ate formatting and linting
The
json-stringify-safelibrary is only 30 lines, and is permissively licensed (ISC).The goal here is to reduce the number of NPM packages I transiently depend on, and this one seems like a low hanging fruit.
The source for
json-stringify-safehas not changed for the last 10 years, so I feel confident that we won't miss impotent updates by vendoring this dependency