From 39714d9f0ab4724616bd02d2330e60305a3edad1 Mon Sep 17 00:00:00 2001 From: Eli Bates Date: Wed, 10 Jul 2024 13:56:35 +0400 Subject: [PATCH 1/2] Removes crypto dependency so this can be used in edge runtimes Crypto is built into node already https://medium.com/@vviital/you-dont-need-a-uuid-anymore-33cf7ab201d2 Removing cyrpto will allow this to run on cloudflare workers or vercel edge. Additionally added an optional param to LockAcquireConfig allowing someone to pass in their own UUID if they want (or if they don't have the built in crypto module) --- bun.lockb | Bin 48511 -> 48511 bytes src/lock.ts | 14 ++++++++++++-- src/types.ts | 5 +++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/bun.lockb b/bun.lockb index b9940e76a285e49006191400f9e7c813e4c552ba..a4bf3af59caafb814608756bb887996df3ffc09b 100755 GIT binary patch delta 1275 zcmezWi|PL_rVTqdWV2geu`x0rfLZ^{!1JPP3=9i3vl%yE>UV;q4ompr?ZbyJzPJq!Os8={{e`1 z1}0!Q6y@hkKAs>r`ACAu5WoVHWl|(2E2M~ku)qsZ1_mw$hK5f-S^!8-&H+jm03` Date: Wed, 10 Jul 2024 15:27:12 +0300 Subject: [PATCH 2/2] fix: rm crypto from dependencies --- bun.lockb | Bin 48511 -> 48171 bytes package.json | 1 - 2 files changed, 1 deletion(-) diff --git a/bun.lockb b/bun.lockb index a4bf3af59caafb814608756bb887996df3ffc09b..02727a53fa1dbf261ac66dbd7a78e730f525c270 100755 GIT binary patch delta 3806 zcmeH~YiyHM7{}kYYezd_I3VrnWQ7gtE>I}DbmOuW*am|!?j1wcfZ`lpW;6&)rI#U7 za2t|mtwGF!eprIaoGDp?=)wnF{50d2#amDlCE{gfF)UtU@%cY}J7%Z};0M2OlIQn7 z&;L2+eNQi^J@2(YbZ`Bpd)blO^6B2Q?s?5?`j;L}+psF5?~}7%ebhek)bLe%p}qa> zpH7}UuSg3Xue0g?^3&_a8Sl2gmQ?R#*Q6+cY}QoPmaJHwqUC$Jkj}oB)y!JSYGrk> zT3F3mUD4`1R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)LBX-90@Y7GbKd)fLvPJN} z`PoiTY3X{TJ>T0m{Kx%p793{XxY#mG?#tD?##yMtIA62K0p=Jll-lpxj8v*LD_6X< zSsKj~RL-)-Jlu)?Ic}E?=13>}iimCUrrF2oWt2?P(~_wwm8&fN0rL^Z0r5ZrkO(9J zlK}ckjR6d@!7_Y`4@$29bTqgHphLig0L^PYkO#~K=xA{=FcqMq%W=SXfQ~=M0O8WB zOq(5y(g?s8z@msW;00hYK*x!*0UUVpA!!)=Xuuzs4rBmy)JO-gIv^7`z8M4?Sb+)f z8>B+91TX{ZtPN$)I_M}Y2I$pY3Ty&40vmw!fCY%F0Kuwv%cshN<+$>)VfMp#`)RpG zWz_4!bb9N_@}CC{w;#!e6~20WgI=v2KjgV)g=UDp@{HF$M!kL!qMzu<> z3#V#fKcsiRv8UQ6_WZsFH6?OTmFIB#q5gMw!k2#Q@96NL{*a8X@>HFZ^Qt^uzuL|H v75l1XX;qwTs%momgq9ul{b}pg-AR5!Yy$`l3AGhM(0l27%GcU*B3J!4*Gf2@ diff --git a/package.json b/package.json index f5c20ce..859b286 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "@types/node": "^20.8.9", "@upstash/redis": "^1.24.1", "bun-types": "^1.0.7", - "crypto": "^1.0.1", "tsup": "^7.2.0", "typescript": "^5.2.2" },