@costrict/csc 4.0.4 → 4.0.5-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (425) hide show
  1. package/README.md +398 -398
  2. package/dist/{chunk-ndcrbqq2.js → chunk-012zb121.js} +57 -57
  3. package/dist/{chunk-tyxhcbsd.js → chunk-01kp42d3.js} +1 -1
  4. package/dist/{chunk-pn0k5wak.js → chunk-03qpgz7e.js} +749 -23
  5. package/dist/{chunk-jvgc4q2b.js → chunk-06633xka.js} +59 -59
  6. package/dist/{chunk-g24e2jr3.js → chunk-06wn4wzn.js} +56 -56
  7. package/dist/{chunk-k591s450.js → chunk-09t6ygtj.js} +56 -56
  8. package/dist/{chunk-yhjccrrs.js → chunk-0hy8t8bw.js} +97 -97
  9. package/dist/{chunk-tw4tjc73.js → chunk-0jd3p53p.js} +1 -1
  10. package/dist/{chunk-vhk0hgnv.js → chunk-0jzfxaag.js} +56 -56
  11. package/dist/{chunk-waar1mpa.js → chunk-0mf8c3kx.js} +2 -3
  12. package/dist/chunk-0vrstrej.js +40 -0
  13. package/dist/{chunk-zw543g0m.js → chunk-0xv2ee7b.js} +57 -57
  14. package/dist/{chunk-z43cvm9f.js → chunk-17pfrn9m.js} +75 -75
  15. package/dist/{chunk-w8ttjf01.js → chunk-1b0wr9kg.js} +183 -179
  16. package/dist/{chunk-wxe04dx4.js → chunk-1fg83mtb.js} +3 -3
  17. package/dist/{chunk-6rrp0t66.js → chunk-1gj2ern2.js} +530 -1321
  18. package/dist/{chunk-zatd0y92.js → chunk-1nmcmem8.js} +5 -5
  19. package/dist/{chunk-pp347e16.js → chunk-1p0seyhs.js} +56 -56
  20. package/dist/{chunk-1k0wbt0f.js → chunk-1q4zaaha.js} +87 -87
  21. package/dist/{chunk-5a6vqs49.js → chunk-1qb8gym4.js} +67 -67
  22. package/dist/{chunk-1d0d18qj.js → chunk-1r736132.js} +22 -22
  23. package/dist/{chunk-4nvhfqsy.js → chunk-1vvgsaa1.js} +58 -58
  24. package/dist/{chunk-n0pkzaaw.js → chunk-1xmy5qww.js} +6 -6
  25. package/dist/{chunk-vj8q7shk.js → chunk-1z7a5f91.js} +2 -2
  26. package/dist/{chunk-r6ewgv12.js → chunk-22gyk0w9.js} +1 -1
  27. package/dist/{chunk-nt36mbmr.js → chunk-233zp88n.js} +14 -14
  28. package/dist/{chunk-npywdb7q.js → chunk-23s6djv1.js} +3 -3
  29. package/dist/{chunk-wyz7j9j0.js → chunk-2ak7tq7v.js} +23 -23
  30. package/dist/{chunk-m5chmh67.js → chunk-2c0sn45e.js} +2 -2
  31. package/dist/chunk-2d5h61sv.js +334 -0
  32. package/dist/{chunk-4qcmn89e.js → chunk-2dhbfegz.js} +14 -17
  33. package/dist/{chunk-63v197w4.js → chunk-2g37ph2s.js} +56 -56
  34. package/dist/{chunk-j1psatq5.js → chunk-2j59ksap.js} +3 -3
  35. package/dist/{chunk-pv6amr31.js → chunk-2kmmz00g.js} +1 -1
  36. package/dist/{chunk-2dtmmwxh.js → chunk-2tddqyvr.js} +4 -4
  37. package/dist/chunk-2xpkjfdd.js +94 -0
  38. package/dist/{chunk-dct4myst.js → chunk-30fe1k1d.js} +57 -57
  39. package/dist/{chunk-t4z17xt4.js → chunk-31gay4fg.js} +10 -10
  40. package/dist/{chunk-zwna33ms.js → chunk-3340c588.js} +36 -36
  41. package/dist/{chunk-d6713rzt.js → chunk-344z9y37.js} +30 -10
  42. package/dist/{chunk-3gaxrmqq.js → chunk-359q6vz4.js} +15 -15
  43. package/dist/{chunk-rzj6hzme.js → chunk-36mn6bea.js} +8 -8
  44. package/dist/{chunk-xq3k2392.js → chunk-37xtsbs7.js} +57 -57
  45. package/dist/{chunk-e08marnp.js → chunk-3cd4y3t9.js} +4 -4
  46. package/dist/{chunk-34vn56ag.js → chunk-3ep2vsk9.js} +8 -8
  47. package/dist/{chunk-t1whcbtd.js → chunk-3j3nvs90.js} +73 -73
  48. package/dist/{chunk-j2bv645h.js → chunk-3s96vaet.js} +9 -11
  49. package/dist/{chunk-8ew7s39b.js → chunk-3wdbgpa5.js} +1 -1
  50. package/dist/{chunk-sm24ay0y.js → chunk-3xh1a2s5.js} +117 -117
  51. package/dist/{chunk-y8ab9dyv.js → chunk-45gvpe1x.js} +1 -1
  52. package/dist/{chunk-6zf34pgy.js → chunk-47sy4t29.js} +1 -1
  53. package/dist/{chunk-z6wpnk5y.js → chunk-498cjsxq.js} +1 -1
  54. package/dist/{chunk-bg86k3wz.js → chunk-49gg57pb.js} +83 -339
  55. package/dist/{chunk-z8zf2bjp.js → chunk-4fxn5ef2.js} +4 -4
  56. package/dist/{chunk-nvrje5t4.js → chunk-4h5qcy0x.js} +70 -70
  57. package/dist/{chunk-n00sjrne.js → chunk-4m7gyesz.js} +6 -6
  58. package/dist/{chunk-90tgpdv5.js → chunk-4q954a7f.js} +3 -3
  59. package/dist/{chunk-7sgatxct.js → chunk-4qqswajh.js} +5 -5
  60. package/dist/{chunk-122wp3n9.js → chunk-4sfd9m3h.js} +2 -2
  61. package/dist/{chunk-3q10e1r5.js → chunk-4tbz95zd.js} +64 -64
  62. package/dist/{chunk-tg41r14s.js → chunk-4yccdzzy.js} +5 -5
  63. package/dist/{chunk-9pp9xrw2.js → chunk-50fv6d8k.js} +14 -17
  64. package/dist/{chunk-fmq83t7h.js → chunk-50x6aec4.js} +3 -3
  65. package/dist/{chunk-9k7n4z3r.js → chunk-54nmt278.js} +5 -5
  66. package/dist/{chunk-g8w2205d.js → chunk-57a7z5f5.js} +6 -6
  67. package/dist/{chunk-sx291v4f.js → chunk-5dwvcfx9.js} +63 -63
  68. package/dist/{chunk-371mcwkv.js → chunk-5fczmsq9.js} +7 -7
  69. package/dist/{chunk-ztqfa7pd.js → chunk-5kxr6004.js} +56 -56
  70. package/dist/{chunk-1sg2k4mx.js → chunk-5vdpbk46.js} +515 -515
  71. package/dist/{chunk-4w4wdgeb.js → chunk-5vx1mv79.js} +23 -23
  72. package/dist/{chunk-z5w7a1cv.js → chunk-5yeynd2q.js} +26 -26
  73. package/dist/{chunk-9rtywfhp.js → chunk-64nsm3qd.js} +2 -2
  74. package/dist/{chunk-7mpdfrdm.js → chunk-656z4m7c.js} +5 -5
  75. package/dist/{chunk-2cpxc5we.js → chunk-671hpxt2.js} +56 -56
  76. package/dist/{chunk-rw44vqpq.js → chunk-678w363v.js} +56 -56
  77. package/dist/{chunk-8jpxzesa.js → chunk-67zpbdn4.js} +1 -1
  78. package/dist/{chunk-mq7m54qk.js → chunk-6b3tvkfs.js} +69 -69
  79. package/dist/{chunk-8vawdfrp.js → chunk-6c5zyga7.js} +3 -5
  80. package/dist/{chunk-ga3m4ews.js → chunk-6d51qw9g.js} +56 -56
  81. package/dist/{chunk-njdz3yry.js → chunk-6e2cdmf5.js} +4 -4
  82. package/dist/{chunk-kk42fg5v.js → chunk-6qd33ktm.js} +23 -23
  83. package/dist/{chunk-bhwnjx3e.js → chunk-6r0jsmt2.js} +8 -8
  84. package/dist/{chunk-t1mtqz1e.js → chunk-6r247w4d.js} +1 -1
  85. package/dist/{chunk-metmg93w.js → chunk-6we5rwx8.js} +2 -2
  86. package/dist/{chunk-h5qx4apy.js → chunk-6wgh1zjg.js} +1 -1
  87. package/dist/{chunk-zr78q4qg.js → chunk-70wzwz8n.js} +56 -56
  88. package/dist/{chunk-wn8nakrh.js → chunk-79m1rh2k.js} +56 -56
  89. package/dist/{chunk-zf5wkcyy.js → chunk-7bme7hfa.js} +127 -1099
  90. package/dist/{chunk-yw0st51b.js → chunk-7daa5crp.js} +57 -57
  91. package/dist/{chunk-v4zejp1f.js → chunk-7ddn67sp.js} +57 -57
  92. package/dist/{chunk-0wp0zaz8.js → chunk-7n2snadx.js} +57 -57
  93. package/dist/{chunk-9m27g5s1.js → chunk-7njxy9q8.js} +18 -3
  94. package/dist/{chunk-vdh36rw7.js → chunk-7pdhxye3.js} +3 -3
  95. package/dist/{chunk-skxa5fes.js → chunk-7sk1sscc.js} +14 -16
  96. package/dist/{chunk-swq8qack.js → chunk-7zv16z22.js} +24 -24
  97. package/dist/{chunk-b43rsa2d.js → chunk-81714r6x.js} +2 -2
  98. package/dist/{chunk-9b48fxkx.js → chunk-836sdnt9.js} +56 -56
  99. package/dist/{chunk-m1qqm2nc.js → chunk-86x85yr9.js} +3 -3
  100. package/dist/{chunk-tp3mqwh3.js → chunk-87gjcnga.js} +7 -7
  101. package/dist/{chunk-8ympg941.js → chunk-88maa8mt.js} +1 -1
  102. package/dist/{chunk-vxnvzfnv.js → chunk-8avfrdpz.js} +2 -3
  103. package/dist/{chunk-h13g15kb.js → chunk-8bcxzxe5.js} +1 -1
  104. package/dist/{chunk-kn9hzg11.js → chunk-8fffv8wn.js} +3 -3
  105. package/dist/{chunk-b3t64cwd.js → chunk-8frgpcff.js} +59 -59
  106. package/dist/{chunk-j64ga6ta.js → chunk-8jyp5q4y.js} +304 -272
  107. package/dist/{chunk-sdzpdzj3.js → chunk-8mn0xtks.js} +58 -58
  108. package/dist/{chunk-svw35ajj.js → chunk-8nyxbscw.js} +57 -57
  109. package/dist/{chunk-7f0atzzf.js → chunk-8pdt72wn.js} +57 -57
  110. package/dist/{chunk-1ymedh1v.js → chunk-8q45zgt6.js} +23 -23
  111. package/dist/{chunk-zwkqabbj.js → chunk-8wxvkw8d.js} +11 -11
  112. package/dist/{chunk-4vqz7w3v.js → chunk-8y4h3zns.js} +4 -4
  113. package/dist/{chunk-p2xfr5am.js → chunk-931ha1bh.js} +57 -57
  114. package/dist/{chunk-84cjtasj.js → chunk-93dwdj3d.js} +58 -58
  115. package/dist/{chunk-ntwe4mq2.js → chunk-9418ay84.js} +11 -11
  116. package/dist/{chunk-edt6c4pc.js → chunk-951dv8h8.js} +73 -73
  117. package/dist/{chunk-x6ceqp7t.js → chunk-95g0mnnr.js} +23 -23
  118. package/dist/{chunk-02n5zpyc.js → chunk-95gj5fgc.js} +4 -4
  119. package/dist/{chunk-2c8aqb33.js → chunk-98cxa2z3.js} +56 -56
  120. package/dist/{chunk-atpyr1kg.js → chunk-9brk0eew.js} +57 -57
  121. package/dist/{chunk-gaz7te9m.js → chunk-9c667xwe.js} +6 -6
  122. package/dist/{chunk-ng8q29em.js → chunk-9f1128wv.js} +2 -2
  123. package/dist/{chunk-ezwhbfk8.js → chunk-9g00mhqb.js} +5 -5
  124. package/dist/{chunk-6v1p41rg.js → chunk-9kgebwrt.js} +7 -7
  125. package/dist/{chunk-vntvaf0c.js → chunk-9m1e5wpd.js} +63 -63
  126. package/dist/{chunk-zwv3h48p.js → chunk-9rpt1bhm.js} +3 -3
  127. package/dist/{chunk-eserktyd.js → chunk-9szwp11z.js} +4 -4
  128. package/dist/{chunk-9b2ts7my.js → chunk-9vkszccv.js} +1 -1
  129. package/dist/{chunk-b82adekm.js → chunk-a4dmrp4p.js} +57 -57
  130. package/dist/{chunk-zbrk28bp.js → chunk-a67r0mwk.js} +56 -56
  131. package/dist/{chunk-9azyfe65.js → chunk-aamdxwdd.js} +61 -61
  132. package/dist/{chunk-bneqxcmf.js → chunk-acv242nr.js} +1 -1
  133. package/dist/chunk-ahgm6d23.js +180 -0
  134. package/dist/{chunk-w12f58yz.js → chunk-amp2gnxw.js} +14 -17
  135. package/dist/{chunk-f62xm8dh.js → chunk-as4mdc2w.js} +3 -3
  136. package/dist/{chunk-kpdp2gz2.js → chunk-b0640wd7.js} +13 -13
  137. package/dist/{chunk-5zpstd3m.js → chunk-b2ja3r02.js} +7 -7
  138. package/dist/{chunk-00m08jnq.js → chunk-b60h6kww.js} +56 -56
  139. package/dist/{chunk-kaqp12mx.js → chunk-b9qd9kra.js} +56 -56
  140. package/dist/{chunk-ekqvx6ek.js → chunk-b9sm6wxq.js} +56 -56
  141. package/dist/{chunk-ppa284pd.js → chunk-bd9tyxxr.js} +56 -56
  142. package/dist/{chunk-2ab59kwj.js → chunk-bdr1btg9.js} +3 -3
  143. package/dist/{chunk-q4tkspkp.js → chunk-bhbves4r.js} +4 -4
  144. package/dist/{chunk-3jjc204v.js → chunk-brmc4agx.js} +18 -18
  145. package/dist/{chunk-j04z48rw.js → chunk-bt64sq5y.js} +3 -3
  146. package/dist/{chunk-5qxgyby3.js → chunk-btma241g.js} +612 -2
  147. package/dist/{chunk-0xfz1hj1.js → chunk-bwyqbexk.js} +6 -6
  148. package/dist/{chunk-p6ejgd85.js → chunk-by1fz71x.js} +60 -60
  149. package/dist/{chunk-rvn77re6.js → chunk-c013mzjf.js} +23 -23
  150. package/dist/{chunk-8w2a9md8.js → chunk-c2c9k2td.js} +3 -3
  151. package/dist/{chunk-ds6b4567.js → chunk-c3bfhzhn.js} +67 -67
  152. package/dist/{chunk-rar7nmve.js → chunk-c4rny4rc.js} +57 -57
  153. package/dist/{chunk-ex2q76wx.js → chunk-c5yryhhe.js} +1 -1
  154. package/dist/{chunk-cb0cjgk3.js → chunk-c8zj46aa.js} +56 -56
  155. package/dist/{chunk-h0n9zhgw.js → chunk-c9z5dmft.js} +56 -56
  156. package/dist/{chunk-xeehxb1q.js → chunk-ckagkgyw.js} +3 -3
  157. package/dist/{chunk-rwzb4fmk.js → chunk-cmzpd1aa.js} +59 -59
  158. package/dist/{chunk-rn68wk3p.js → chunk-cs7rs76k.js} +22 -22
  159. package/dist/{chunk-bgptt4dd.js → chunk-ctmqc8dj.js} +56 -56
  160. package/dist/{chunk-ekkewv4y.js → chunk-dawypyk0.js} +1 -1
  161. package/dist/{chunk-ngrj6x74.js → chunk-df52t7ys.js} +168 -161
  162. package/dist/{chunk-kxptk43f.js → chunk-dhhtyqb0.js} +57 -57
  163. package/dist/{chunk-tq82bwaf.js → chunk-dvd65zc6.js} +2 -2
  164. package/dist/{chunk-32fv3vze.js → chunk-e0vqhfkh.js} +25 -25
  165. package/dist/{chunk-sd3jwppm.js → chunk-ebbxn1k1.js} +8 -8
  166. package/dist/{chunk-wkh76b1p.js → chunk-enxnnzk5.js} +7 -7
  167. package/dist/{chunk-f16qs2ag.js → chunk-ernd3z3b.js} +56 -56
  168. package/dist/{chunk-vhjhyt2r.js → chunk-ers6ntf9.js} +26 -26
  169. package/dist/{chunk-zwa133ny.js → chunk-es1hw74y.js} +2 -2
  170. package/dist/{chunk-td6j7fcr.js → chunk-ewnbfy3y.js} +56 -56
  171. package/dist/{chunk-g0jmqbp4.js → chunk-f2gxsfk0.js} +6 -6
  172. package/dist/{chunk-2mmx9qqz.js → chunk-f46ae3yt.js} +27 -27
  173. package/dist/{chunk-dc83q1dm.js → chunk-f4kbe948.js} +2 -2
  174. package/dist/{chunk-vh70jg33.js → chunk-f954nf8n.js} +4 -4
  175. package/dist/{chunk-w8krbzb0.js → chunk-fc1dg6fw.js} +4 -4
  176. package/dist/chunk-ff3ahqvh.js +85 -0
  177. package/dist/{chunk-yb6x70md.js → chunk-fg5ke2mj.js} +1786 -141
  178. package/dist/{chunk-me2986xy.js → chunk-fh369vs2.js} +57 -57
  179. package/dist/{chunk-mz0qfs55.js → chunk-fjwzryzq.js} +63 -63
  180. package/dist/{chunk-qdfzdcz3.js → chunk-fsag2m4a.js} +60 -60
  181. package/dist/{chunk-bwqvhzrw.js → chunk-fthbxpt7.js} +76 -69
  182. package/dist/{chunk-1nz1mgm6.js → chunk-fw8e2t6e.js} +39 -268
  183. package/dist/{chunk-mj9rbmy1.js → chunk-fxwznjpb.js} +5 -5
  184. package/dist/{chunk-fw64v27c.js → chunk-fz0ch109.js} +3 -3
  185. package/dist/{chunk-p6359g16.js → chunk-g0zm1y21.js} +26 -26
  186. package/dist/{chunk-j2cbcyf7.js → chunk-g649rtg8.js} +4 -6
  187. package/dist/{chunk-zvxjnak3.js → chunk-g7s3wa97.js} +56 -56
  188. package/dist/{chunk-js21kfpq.js → chunk-garqv1np.js} +1 -1
  189. package/dist/{chunk-tsdqd747.js → chunk-gfex5hb6.js} +10 -4
  190. package/dist/{chunk-ftwqpbvy.js → chunk-gn5w9n3x.js} +56 -56
  191. package/dist/{chunk-rgm0v4he.js → chunk-gt1g8ggp.js} +24 -24
  192. package/dist/{chunk-5dn1m1r7.js → chunk-gwyn2qmg.js} +2 -2
  193. package/dist/{chunk-7srwepm7.js → chunk-h0634caf.js} +1 -1
  194. package/dist/{chunk-zpm1rpmw.js → chunk-h113y7bb.js} +16 -16
  195. package/dist/{chunk-nbath9yz.js → chunk-h3hebrv2.js} +7 -7
  196. package/dist/{chunk-0ejzh5by.js → chunk-h7dkj0dk.js} +58 -58
  197. package/dist/{chunk-r089a4na.js → chunk-h7vssbj0.js} +22 -22
  198. package/dist/{chunk-nn8nkawn.js → chunk-hece55mn.js} +7 -7
  199. package/dist/{chunk-fp2z22f1.js → chunk-hmrv8s7y.js} +59 -59
  200. package/dist/{chunk-hyc3kbfq.js → chunk-hyn7093k.js} +4 -4
  201. package/dist/{chunk-bnznxckg.js → chunk-j1xk9z8c.js} +56 -56
  202. package/dist/{chunk-65gzht6d.js → chunk-j4hwj9dm.js} +56 -56
  203. package/dist/{chunk-t31xvfy2.js → chunk-j5fmtgm9.js} +60 -60
  204. package/dist/{chunk-ebx4j5r5.js → chunk-j6k3zjb5.js} +5 -7
  205. package/dist/{chunk-3nmhzccb.js → chunk-j6v1eh21.js} +2 -2
  206. package/dist/{chunk-tzpxsjm3.js → chunk-j74bmdac.js} +29 -29
  207. package/dist/{chunk-wsm0s0c3.js → chunk-j9pk89t9.js} +3 -3
  208. package/dist/{chunk-31959kp1.js → chunk-jdgtrz9z.js} +5 -5
  209. package/dist/{chunk-2xezy8pc.js → chunk-jfr51c5y.js} +7 -7
  210. package/dist/{chunk-ew68a4sy.js → chunk-jjgc9402.js} +57 -57
  211. package/dist/{chunk-khdftpea.js → chunk-jkh5zd5f.js} +9 -9
  212. package/dist/{chunk-9kqtdah4.js → chunk-jr21cjeg.js} +1 -1
  213. package/dist/{chunk-znehavdm.js → chunk-jvnb1zrw.js} +1 -1
  214. package/dist/{chunk-2kxk7ftp.js → chunk-jzy74s4d.js} +59 -59
  215. package/dist/{chunk-j5keq4ye.js → chunk-k78z7cgq.js} +60 -60
  216. package/dist/{chunk-7sgn6fv0.js → chunk-k8ardej3.js} +6 -6
  217. package/dist/{chunk-drnr3z7x.js → chunk-ka74c3kc.js} +144 -144
  218. package/dist/{chunk-dge3af7q.js → chunk-ke83cm0m.js} +8 -8
  219. package/dist/{chunk-nzqmmqwj.js → chunk-keakx0ba.js} +23 -23
  220. package/dist/{chunk-9snpw77c.js → chunk-kp8c9aj2.js} +67 -67
  221. package/dist/{chunk-8y3eszv7.js → chunk-krbnqs28.js} +2 -2
  222. package/dist/{chunk-vgdtw10n.js → chunk-ktzxeprc.js} +2 -2
  223. package/dist/{chunk-xafy9ccy.js → chunk-m04wh4ns.js} +57 -57
  224. package/dist/{chunk-zwwgfs0j.js → chunk-m567nxhf.js} +3 -3
  225. package/dist/{chunk-vf3etxnx.js → chunk-mcs219z2.js} +1 -1
  226. package/dist/{chunk-61edjmf6.js → chunk-mg1w5bk3.js} +2 -2
  227. package/dist/{chunk-npvte75f.js → chunk-mjhqxw0y.js} +5 -5
  228. package/dist/{chunk-ffy37ks3.js → chunk-mjm0x5rg.js} +23 -23
  229. package/dist/{chunk-vmfckw4g.js → chunk-mmks9f9c.js} +56 -56
  230. package/dist/{chunk-tjaexdr7.js → chunk-mptrdah5.js} +56 -56
  231. package/dist/{chunk-vmf74a91.js → chunk-mw3yt5e8.js} +57 -57
  232. package/dist/{chunk-skrja2sz.js → chunk-my2f214y.js} +2 -2
  233. package/dist/{chunk-n5pe3jtt.js → chunk-n1bh6pgv.js} +2 -2
  234. package/dist/{chunk-t0twk3e5.js → chunk-n217n8sr.js} +1 -1
  235. package/dist/chunk-n35vwqby.js +777 -0
  236. package/dist/{chunk-b3behs0y.js → chunk-n8tka1ne.js} +3 -3
  237. package/dist/{chunk-92skmpg9.js → chunk-nc6kc7nq.js} +56 -56
  238. package/dist/{chunk-send164b.js → chunk-nd6a3t02.js} +23 -23
  239. package/dist/{chunk-vxs1rvy8.js → chunk-nd6bna5f.js} +6 -6
  240. package/dist/{chunk-4tre5ddg.js → chunk-neak2qc4.js} +1 -1
  241. package/dist/{chunk-w8yhf638.js → chunk-nfnvct96.js} +1 -1
  242. package/dist/{chunk-wj8gbr2g.js → chunk-nh55zf4f.js} +58 -58
  243. package/dist/{chunk-j2ba3wye.js → chunk-nh8b5r5j.js} +22 -22
  244. package/dist/{chunk-bbxfenf0.js → chunk-njkrycp5.js} +57 -57
  245. package/dist/{chunk-pb2x8g1w.js → chunk-npwwb947.js} +67 -67
  246. package/dist/{chunk-h9ef6kkf.js → chunk-nv44pqqe.js} +5 -5
  247. package/dist/{chunk-b2pxvgwp.js → chunk-ny3x26cq.js} +10 -10
  248. package/dist/{chunk-hfy21maq.js → chunk-nyd2jxqe.js} +6 -6
  249. package/dist/{chunk-0pkrwxrg.js → chunk-nz4mxnb9.js} +3 -3
  250. package/dist/{chunk-74v2mh4t.js → chunk-p1adg740.js} +1 -1
  251. package/dist/{chunk-0wrzeej6.js → chunk-p4g51g7j.js} +1 -1
  252. package/dist/{chunk-d9bvzfkg.js → chunk-p4smdj5h.js} +62 -62
  253. package/dist/{chunk-knc5za98.js → chunk-p6epk4qf.js} +57 -57
  254. package/dist/{chunk-vny8tpke.js → chunk-pdqstphx.js} +24 -24
  255. package/dist/{chunk-67jg7cfy.js → chunk-phce1mav.js} +2 -2
  256. package/dist/{chunk-3xhmzvxm.js → chunk-pjkaqt23.js} +5 -5
  257. package/dist/{chunk-a7bs51hq.js → chunk-pk7zh1tn.js} +28 -28
  258. package/dist/{chunk-sqb7kkqx.js → chunk-pnj3nd5q.js} +6 -6
  259. package/dist/{chunk-6eq35v86.js → chunk-pnv69npn.js} +1 -1
  260. package/dist/{chunk-epat31ss.js → chunk-pqmhknk0.js} +1 -1
  261. package/dist/{chunk-cx8c18e3.js → chunk-pstmmxr4.js} +62 -62
  262. package/dist/{chunk-sw51thrz.js → chunk-pv4jaeme.js} +59 -59
  263. package/dist/{chunk-xs12ggs7.js → chunk-pw25q7mk.js} +60 -60
  264. package/dist/{chunk-j95j6wz8.js → chunk-q27bsq0y.js} +1 -1
  265. package/dist/{chunk-sjraxh5y.js → chunk-q2dfqg20.js} +57 -57
  266. package/dist/{chunk-wdwa58v1.js → chunk-qdh60qe3.js} +59 -59
  267. package/dist/{chunk-r41sjxcn.js → chunk-qegzj6nm.js} +1 -1
  268. package/dist/{chunk-kerkk89t.js → chunk-qfdzqed0.js} +4 -4
  269. package/dist/{chunk-3px6f9s5.js → chunk-qg8wxcxp.js} +2 -2
  270. package/dist/{chunk-6jdrt36m.js → chunk-qk4akts4.js} +2 -2
  271. package/dist/{chunk-hhc28ga0.js → chunk-qmbxp01p.js} +26 -26
  272. package/dist/{chunk-5ycqyqbj.js → chunk-qnbe7d8a.js} +1 -1
  273. package/dist/{chunk-z5tmqz5e.js → chunk-qphfxebt.js} +56 -56
  274. package/dist/{chunk-e4jqbn4d.js → chunk-qqfbkaad.js} +3 -4
  275. package/dist/{chunk-jp8tnjzr.js → chunk-qr7jt1p9.js} +59 -59
  276. package/dist/{chunk-f6qh3vrn.js → chunk-qrxyvnng.js} +4 -4
  277. package/dist/{chunk-zqhxr0h7.js → chunk-qs2xnhte.js} +5 -7
  278. package/dist/{chunk-h28xqfk8.js → chunk-qwhjh47p.js} +62 -62
  279. package/dist/{chunk-tbce47cr.js → chunk-qxsrtfzn.js} +4 -4
  280. package/dist/{chunk-9jt1c7t9.js → chunk-r1sh1xxc.js} +58 -58
  281. package/dist/{chunk-pb2nc7r0.js → chunk-r5c38r2r.js} +149 -61
  282. package/dist/{chunk-5p8k3wyp.js → chunk-r7fp9vgn.js} +59 -59
  283. package/dist/{chunk-ns3babbs.js → chunk-r7mjzgyn.js} +2 -4
  284. package/dist/{chunk-jxyh3xyq.js → chunk-r8p2e3xm.js} +23 -23
  285. package/dist/{chunk-tzaj5mwz.js → chunk-r9c159an.js} +31 -31
  286. package/dist/{chunk-6dhen79h.js → chunk-rc2ym0h1.js} +8 -8
  287. package/dist/{chunk-yhc1fee8.js → chunk-rcbwt8v4.js} +23 -23
  288. package/dist/chunk-red9b98p.js +378 -0
  289. package/dist/{chunk-k95meznc.js → chunk-rf43pnhs.js} +7 -7
  290. package/dist/{chunk-drnxbc1w.js → chunk-rfp8ja4z.js} +2 -2
  291. package/dist/{chunk-kh9fj2xh.js → chunk-rrm65zpt.js} +60 -60
  292. package/dist/{chunk-s38qgqfs.js → chunk-rrtkz2js.js} +4 -4
  293. package/dist/{chunk-2f3vsxna.js → chunk-rske3dxd.js} +5 -5
  294. package/dist/{chunk-b4ftppkp.js → chunk-rt7k0yp6.js} +22 -22
  295. package/dist/{chunk-7t38tp7c.js → chunk-rxz2y16w.js} +24 -24
  296. package/dist/{chunk-6hk5a6ky.js → chunk-ry1nqm9c.js} +56 -56
  297. package/dist/{chunk-7jm7pa1e.js → chunk-ryd3pd8a.js} +14 -17
  298. package/dist/{chunk-jvf4wvhn.js → chunk-s3crjxw3.js} +57 -57
  299. package/dist/{chunk-yztxtgd8.js → chunk-s45ebhpy.js} +66 -66
  300. package/dist/{chunk-cs9xxrmx.js → chunk-s5xntz3r.js} +56 -56
  301. package/dist/{chunk-03mgn26m.js → chunk-s7c77nyd.js} +65 -65
  302. package/dist/{chunk-13g6d7wt.js → chunk-sebc1r56.js} +10 -10
  303. package/dist/{chunk-hk24qq7n.js → chunk-sfmv2tck.js} +9 -9
  304. package/dist/chunk-shj5md9j.js +1486 -0
  305. package/dist/{chunk-whs655k7.js → chunk-shzw1wsd.js} +57 -57
  306. package/dist/{chunk-99p0sa4h.js → chunk-skawh5jz.js} +2 -2
  307. package/dist/{chunk-s6a338bt.js → chunk-smxedkcs.js} +3 -3
  308. package/dist/{chunk-34b0y9w3.js → chunk-sp4nhyaf.js} +57 -57
  309. package/dist/{chunk-jxe1a8kz.js → chunk-syj45v8j.js} +6 -6
  310. package/dist/{chunk-0kh2f6kh.js → chunk-sz53f4b4.js} +3 -3
  311. package/dist/{chunk-5wxavbb8.js → chunk-t75rde8x.js} +23 -23
  312. package/dist/{chunk-z93cpz34.js → chunk-t7b3r8v9.js} +3 -3
  313. package/dist/{chunk-k6tzzr9c.js → chunk-tawtrqva.js} +7 -7
  314. package/dist/{chunk-d09j71dr.js → chunk-tayaadct.js} +6 -6
  315. package/dist/{chunk-1395xfcq.js → chunk-tmazne55.js} +58 -58
  316. package/dist/{chunk-95dy6w67.js → chunk-tq7vtsx4.js} +2 -2
  317. package/dist/{chunk-pbn6n0kg.js → chunk-tsrdap6v.js} +56 -56
  318. package/dist/{chunk-dc4krjj4.js → chunk-v0m66j64.js} +22 -22
  319. package/dist/{chunk-t2ex5gsn.js → chunk-vby4pkky.js} +3 -3
  320. package/dist/{chunk-fq1j9zm0.js → chunk-vsa6z84y.js} +3 -3
  321. package/dist/{chunk-mbv3f2vm.js → chunk-vywhk0sd.js} +4 -4
  322. package/dist/{chunk-neh0bkkf.js → chunk-vzkn76sz.js} +56 -56
  323. package/dist/{chunk-125xg82c.js → chunk-w1j0gsjn.js} +22 -22
  324. package/dist/{chunk-jq9vjfbd.js → chunk-w212xcra.js} +57 -57
  325. package/dist/{chunk-3b5a4wa6.js → chunk-w31rdd6k.js} +22 -22
  326. package/dist/{chunk-m3szhhvz.js → chunk-w4705aww.js} +58 -58
  327. package/dist/{chunk-0gqymhpf.js → chunk-wabhnnag.js} +4 -4
  328. package/dist/{chunk-rexrttsb.js → chunk-wad1y8mh.js} +33 -33
  329. package/dist/{chunk-kh9hfyzf.js → chunk-wfy46jh3.js} +56 -56
  330. package/dist/{chunk-jh0d0pbd.js → chunk-wg0d4shw.js} +4 -4
  331. package/dist/{chunk-nbvc8bh6.js → chunk-wqcx8yb9.js} +24 -24
  332. package/dist/{chunk-s8zha7q1.js → chunk-ws1046mv.js} +9 -11
  333. package/dist/{chunk-9pkh2w7v.js → chunk-wvx43m9q.js} +8 -8
  334. package/dist/{chunk-rvp6qq44.js → chunk-ww3c2p80.js} +5 -5
  335. package/dist/{chunk-3c1ddhnk.js → chunk-wyggw3r2.js} +19 -207
  336. package/dist/{chunk-b909mp8w.js → chunk-x19vx307.js} +1 -1
  337. package/dist/{chunk-jd2ams26.js → chunk-x2538e1h.js} +6 -6
  338. package/dist/{chunk-4h43b7ww.js → chunk-x28c4ks5.js} +69 -69
  339. package/dist/{chunk-79ztw13h.js → chunk-x3cre1mq.js} +2 -2
  340. package/dist/{chunk-sf4rsw52.js → chunk-x463hr55.js} +8 -8
  341. package/dist/{chunk-7vzwyazf.js → chunk-x4cy988y.js} +4 -4
  342. package/dist/{chunk-7e78w86v.js → chunk-x57qc0kp.js} +3 -3
  343. package/dist/{chunk-m0yqzzgm.js → chunk-x63819rk.js} +2 -2
  344. package/dist/{chunk-1zrpqh8h.js → chunk-x7aa6ah7.js} +1 -1
  345. package/dist/{chunk-7rk9ppx4.js → chunk-x7gn9nrr.js} +1 -1
  346. package/dist/{chunk-2katyzq9.js → chunk-x8zp00qp.js} +3 -3
  347. package/dist/{chunk-q72weaf5.js → chunk-xa9z4cnj.js} +829 -2177
  348. package/dist/{chunk-6ge6zddg.js → chunk-xg3ycrct.js} +3 -3
  349. package/dist/{chunk-tz2rkx2s.js → chunk-xkmy3brs.js} +3 -3
  350. package/dist/{chunk-smzahkka.js → chunk-xmzrasrc.js} +4 -4
  351. package/dist/{chunk-g1jfytsa.js → chunk-xt17cf7n.js} +5 -5
  352. package/dist/{chunk-d8ztpy7x.js → chunk-xwx3rv0p.js} +7 -7
  353. package/dist/{chunk-xt4v95je.js → chunk-xytszm3x.js} +3 -3
  354. package/dist/{chunk-7vzj8rfd.js → chunk-y05pc4yc.js} +4 -4
  355. package/dist/{chunk-1j8anrn2.js → chunk-y0ad9bqc.js} +56 -56
  356. package/dist/chunk-y2raf8mq.js +500 -0
  357. package/dist/{chunk-m7r4wqc3.js → chunk-y5eh5c89.js} +1 -1
  358. package/dist/{chunk-avtcf910.js → chunk-y5x8wqe5.js} +1 -1
  359. package/dist/{chunk-vjv7wvnc.js → chunk-y7bcnxzv.js} +4 -4
  360. package/dist/{chunk-w2x18mrn.js → chunk-ybskffc3.js} +23 -23
  361. package/dist/{chunk-j5bved6z.js → chunk-yr3fqscy.js} +61 -61
  362. package/dist/{chunk-mnrswcqf.js → chunk-yrkgx43b.js} +56 -56
  363. package/dist/{chunk-e5ewhhx6.js → chunk-ysaab0ws.js} +56 -56
  364. package/dist/{chunk-7kbezevv.js → chunk-yt2e4mn3.js} +5 -5
  365. package/dist/{chunk-7d3ba1n4.js → chunk-yvzh49tc.js} +1 -1
  366. package/dist/{chunk-y64tceyw.js → chunk-yyq7kdv8.js} +3 -3
  367. package/dist/{chunk-sjmx1scx.js → chunk-yyrvfxhd.js} +23 -23
  368. package/dist/{chunk-3d953efq.js → chunk-z3j9b1mk.js} +5 -5
  369. package/dist/chunk-z51d7scc.js +244 -0
  370. package/dist/{chunk-4mygvv18.js → chunk-z9crxxn3.js} +57 -57
  371. package/dist/{chunk-eenv3551.js → chunk-zde20je5.js} +56 -56
  372. package/dist/{chunk-dxcr07z5.js → chunk-ze6zvkg6.js} +4 -4
  373. package/dist/{chunk-d6vexw90.js → chunk-zyy7th0a.js} +1 -1
  374. package/dist/cli-bun.js +0 -0
  375. package/dist/cli-node.js +418 -10
  376. package/dist/cli.js +11 -11
  377. package/dist/download-ripgrep.js +1 -1
  378. package/package.json +200 -195
  379. package/scripts/postinstall.cjs +339 -339
  380. package/scripts/setup-chrome-mcp.mjs +39 -39
  381. package/dist/chunk-05rcynmf.js +0 -81
  382. package/dist/chunk-27xc1csx.js +0 -104
  383. package/dist/chunk-30rst83v.js +0 -168
  384. package/dist/chunk-33tdaxv0.js +0 -16
  385. package/dist/chunk-3enkzjbw.js +0 -3966
  386. package/dist/chunk-3h8a89gy.js +0 -46
  387. package/dist/chunk-3qm927vk.js +0 -542
  388. package/dist/chunk-3z7wsvpa.js +0 -24
  389. package/dist/chunk-44ct1wzm.js +0 -17
  390. package/dist/chunk-4s0bw3mn.js +0 -208
  391. package/dist/chunk-7m3ja921.js +0 -27
  392. package/dist/chunk-7vs34s16.js +0 -173
  393. package/dist/chunk-80h2am3g.js +0 -5241
  394. package/dist/chunk-8f6raa6q.js +0 -615
  395. package/dist/chunk-a9vdeb6y.js +0 -258
  396. package/dist/chunk-ahc4y7pa.js +0 -782
  397. package/dist/chunk-b0bk6bxs.js +0 -742
  398. package/dist/chunk-b4wg70y1.js +0 -54
  399. package/dist/chunk-btnvjcc5.js +0 -15
  400. package/dist/chunk-cs6c9gbk.js +0 -1172
  401. package/dist/chunk-enhtm7h3.js +0 -1731
  402. package/dist/chunk-fckn68n0.js +0 -180
  403. package/dist/chunk-h0qngp9w.js +0 -157
  404. package/dist/chunk-hasadm64.js +0 -412
  405. package/dist/chunk-hk9xz7gk.js +0 -118
  406. package/dist/chunk-j2k4p94p.js +0 -55
  407. package/dist/chunk-jgcsawpq.js +0 -659
  408. package/dist/chunk-jzmz18nn.js +0 -65
  409. package/dist/chunk-kg4qmgbk.js +0 -1095
  410. package/dist/chunk-n0qaeaa5.js +0 -256
  411. package/dist/chunk-nbxr4cfd.js +0 -880
  412. package/dist/chunk-q25bjaev.js +0 -15
  413. package/dist/chunk-qpydzzk0.js +0 -182
  414. package/dist/chunk-qqy9drhh.js +0 -864
  415. package/dist/chunk-qtddenhw.js +0 -607
  416. package/dist/chunk-r6h4zwjj.js +0 -36
  417. package/dist/chunk-th1cykx3.js +0 -494
  418. package/dist/chunk-ttk5dzz8.js +0 -25
  419. package/dist/chunk-v9yc4wjc.js +0 -220
  420. package/dist/chunk-vsemkegd.js +0 -718
  421. package/dist/chunk-wadkbt36.js +0 -40
  422. package/dist/chunk-xsq9ae7x.js +0 -90
  423. package/dist/chunk-ze6h1ch1.js +0 -21
  424. package/dist/chunk-ztpbxsq6.js +0 -910
  425. package/dist/{chunk-2j1t3hcw.js → chunk-a07s68gh.js} +3 -3
@@ -1,339 +1,339 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Postinstall script — runs automatically after `bun install` or `npm install`.
4
- *
5
- * Downloads ripgrep binary (idempotent, skips if exists).
6
- * Works in dev mode (src/ exists), published mode (dist/ exists), with bun or node.
7
- *
8
- * Usage:
9
- * node scripts/postinstall.js
10
- * node scripts/postinstall.js --force
11
- * bun run scripts/postinstall.js
12
- */
13
-
14
- const { existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync, chmodSync } =
15
- require("fs")
16
- const { spawnSync } = require("child_process")
17
- const { setDefaultResultOrder } = require("node:dns")
18
- const path = require("path")
19
- const os = require("os")
20
-
21
- // Prefer IPv4 first — Bun on Windows sometimes fails GitHub over broken IPv6 paths.
22
- try {
23
- setDefaultResultOrder("ipv4first")
24
- } catch {
25
- /* ignore */
26
- }
27
-
28
- // --- Config ---
29
-
30
- const RG_VERSION = "15.0.1"
31
- const DEFAULT_RELEASE_BASE = `https://github.com/microsoft/ripgrep-prebuilt/releases/download/v${RG_VERSION}`
32
- const MIRROR_RELEASE_BASE = `https://ghproxy.net/https://github.com/microsoft/ripgrep-prebuilt/releases/download/v${RG_VERSION}`
33
- const RELEASE_BASE = (process.env.RIPGREP_DOWNLOAD_BASE ?? DEFAULT_RELEASE_BASE).replace(/\/$/, "")
34
-
35
- const scriptDir = path.dirname(__filename)
36
- const projectRoot = path.resolve(scriptDir, "..")
37
-
38
- // --- Platform mapping ---
39
-
40
- function getPlatformMapping() {
41
- const arch = process.arch
42
- const platform = process.platform
43
-
44
- if (platform === "darwin") {
45
- if (arch === "arm64") return { target: "aarch64-apple-darwin", ext: "tar.gz" }
46
- if (arch === "x64") return { target: "x86_64-apple-darwin", ext: "tar.gz" }
47
- throw new Error(`Unsupported macOS arch: ${arch}`)
48
- }
49
-
50
- if (platform === "win32") {
51
- if (arch === "x64") return { target: "x86_64-pc-windows-msvc", ext: "zip" }
52
- if (arch === "arm64") return { target: "aarch64-pc-windows-msvc", ext: "zip" }
53
- throw new Error(`Unsupported Windows arch: ${arch}`)
54
- }
55
-
56
- if (platform === "linux") {
57
- const isMusl = detectMusl()
58
- if (arch === "x64") {
59
- return { target: "x86_64-unknown-linux-musl", ext: "tar.gz" }
60
- }
61
- if (arch === "arm64") {
62
- return isMusl
63
- ? { target: "aarch64-unknown-linux-musl", ext: "tar.gz" }
64
- : { target: "aarch64-unknown-linux-gnu", ext: "tar.gz" }
65
- }
66
- throw new Error(`Unsupported Linux arch: ${arch}`)
67
- }
68
-
69
- throw new Error(`Unsupported platform: ${platform}`)
70
- }
71
-
72
- function detectMusl() {
73
- const muslArch = process.arch === "x64" ? "x86_64" : "aarch64"
74
- try {
75
- statSync(`/lib/libc.musl-${muslArch}.so.1`)
76
- return true
77
- } catch {
78
- return false
79
- }
80
- }
81
-
82
- // --- Paths ---
83
-
84
- function getVendorDir() {
85
- if (existsSync(path.join(projectRoot, "src"))) {
86
- return path.resolve(projectRoot, "src", "utils", "vendor", "ripgrep")
87
- }
88
- return path.resolve(projectRoot, "dist", "vendor", "ripgrep")
89
- }
90
-
91
- function getBinaryPath() {
92
- const dir = getVendorDir()
93
- const subdir = `${process.arch}-${process.platform}`
94
- const binary = process.platform === "win32" ? "rg.exe" : "rg"
95
- return path.resolve(dir, subdir, binary)
96
- }
97
-
98
- // --- Download helpers ---
99
-
100
- function proxyEnvSet() {
101
- const v = (s) => (s ?? "").trim()
102
- return !!(v(process.env.HTTPS_PROXY) || v(process.env.HTTP_PROXY) || v(process.env.ALL_PROXY) || v(process.env.https_proxy) || v(process.env.http_proxy))
103
- }
104
-
105
- function tryPowerShellDownload(url, dest) {
106
- const u = url.replace(/'/g, "''")
107
- const d = dest.replace(/'/g, "''")
108
- const cmd = `Invoke-WebRequest -Uri '${u}' -OutFile '${d}' -UseBasicParsing`
109
- const result = spawnSync(
110
- "powershell.exe",
111
- ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", cmd],
112
- { stdio: "pipe", windowsHide: true },
113
- )
114
- return result.status === 0 && existsSync(dest) && statSync(dest).size > 0
115
- }
116
-
117
- function tryCurlDownload(url, dest) {
118
- const curl = process.platform === "win32" ? "curl.exe" : "curl"
119
- const result = spawnSync(curl, ["-fsSL", "-L", "--fail", "-o", dest, url], {
120
- stdio: "pipe",
121
- windowsHide: true,
122
- })
123
- return result.status === 0 && existsSync(dest) && statSync(dest).size > 0
124
- }
125
-
126
- async function fetchRelease(url) {
127
- if (proxyEnvSet()) {
128
- // Dynamic require so it works in node without bundling issues
129
- const undici = require("undici")
130
- return await undici.fetch(url, {
131
- redirect: "follow",
132
- dispatcher: new undici.EnvHttpProxyAgent(),
133
- })
134
- }
135
- // Node 18+ has global fetch, Bun has it too
136
- return await fetch(url, { redirect: "follow" })
137
- }
138
-
139
- async function downloadUrlToBuffer(url) {
140
- const response = await fetchRelease(url)
141
- if (!response.ok) {
142
- throw new Error(`Download failed: ${response.status} ${response.statusText}`)
143
- }
144
- return Buffer.from(await response.arrayBuffer())
145
- }
146
-
147
- async function downloadUrlToBufferWithFallback(url) {
148
- let firstError
149
- try {
150
- return await downloadUrlToBuffer(url)
151
- } catch (e) {
152
- firstError = e
153
- }
154
-
155
- const tmpRoot = path.join(os.tmpdir(), `ripgrep-dl-${process.pid}-${Date.now()}`)
156
- const tmpFile = path.join(tmpRoot, "archive")
157
- mkdirSync(tmpRoot, { recursive: true })
158
- try {
159
- if (process.platform === "win32" && tryPowerShellDownload(url, tmpFile)) {
160
- return readFileSync(tmpFile)
161
- }
162
- if (tryCurlDownload(url, tmpFile)) {
163
- return readFileSync(tmpFile)
164
- }
165
- } finally {
166
- rmSync(tmpRoot, { recursive: true, force: true })
167
- }
168
-
169
- throw firstError
170
- }
171
-
172
- // --- Extract ---
173
-
174
- function findZipEntryKey(files, want) {
175
- return Object.keys(files).find((k) => {
176
- const norm = k.replace(/\\/g, "/")
177
- return norm === want || norm.endsWith(`/${want}`)
178
- })
179
- }
180
-
181
- async function extractZip(buffer, binaryPath, extractedBinary) {
182
- const binaryDir = path.dirname(binaryPath)
183
- // Try fflate first (bundled dep)
184
- let fflateError
185
- try {
186
- const { unzipSync } = require("fflate")
187
- const unzipped = unzipSync(new Uint8Array(buffer))
188
- const key = findZipEntryKey(unzipped, extractedBinary)
189
- if (!key) {
190
- throw new Error(`Binary ${extractedBinary} not found in zip`)
191
- }
192
- writeFileSync(binaryPath, Buffer.from(unzipped[key]))
193
- return
194
- } catch (e) {
195
- fflateError = e
196
- }
197
-
198
- // Fallback: PowerShell Expand-Archive or unzip CLI
199
- const tmpDir = path.join(binaryDir, ".tmp-download")
200
- rmSync(tmpDir, { recursive: true, force: true })
201
- mkdirSync(tmpDir, { recursive: true })
202
- try {
203
- const assetName = `archive.zip`
204
- const archivePath = path.join(tmpDir, assetName)
205
- writeFileSync(archivePath, buffer)
206
-
207
- let extracted = false
208
- if (process.platform === "win32") {
209
- const psCmd = `Expand-Archive -Path '${archivePath.replace(/'/g, "''")}' -DestinationPath '${tmpDir.replace(/'/g, "''")}' -Force`
210
- const psResult = spawnSync(
211
- "powershell.exe",
212
- ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", psCmd],
213
- { stdio: "pipe", windowsHide: true },
214
- )
215
- if (psResult.status === 0) {
216
- extracted = true
217
- }
218
- }
219
-
220
- if (!extracted) {
221
- const result = spawnSync("unzip", ["-o", archivePath, "-d", tmpDir], { stdio: "pipe" })
222
- if (result.status !== 0) {
223
- const unzipErr = result.stderr?.toString().trim() || "command not found"
224
- const fflateMsg = fflateError instanceof Error ? fflateError.message : String(fflateError)
225
- throw new Error(`zip extraction failed (fflate: ${fflateMsg}; unzip: ${unzipErr})`)
226
- }
227
- }
228
-
229
- const srcBinary = path.join(tmpDir, extractedBinary)
230
- if (!existsSync(srcBinary)) {
231
- throw new Error(`Binary not found at expected path: ${srcBinary}`)
232
- }
233
- renameSync(srcBinary, binaryPath)
234
- } finally {
235
- rmSync(tmpDir, { recursive: true, force: true })
236
- }
237
- }
238
-
239
- async function extractTarGz(buffer, binaryPath, extractedBinary, assetName) {
240
- const binaryDir = path.dirname(binaryPath)
241
- const tmpDir = path.join(binaryDir, ".tmp-download")
242
- rmSync(tmpDir, { recursive: true, force: true })
243
- mkdirSync(tmpDir, { recursive: true })
244
- try {
245
- const archivePath = path.join(tmpDir, assetName)
246
- writeFileSync(archivePath, buffer)
247
- const result = spawnSync("tar", ["xzf", archivePath, "-C", tmpDir], { stdio: "pipe" })
248
- if (result.status !== 0) {
249
- throw new Error(`tar extract failed: ${result.stderr?.toString()}`)
250
- }
251
- const srcBinary = path.join(tmpDir, extractedBinary)
252
- if (!existsSync(srcBinary)) {
253
- throw new Error(`Binary not found at expected path: ${srcBinary}`)
254
- }
255
- renameSync(srcBinary, binaryPath)
256
- } finally {
257
- rmSync(tmpDir, { recursive: true, force: true })
258
- }
259
- }
260
-
261
- // --- Main ---
262
-
263
- async function downloadAndExtract() {
264
- const { target, ext } = getPlatformMapping()
265
- const assetName = `ripgrep-v${RG_VERSION}-${target}.${ext}`
266
-
267
- const binaryPath = getBinaryPath()
268
- const binaryDir = path.dirname(binaryPath)
269
-
270
- const force = process.argv.includes("--force")
271
- if (!force && existsSync(binaryPath)) {
272
- const stat = statSync(binaryPath)
273
- if (stat.size > 0) {
274
- console.log(`[ripgrep] Binary already exists at ${binaryPath}, skipping.`)
275
- return
276
- }
277
- }
278
-
279
- console.log(`[ripgrep] Downloading v${RG_VERSION} for ${target}...`)
280
-
281
- const extractedBinary = process.platform === "win32" ? "rg.exe" : "rg"
282
-
283
- const mirrors = [RELEASE_BASE]
284
- if (RELEASE_BASE === DEFAULT_RELEASE_BASE.replace(/\/$/, "")) {
285
- mirrors.push(MIRROR_RELEASE_BASE.replace(/\/$/, ""))
286
- }
287
-
288
- let buffer
289
- let lastError
290
- for (const base of mirrors) {
291
- const url = `${base}/${assetName}`
292
- try {
293
- console.log(`[ripgrep] Trying ${url}`)
294
- buffer = await downloadUrlToBufferWithFallback(url)
295
- break
296
- } catch (e) {
297
- console.warn(`[ripgrep] Download from ${base} failed: ${e instanceof Error ? e.message : e}`)
298
- lastError = e
299
- }
300
- }
301
- if (!buffer) {
302
- throw lastError
303
- }
304
-
305
- try {
306
- console.log(`[ripgrep] Downloaded ${Math.round(buffer.length / 1024)} KB`)
307
-
308
- mkdirSync(binaryDir, { recursive: true })
309
-
310
- if (ext === "tar.gz") {
311
- await extractTarGz(buffer, binaryPath, extractedBinary, assetName)
312
- } else {
313
- await extractZip(buffer, binaryPath, extractedBinary)
314
- }
315
-
316
- if (process.platform !== "win32") {
317
- chmodSync(binaryPath, 0o755)
318
- }
319
-
320
- console.log(`[ripgrep] Installed to ${binaryPath}`)
321
- } catch (e) {
322
- const msg = e instanceof Error ? e.message : String(e)
323
- const hint =
324
- "Check network or set HTTPS_PROXY. If GitHub is blocked, set RIPGREP_DOWNLOAD_BASE to a mirror (see script header)."
325
- throw new Error(`${msg} ${hint}`)
326
- }
327
- }
328
-
329
- async function main() {
330
- await downloadAndExtract()
331
- }
332
-
333
- main().catch((error) => {
334
- const msg = error instanceof Error ? error.message : String(error)
335
- console.error(`[postinstall] ripgrep download failed (non-fatal): ${msg}`)
336
- console.error(`[postinstall] You can install ripgrep manually: https://github.com/BurntSushi/ripgrep#installation`)
337
- // Never exit with error code — postinstall must not break install
338
- process.exit(0)
339
- })
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Postinstall script — runs automatically after `bun install` or `npm install`.
4
+ *
5
+ * Downloads ripgrep binary (idempotent, skips if exists).
6
+ * Works in dev mode (src/ exists), published mode (dist/ exists), with bun or node.
7
+ *
8
+ * Usage:
9
+ * node scripts/postinstall.js
10
+ * node scripts/postinstall.js --force
11
+ * bun run scripts/postinstall.js
12
+ */
13
+
14
+ const { existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync, chmodSync } =
15
+ require("fs")
16
+ const { spawnSync } = require("child_process")
17
+ const { setDefaultResultOrder } = require("node:dns")
18
+ const path = require("path")
19
+ const os = require("os")
20
+
21
+ // Prefer IPv4 first — Bun on Windows sometimes fails GitHub over broken IPv6 paths.
22
+ try {
23
+ setDefaultResultOrder("ipv4first")
24
+ } catch {
25
+ /* ignore */
26
+ }
27
+
28
+ // --- Config ---
29
+
30
+ const RG_VERSION = "15.0.1"
31
+ const DEFAULT_RELEASE_BASE = `https://github.com/microsoft/ripgrep-prebuilt/releases/download/v${RG_VERSION}`
32
+ const MIRROR_RELEASE_BASE = `https://ghproxy.net/https://github.com/microsoft/ripgrep-prebuilt/releases/download/v${RG_VERSION}`
33
+ const RELEASE_BASE = (process.env.RIPGREP_DOWNLOAD_BASE ?? DEFAULT_RELEASE_BASE).replace(/\/$/, "")
34
+
35
+ const scriptDir = path.dirname(__filename)
36
+ const projectRoot = path.resolve(scriptDir, "..")
37
+
38
+ // --- Platform mapping ---
39
+
40
+ function getPlatformMapping() {
41
+ const arch = process.arch
42
+ const platform = process.platform
43
+
44
+ if (platform === "darwin") {
45
+ if (arch === "arm64") return { target: "aarch64-apple-darwin", ext: "tar.gz" }
46
+ if (arch === "x64") return { target: "x86_64-apple-darwin", ext: "tar.gz" }
47
+ throw new Error(`Unsupported macOS arch: ${arch}`)
48
+ }
49
+
50
+ if (platform === "win32") {
51
+ if (arch === "x64") return { target: "x86_64-pc-windows-msvc", ext: "zip" }
52
+ if (arch === "arm64") return { target: "aarch64-pc-windows-msvc", ext: "zip" }
53
+ throw new Error(`Unsupported Windows arch: ${arch}`)
54
+ }
55
+
56
+ if (platform === "linux") {
57
+ const isMusl = detectMusl()
58
+ if (arch === "x64") {
59
+ return { target: "x86_64-unknown-linux-musl", ext: "tar.gz" }
60
+ }
61
+ if (arch === "arm64") {
62
+ return isMusl
63
+ ? { target: "aarch64-unknown-linux-musl", ext: "tar.gz" }
64
+ : { target: "aarch64-unknown-linux-gnu", ext: "tar.gz" }
65
+ }
66
+ throw new Error(`Unsupported Linux arch: ${arch}`)
67
+ }
68
+
69
+ throw new Error(`Unsupported platform: ${platform}`)
70
+ }
71
+
72
+ function detectMusl() {
73
+ const muslArch = process.arch === "x64" ? "x86_64" : "aarch64"
74
+ try {
75
+ statSync(`/lib/libc.musl-${muslArch}.so.1`)
76
+ return true
77
+ } catch {
78
+ return false
79
+ }
80
+ }
81
+
82
+ // --- Paths ---
83
+
84
+ function getVendorDir() {
85
+ if (existsSync(path.join(projectRoot, "src"))) {
86
+ return path.resolve(projectRoot, "src", "utils", "vendor", "ripgrep")
87
+ }
88
+ return path.resolve(projectRoot, "dist", "vendor", "ripgrep")
89
+ }
90
+
91
+ function getBinaryPath() {
92
+ const dir = getVendorDir()
93
+ const subdir = `${process.arch}-${process.platform}`
94
+ const binary = process.platform === "win32" ? "rg.exe" : "rg"
95
+ return path.resolve(dir, subdir, binary)
96
+ }
97
+
98
+ // --- Download helpers ---
99
+
100
+ function proxyEnvSet() {
101
+ const v = (s) => (s ?? "").trim()
102
+ return !!(v(process.env.HTTPS_PROXY) || v(process.env.HTTP_PROXY) || v(process.env.ALL_PROXY) || v(process.env.https_proxy) || v(process.env.http_proxy))
103
+ }
104
+
105
+ function tryPowerShellDownload(url, dest) {
106
+ const u = url.replace(/'/g, "''")
107
+ const d = dest.replace(/'/g, "''")
108
+ const cmd = `Invoke-WebRequest -Uri '${u}' -OutFile '${d}' -UseBasicParsing`
109
+ const result = spawnSync(
110
+ "powershell.exe",
111
+ ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", cmd],
112
+ { stdio: "pipe", windowsHide: true },
113
+ )
114
+ return result.status === 0 && existsSync(dest) && statSync(dest).size > 0
115
+ }
116
+
117
+ function tryCurlDownload(url, dest) {
118
+ const curl = process.platform === "win32" ? "curl.exe" : "curl"
119
+ const result = spawnSync(curl, ["-fsSL", "-L", "--fail", "-o", dest, url], {
120
+ stdio: "pipe",
121
+ windowsHide: true,
122
+ })
123
+ return result.status === 0 && existsSync(dest) && statSync(dest).size > 0
124
+ }
125
+
126
+ async function fetchRelease(url) {
127
+ if (proxyEnvSet()) {
128
+ // Dynamic require so it works in node without bundling issues
129
+ const undici = require("undici")
130
+ return await undici.fetch(url, {
131
+ redirect: "follow",
132
+ dispatcher: new undici.EnvHttpProxyAgent(),
133
+ })
134
+ }
135
+ // Node 18+ has global fetch, Bun has it too
136
+ return await fetch(url, { redirect: "follow" })
137
+ }
138
+
139
+ async function downloadUrlToBuffer(url) {
140
+ const response = await fetchRelease(url)
141
+ if (!response.ok) {
142
+ throw new Error(`Download failed: ${response.status} ${response.statusText}`)
143
+ }
144
+ return Buffer.from(await response.arrayBuffer())
145
+ }
146
+
147
+ async function downloadUrlToBufferWithFallback(url) {
148
+ let firstError
149
+ try {
150
+ return await downloadUrlToBuffer(url)
151
+ } catch (e) {
152
+ firstError = e
153
+ }
154
+
155
+ const tmpRoot = path.join(os.tmpdir(), `ripgrep-dl-${process.pid}-${Date.now()}`)
156
+ const tmpFile = path.join(tmpRoot, "archive")
157
+ mkdirSync(tmpRoot, { recursive: true })
158
+ try {
159
+ if (process.platform === "win32" && tryPowerShellDownload(url, tmpFile)) {
160
+ return readFileSync(tmpFile)
161
+ }
162
+ if (tryCurlDownload(url, tmpFile)) {
163
+ return readFileSync(tmpFile)
164
+ }
165
+ } finally {
166
+ rmSync(tmpRoot, { recursive: true, force: true })
167
+ }
168
+
169
+ throw firstError
170
+ }
171
+
172
+ // --- Extract ---
173
+
174
+ function findZipEntryKey(files, want) {
175
+ return Object.keys(files).find((k) => {
176
+ const norm = k.replace(/\\/g, "/")
177
+ return norm === want || norm.endsWith(`/${want}`)
178
+ })
179
+ }
180
+
181
+ async function extractZip(buffer, binaryPath, extractedBinary) {
182
+ const binaryDir = path.dirname(binaryPath)
183
+ // Try fflate first (bundled dep)
184
+ let fflateError
185
+ try {
186
+ const { unzipSync } = require("fflate")
187
+ const unzipped = unzipSync(new Uint8Array(buffer))
188
+ const key = findZipEntryKey(unzipped, extractedBinary)
189
+ if (!key) {
190
+ throw new Error(`Binary ${extractedBinary} not found in zip`)
191
+ }
192
+ writeFileSync(binaryPath, Buffer.from(unzipped[key]))
193
+ return
194
+ } catch (e) {
195
+ fflateError = e
196
+ }
197
+
198
+ // Fallback: PowerShell Expand-Archive or unzip CLI
199
+ const tmpDir = path.join(binaryDir, ".tmp-download")
200
+ rmSync(tmpDir, { recursive: true, force: true })
201
+ mkdirSync(tmpDir, { recursive: true })
202
+ try {
203
+ const assetName = `archive.zip`
204
+ const archivePath = path.join(tmpDir, assetName)
205
+ writeFileSync(archivePath, buffer)
206
+
207
+ let extracted = false
208
+ if (process.platform === "win32") {
209
+ const psCmd = `Expand-Archive -Path '${archivePath.replace(/'/g, "''")}' -DestinationPath '${tmpDir.replace(/'/g, "''")}' -Force`
210
+ const psResult = spawnSync(
211
+ "powershell.exe",
212
+ ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", psCmd],
213
+ { stdio: "pipe", windowsHide: true },
214
+ )
215
+ if (psResult.status === 0) {
216
+ extracted = true
217
+ }
218
+ }
219
+
220
+ if (!extracted) {
221
+ const result = spawnSync("unzip", ["-o", archivePath, "-d", tmpDir], { stdio: "pipe" })
222
+ if (result.status !== 0) {
223
+ const unzipErr = result.stderr?.toString().trim() || "command not found"
224
+ const fflateMsg = fflateError instanceof Error ? fflateError.message : String(fflateError)
225
+ throw new Error(`zip extraction failed (fflate: ${fflateMsg}; unzip: ${unzipErr})`)
226
+ }
227
+ }
228
+
229
+ const srcBinary = path.join(tmpDir, extractedBinary)
230
+ if (!existsSync(srcBinary)) {
231
+ throw new Error(`Binary not found at expected path: ${srcBinary}`)
232
+ }
233
+ renameSync(srcBinary, binaryPath)
234
+ } finally {
235
+ rmSync(tmpDir, { recursive: true, force: true })
236
+ }
237
+ }
238
+
239
+ async function extractTarGz(buffer, binaryPath, extractedBinary, assetName) {
240
+ const binaryDir = path.dirname(binaryPath)
241
+ const tmpDir = path.join(binaryDir, ".tmp-download")
242
+ rmSync(tmpDir, { recursive: true, force: true })
243
+ mkdirSync(tmpDir, { recursive: true })
244
+ try {
245
+ const archivePath = path.join(tmpDir, assetName)
246
+ writeFileSync(archivePath, buffer)
247
+ const result = spawnSync("tar", ["xzf", archivePath, "-C", tmpDir], { stdio: "pipe" })
248
+ if (result.status !== 0) {
249
+ throw new Error(`tar extract failed: ${result.stderr?.toString()}`)
250
+ }
251
+ const srcBinary = path.join(tmpDir, extractedBinary)
252
+ if (!existsSync(srcBinary)) {
253
+ throw new Error(`Binary not found at expected path: ${srcBinary}`)
254
+ }
255
+ renameSync(srcBinary, binaryPath)
256
+ } finally {
257
+ rmSync(tmpDir, { recursive: true, force: true })
258
+ }
259
+ }
260
+
261
+ // --- Main ---
262
+
263
+ async function downloadAndExtract() {
264
+ const { target, ext } = getPlatformMapping()
265
+ const assetName = `ripgrep-v${RG_VERSION}-${target}.${ext}`
266
+
267
+ const binaryPath = getBinaryPath()
268
+ const binaryDir = path.dirname(binaryPath)
269
+
270
+ const force = process.argv.includes("--force")
271
+ if (!force && existsSync(binaryPath)) {
272
+ const stat = statSync(binaryPath)
273
+ if (stat.size > 0) {
274
+ console.log(`[ripgrep] Binary already exists at ${binaryPath}, skipping.`)
275
+ return
276
+ }
277
+ }
278
+
279
+ console.log(`[ripgrep] Downloading v${RG_VERSION} for ${target}...`)
280
+
281
+ const extractedBinary = process.platform === "win32" ? "rg.exe" : "rg"
282
+
283
+ const mirrors = [RELEASE_BASE]
284
+ if (RELEASE_BASE === DEFAULT_RELEASE_BASE.replace(/\/$/, "")) {
285
+ mirrors.push(MIRROR_RELEASE_BASE.replace(/\/$/, ""))
286
+ }
287
+
288
+ let buffer
289
+ let lastError
290
+ for (const base of mirrors) {
291
+ const url = `${base}/${assetName}`
292
+ try {
293
+ console.log(`[ripgrep] Trying ${url}`)
294
+ buffer = await downloadUrlToBufferWithFallback(url)
295
+ break
296
+ } catch (e) {
297
+ console.warn(`[ripgrep] Download from ${base} failed: ${e instanceof Error ? e.message : e}`)
298
+ lastError = e
299
+ }
300
+ }
301
+ if (!buffer) {
302
+ throw lastError
303
+ }
304
+
305
+ try {
306
+ console.log(`[ripgrep] Downloaded ${Math.round(buffer.length / 1024)} KB`)
307
+
308
+ mkdirSync(binaryDir, { recursive: true })
309
+
310
+ if (ext === "tar.gz") {
311
+ await extractTarGz(buffer, binaryPath, extractedBinary, assetName)
312
+ } else {
313
+ await extractZip(buffer, binaryPath, extractedBinary)
314
+ }
315
+
316
+ if (process.platform !== "win32") {
317
+ chmodSync(binaryPath, 0o755)
318
+ }
319
+
320
+ console.log(`[ripgrep] Installed to ${binaryPath}`)
321
+ } catch (e) {
322
+ const msg = e instanceof Error ? e.message : String(e)
323
+ const hint =
324
+ "Check network or set HTTPS_PROXY. If GitHub is blocked, set RIPGREP_DOWNLOAD_BASE to a mirror (see script header)."
325
+ throw new Error(`${msg} ${hint}`)
326
+ }
327
+ }
328
+
329
+ async function main() {
330
+ await downloadAndExtract()
331
+ }
332
+
333
+ main().catch((error) => {
334
+ const msg = error instanceof Error ? error.message : String(error)
335
+ console.error(`[postinstall] ripgrep download failed (non-fatal): ${msg}`)
336
+ console.error(`[postinstall] You can install ripgrep manually: https://github.com/BurntSushi/ripgrep#installation`)
337
+ // Never exit with error code — postinstall must not break install
338
+ process.exit(0)
339
+ })