@spikonado/sprocket 0.3.9 → 0.4.0

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 (363) hide show
  1. package/README.md +17 -139
  2. package/THIRD_PARTY_NOTICES.md +0 -26
  3. package/lib/launcher.js +13 -0
  4. package/lib/update-api.js +2 -0
  5. package/lib/update.js +206 -3
  6. package/package.json +6 -6
  7. package/web/_app/immutable/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  8. package/web/_app/immutable/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  9. package/web/_app/immutable/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  10. package/web/_app/immutable/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  11. package/web/_app/immutable/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  12. package/web/_app/immutable/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  13. package/web/_app/immutable/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  14. package/web/_app/immutable/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  15. package/web/_app/immutable/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  16. package/web/_app/immutable/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  17. package/web/_app/immutable/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  18. package/web/_app/immutable/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  19. package/web/_app/immutable/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  20. package/web/_app/immutable/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  21. package/web/_app/immutable/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  22. package/web/_app/immutable/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  23. package/web/_app/immutable/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  24. package/web/_app/immutable/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  25. package/web/_app/immutable/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  26. package/web/_app/immutable/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  27. package/web/_app/immutable/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  28. package/web/_app/immutable/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  29. package/web/_app/immutable/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  30. package/web/_app/immutable/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  31. package/web/_app/immutable/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  32. package/web/_app/immutable/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  33. package/web/_app/immutable/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  34. package/web/_app/immutable/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  35. package/web/_app/immutable/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  36. package/web/_app/immutable/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  37. package/web/_app/immutable/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  38. package/web/_app/immutable/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  39. package/web/_app/immutable/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  40. package/web/_app/immutable/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  41. package/web/_app/immutable/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  42. package/web/_app/immutable/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  43. package/web/_app/immutable/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  44. package/web/_app/immutable/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  45. package/web/_app/immutable/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  46. package/web/_app/immutable/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  47. package/web/_app/immutable/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  48. package/web/_app/immutable/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  49. package/web/_app/immutable/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  50. package/web/_app/immutable/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  51. package/web/_app/immutable/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  52. package/web/_app/immutable/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  53. package/web/_app/immutable/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  54. package/web/_app/immutable/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  55. package/web/_app/immutable/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  56. package/web/_app/immutable/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  57. package/web/_app/immutable/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  58. package/web/_app/immutable/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  59. package/web/_app/immutable/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  60. package/web/_app/immutable/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  61. package/web/_app/immutable/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  62. package/web/_app/immutable/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  63. package/web/_app/immutable/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  64. package/web/_app/immutable/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  65. package/web/_app/immutable/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  66. package/web/_app/immutable/abap-CLvhMVsD.js +1 -0
  67. package/web/_app/immutable/actionscript-3-Cs6JJXT5.js +1 -0
  68. package/web/_app/immutable/ada-X3Y2mlq2.js +1 -0
  69. package/web/_app/immutable/ahk-DwADkxyd.js +1 -0
  70. package/web/_app/immutable/ahk2-_6rzW9BS.js +1 -0
  71. package/web/_app/immutable/angular-html-4GjfXERL.js +1 -0
  72. package/web/_app/immutable/angular-ts-CMIe06P5.js +1 -0
  73. package/web/_app/immutable/apache-U0d_L8uA.js +1 -0
  74. package/web/_app/immutable/apex-KFGFyKwG.js +1 -0
  75. package/web/_app/immutable/apl-C_n2qsRM.js +1 -0
  76. package/web/_app/immutable/applescript-CCn79oCD.js +1 -0
  77. package/web/_app/immutable/ara-4CJ0cIlV.js +1 -0
  78. package/web/_app/immutable/asciidoc-SCjQUq34.js +1 -0
  79. package/web/_app/immutable/asm-Cmm7eHzH.js +1 -0
  80. package/web/_app/immutable/astro-DVbyChwj.js +1 -0
  81. package/web/_app/immutable/awk-BWXHIvNe.js +1 -0
  82. package/web/_app/immutable/ballerina-B7ZEbQpA.js +1 -0
  83. package/web/_app/immutable/bat-qdxAdBWQ.js +1 -0
  84. package/web/_app/immutable/beancount-C2IN4Vk8.js +1 -0
  85. package/web/_app/immutable/berry-DKpUyyne.js +1 -0
  86. package/web/_app/immutable/bibtex-Ci_nEsc7.js +1 -0
  87. package/web/_app/immutable/bicep-CUHmPFLl.js +1 -0
  88. package/web/_app/immutable/bird2-CYIUgYqB.js +1 -0
  89. package/web/_app/immutable/blade-fXxNj9V7.js +1 -0
  90. package/web/_app/immutable/bsl-CVED6lJ1.js +1 -0
  91. package/web/_app/immutable/c-BN2Efy0k.js +1 -0
  92. package/web/_app/immutable/c3-D0apG41V.js +1 -0
  93. package/web/_app/immutable/cadence-CQ2zXKGN.js +1 -0
  94. package/web/_app/immutable/cairo-DRAZz75c.js +1 -0
  95. package/web/_app/immutable/chapel-BRkNuByD.js +1 -0
  96. package/web/_app/immutable/clarity-CtfBBspg.js +1 -0
  97. package/web/_app/immutable/clojure-DqKBuwfJ.js +1 -0
  98. package/web/_app/immutable/cmake-Bj61d0ZC.js +1 -0
  99. package/web/_app/immutable/cobol-C5lGhzFi.js +1 -0
  100. package/web/_app/immutable/code-highlighting-client-Kw4BuD-0.js +1 -0
  101. package/web/_app/immutable/code-highlighting-worker-DggeS8YA.js +152 -0
  102. package/web/_app/immutable/codeowners-C8r90Shi.js +1 -0
  103. package/web/_app/immutable/codeql-oeQT6MSM.js +1 -0
  104. package/web/_app/immutable/coffee-B6MzRpQ_.js +1 -0
  105. package/web/_app/immutable/common-lisp-Cv5bFMCO.js +1 -0
  106. package/web/_app/immutable/coq-CGaSfhwR.js +1 -0
  107. package/web/_app/immutable/cpp-DEVtvotx.js +1 -0
  108. package/web/_app/immutable/crystal-DY2QsCJ5.js +1 -0
  109. package/web/_app/immutable/csharp-dmMxLVLW.js +1 -0
  110. package/web/_app/immutable/css-ButQfvJ9.js +1 -0
  111. package/web/_app/immutable/csv-Dx-8-gkx.js +1 -0
  112. package/web/_app/immutable/cue-CE9AQfxI.js +1 -0
  113. package/web/_app/immutable/cypher-ClKdZ_lG.js +1 -0
  114. package/web/_app/immutable/d-qD-0Kul2.js +1 -0
  115. package/web/_app/immutable/dart-CHZY9Xhz.js +1 -0
  116. package/web/_app/immutable/dax-BkyTk9wS.js +1 -0
  117. package/web/_app/immutable/desktop-Dlh5hvp9.js +1 -0
  118. package/web/_app/immutable/diff-woXpYk--.js +1 -0
  119. package/web/_app/immutable/docker-IyjqRm3v.js +1 -0
  120. package/web/_app/immutable/dotenv-CuH5my32.js +1 -0
  121. package/web/_app/immutable/dream-maker-DW3nJb8Q.js +1 -0
  122. package/web/_app/immutable/edge-CUJd9T1a.js +1 -0
  123. package/web/_app/immutable/elixir-DIdSb3yA.js +1 -0
  124. package/web/_app/immutable/elm-M8_LX84X.js +1 -0
  125. package/web/_app/immutable/emacs-lisp-DR2vtWaj.js +1 -0
  126. package/web/_app/immutable/erb-zGFWLWtt.js +1 -0
  127. package/web/_app/immutable/erlang-BXdgHVfi.js +1 -0
  128. package/web/_app/immutable/fennel-DQxkIbk2.js +1 -0
  129. package/web/_app/immutable/fish-BJitypiv.js +1 -0
  130. package/web/_app/immutable/fluent-C03EYrpw.js +1 -0
  131. package/web/_app/immutable/fortran-fixed-form-D6mN0kjy.js +1 -0
  132. package/web/_app/immutable/fortran-free-form-CYNrtFtB.js +1 -0
  133. package/web/_app/immutable/fsharp-CwoEF39o.js +1 -0
  134. package/web/_app/immutable/gdresource-CZkFGo3B.js +1 -0
  135. package/web/_app/immutable/gdscript-DYvRD3hg.js +1 -0
  136. package/web/_app/immutable/gdshader-CBce3t8t.js +1 -0
  137. package/web/_app/immutable/genie-CV2tkWYe.js +1 -0
  138. package/web/_app/immutable/gherkin-DExj1W_8.js +1 -0
  139. package/web/_app/immutable/git-commit-dUGrvm6Q.js +1 -0
  140. package/web/_app/immutable/git-rebase-CC2D0L3b.js +1 -0
  141. package/web/_app/immutable/github-dark-C-LZuMrd.js +1 -0
  142. package/web/_app/immutable/github-light-EUqPIrTm.js +1 -0
  143. package/web/_app/immutable/gleam-CSRkHgEL.js +1 -0
  144. package/web/_app/immutable/glimmer-js-BcY5kv6g.js +1 -0
  145. package/web/_app/immutable/glimmer-ts-Di8deFFz.js +1 -0
  146. package/web/_app/immutable/glsl-BRJcCqLP.js +1 -0
  147. package/web/_app/immutable/gn-CAXYAgV-.js +1 -0
  148. package/web/_app/immutable/gnuplot-7GGW24-e.js +1 -0
  149. package/web/_app/immutable/go-rLFTqkRN.js +1 -0
  150. package/web/_app/immutable/graphql-C_JO00Ae.js +1 -0
  151. package/web/_app/immutable/groovy-CacY0gHj.js +1 -0
  152. package/web/_app/immutable/hack-G3VVQMXb.js +1 -0
  153. package/web/_app/immutable/haml-D2MeFmBN.js +1 -0
  154. package/web/_app/immutable/handlebars-D90wEzz2.js +1 -0
  155. package/web/_app/immutable/haskell-D8IpX4py.js +1 -0
  156. package/web/_app/immutable/haxe-C8oCnwJJ.js +1 -0
  157. package/web/_app/immutable/hcl-Dh228itO.js +1 -0
  158. package/web/_app/immutable/hjson-CxZEssPk.js +1 -0
  159. package/web/_app/immutable/hlsl-Cvrh5tZx.js +1 -0
  160. package/web/_app/immutable/html-Bh1WMhz0.js +1 -0
  161. package/web/_app/immutable/html-derivative-PuQZwSU6.js +1 -0
  162. package/web/_app/immutable/http-Ca96onGD.js +1 -0
  163. package/web/_app/immutable/hurl-B6pjbC8I.js +1 -0
  164. package/web/_app/immutable/hxml-D7Y24wKF.js +1 -0
  165. package/web/_app/immutable/hy-CZbG8q4J.js +1 -0
  166. package/web/_app/immutable/imba-DsUTQ-LC.js +1 -0
  167. package/web/_app/immutable/index-BXBJDEO8.js +488 -0
  168. package/web/_app/immutable/index-CrTwMgLf.css +1 -0
  169. package/web/_app/immutable/ini-B5eOa1yu.js +1 -0
  170. package/web/_app/immutable/java-arvjb7dT.js +1 -0
  171. package/web/_app/immutable/javascript-BZ1jt5sy.js +1 -0
  172. package/web/_app/immutable/jinja-CpnHkcj3.js +1 -0
  173. package/web/_app/immutable/jison-BPHKadT3.js +1 -0
  174. package/web/_app/immutable/json-DSjaFVfj.js +1 -0
  175. package/web/_app/immutable/json5-BR5RXkoi.js +1 -0
  176. package/web/_app/immutable/jsonc-CYpm1nAK.js +1 -0
  177. package/web/_app/immutable/jsonl-CmCQp5Yx.js +1 -0
  178. package/web/_app/immutable/jsonnet-CJTPZ8u_.js +1 -0
  179. package/web/_app/immutable/jssm-DXw9l8Rf.js +1 -0
  180. package/web/_app/immutable/jsx-BUqYaOvu.js +1 -0
  181. package/web/_app/immutable/julia-BcfWwmw0.js +1 -0
  182. package/web/_app/immutable/just-BXyEegjy.js +1 -0
  183. package/web/_app/immutable/kdl-CsD5j6eV.js +1 -0
  184. package/web/_app/immutable/kotlin-DhhofPvG.js +1 -0
  185. package/web/_app/immutable/kusto-C7mF5XQf.js +1 -0
  186. package/web/_app/immutable/latex-CU7LUjt5.js +1 -0
  187. package/web/_app/immutable/lean-CewbzKMR.js +1 -0
  188. package/web/_app/immutable/less-DVTAwKKz.js +1 -0
  189. package/web/_app/immutable/liquid-CRzX7bbg.js +1 -0
  190. package/web/_app/immutable/llvm-DqHOMS-s.js +1 -0
  191. package/web/_app/immutable/log-BNLmms1o.js +1 -0
  192. package/web/_app/immutable/logo-Cluzi2Zq.js +1 -0
  193. package/web/_app/immutable/lua-BSDiLMEb.js +1 -0
  194. package/web/_app/immutable/luau-VGWVLoqX.js +1 -0
  195. package/web/_app/immutable/make-Dixweg8N.js +1 -0
  196. package/web/_app/immutable/markdown-BYOwaDjH.js +1 -0
  197. package/web/_app/immutable/marko-DnR7eH34.js +1 -0
  198. package/web/_app/immutable/matlab-D7qyCx1q.js +1 -0
  199. package/web/_app/immutable/mdc-CcZh7-T1.js +1 -0
  200. package/web/_app/immutable/mdx-DQZ5AkYe.js +1 -0
  201. package/web/_app/immutable/mermaid-BxpfTIzt.js +1 -0
  202. package/web/_app/immutable/mipsasm-BMqwQI7S.js +1 -0
  203. package/web/_app/immutable/mojo-fg40_ntQ.js +1 -0
  204. package/web/_app/immutable/moonbit-D9W784E_.js +1 -0
  205. package/web/_app/immutable/move-BYnGhZoM.js +1 -0
  206. package/web/_app/immutable/narrat-_X_XdTYD.js +1 -0
  207. package/web/_app/immutable/nextflow-BoTnSBQ_.js +1 -0
  208. package/web/_app/immutable/nextflow-groovy-D7IRt6Pp.js +1 -0
  209. package/web/_app/immutable/nginx-BwbdCB4h.js +1 -0
  210. package/web/_app/immutable/nim-xocOj6ZV.js +1 -0
  211. package/web/_app/immutable/nix-Cl_7024t.js +1 -0
  212. package/web/_app/immutable/nsis-CjNLYCLg.js +1 -0
  213. package/web/_app/immutable/nushell--0fT3PI1.js +1 -0
  214. package/web/_app/immutable/objective-c-D1A_Heim.js +1 -0
  215. package/web/_app/immutable/objective-cpp-BsSzOQcm.js +1 -0
  216. package/web/_app/immutable/ocaml-O90oeIOV.js +1 -0
  217. package/web/_app/immutable/odin-B1RWQWA5.js +1 -0
  218. package/web/_app/immutable/openscad-BUDT5pXO.js +1 -0
  219. package/web/_app/immutable/org-0-F7ov1Z.js +1 -0
  220. package/web/_app/immutable/pascal-4ZHwLPI5.js +1 -0
  221. package/web/_app/immutable/perl-DeAhIPOw.js +1 -0
  222. package/web/_app/immutable/php-kXpePHVd.js +1 -0
  223. package/web/_app/immutable/pkl-ot-7Btpt.js +1 -0
  224. package/web/_app/immutable/plsql-DGHpHOYJ.js +1 -0
  225. package/web/_app/immutable/po-BiJDBrnU.js +1 -0
  226. package/web/_app/immutable/polar-C7UOKdEL.js +1 -0
  227. package/web/_app/immutable/postcss-BXeXVLqQ.js +1 -0
  228. package/web/_app/immutable/powerquery-DNMTfnFr.js +1 -0
  229. package/web/_app/immutable/powershell-QtSnmXcu.js +1 -0
  230. package/web/_app/immutable/prisma-DMgNhnYS.js +1 -0
  231. package/web/_app/immutable/prolog-iXnhIJG7.js +1 -0
  232. package/web/_app/immutable/proto-DB4EqR-F.js +1 -0
  233. package/web/_app/immutable/pug-BYrzANIX.js +1 -0
  234. package/web/_app/immutable/puppet-CDv2pdJW.js +1 -0
  235. package/web/_app/immutable/purescript-9MfHhQsQ.js +1 -0
  236. package/web/_app/immutable/python-gzcpVVnB.js +1 -0
  237. package/web/_app/immutable/qml-CX-IPlpg.js +1 -0
  238. package/web/_app/immutable/qmldir-DCQb3MpD.js +1 -0
  239. package/web/_app/immutable/qss-Fe1Jh2GI.js +1 -0
  240. package/web/_app/immutable/r-B6Ii5NsL.js +1 -0
  241. package/web/_app/immutable/racket-DcIDlBhZ.js +1 -0
  242. package/web/_app/immutable/raku-B3gFvitq.js +1 -0
  243. package/web/_app/immutable/razor-B-rT9_rK.js +1 -0
  244. package/web/_app/immutable/rbs-C0MpOrj4.js +1 -0
  245. package/web/_app/immutable/reg-CRGYupPL.js +1 -0
  246. package/web/_app/immutable/regexp-DTgu7pRI.js +1 -0
  247. package/web/_app/immutable/rel-BtDbiS_P.js +1 -0
  248. package/web/_app/immutable/riscv-Ckw8ddFX.js +1 -0
  249. package/web/_app/immutable/ron-VUp2lXgN.js +1 -0
  250. package/web/_app/immutable/rosmsg-CAekHB0j.js +1 -0
  251. package/web/_app/immutable/rst-9klPfdbW.js +1 -0
  252. package/web/_app/immutable/ruby-VdW5O0lU.js +1 -0
  253. package/web/_app/immutable/rust-DpiIf5JO.js +1 -0
  254. package/web/_app/immutable/sas-BcoVW2jh.js +1 -0
  255. package/web/_app/immutable/sass-DXrisJhu.js +1 -0
  256. package/web/_app/immutable/scala-BiFt_7mu.js +1 -0
  257. package/web/_app/immutable/scheme-DQCgrYNe.js +1 -0
  258. package/web/_app/immutable/scss-CThZiyk2.js +1 -0
  259. package/web/_app/immutable/sdbl-bTVj8UrX.js +1 -0
  260. package/web/_app/immutable/shaderlab-C4rnI7x0.js +1 -0
  261. package/web/_app/immutable/shellscript-kDqMi17D.js +1 -0
  262. package/web/_app/immutable/shellsession-DhVMa4wd.js +1 -0
  263. package/web/_app/immutable/smalltalk-BHpQb5nM.js +1 -0
  264. package/web/_app/immutable/smithy-Dgaz7aur.js +1 -0
  265. package/web/_app/immutable/solidity-Bj7E1mRn.js +1 -0
  266. package/web/_app/immutable/soy-BRlK1riv.js +1 -0
  267. package/web/_app/immutable/sparql-C0ia5K60.js +1 -0
  268. package/web/_app/immutable/splunk-BC2Px7Mm.js +1 -0
  269. package/web/_app/immutable/sql-9_1rLYi9.js +1 -0
  270. package/web/_app/immutable/ssh-config-BgfXC-Er.js +1 -0
  271. package/web/_app/immutable/stata-CvZbhBNs.js +1 -0
  272. package/web/_app/immutable/stylus-B6D30XZt.js +1 -0
  273. package/web/_app/immutable/surrealql-BLPIhFjZ.js +1 -0
  274. package/web/_app/immutable/svelte-CXRnxaHV.js +1 -0
  275. package/web/_app/immutable/swift-CyEgAFGc.js +1 -0
  276. package/web/_app/immutable/system-verilog-Dh5ihWbf.js +1 -0
  277. package/web/_app/immutable/systemd-BxMlprV5.js +1 -0
  278. package/web/_app/immutable/talonscript-CohzipZa.js +1 -0
  279. package/web/_app/immutable/tasl-DMoTqEGO.js +1 -0
  280. package/web/_app/immutable/tcl-CZd0xW_V.js +1 -0
  281. package/web/_app/immutable/templ-BIXbEjSv.js +1 -0
  282. package/web/_app/immutable/terraform-DswuEJGm.js +1 -0
  283. package/web/_app/immutable/tex-CTC47p_4.js +1 -0
  284. package/web/_app/immutable/toml-CcmNWLt0.js +1 -0
  285. package/web/_app/immutable/ts-tags-q6t1QP-k.js +1 -0
  286. package/web/_app/immutable/tsv-sltzmVWM.js +1 -0
  287. package/web/_app/immutable/tsx-BACYK5_7.js +1 -0
  288. package/web/_app/immutable/turtle-ByJddavk.js +1 -0
  289. package/web/_app/immutable/twig-du-FAu_S.js +1 -0
  290. package/web/_app/immutable/typescript-UdazT59i.js +1 -0
  291. package/web/_app/immutable/typespec-BGhR2SqG.js +1 -0
  292. package/web/_app/immutable/typst-CwQmdlPz.js +1 -0
  293. package/web/_app/immutable/v-DBj4K9d_.js +1 -0
  294. package/web/_app/immutable/vala-zf12oZj6.js +1 -0
  295. package/web/_app/immutable/vb-DOwzaHZ0.js +1 -0
  296. package/web/_app/immutable/verilog-B2gwz-sJ.js +1 -0
  297. package/web/_app/immutable/vhdl-BroJfC0k.js +1 -0
  298. package/web/_app/immutable/viml-DvXPmvsu.js +1 -0
  299. package/web/_app/immutable/vue-Bl_ifCwv.js +1 -0
  300. package/web/_app/immutable/vue-html-Jt0TggoH.js +1 -0
  301. package/web/_app/immutable/vue-vine-BCOElGNY.js +1 -0
  302. package/web/_app/immutable/vyper-CgoNMtux.js +1 -0
  303. package/web/_app/immutable/wasm-ByWQv1Qj.js +1 -0
  304. package/web/_app/immutable/wenyan-C8pVoKbM.js +1 -0
  305. package/web/_app/immutable/wgsl-BsKzXJz4.js +1 -0
  306. package/web/_app/immutable/wikitext-ClFFjSW2.js +1 -0
  307. package/web/_app/immutable/wit-DdvCle-K.js +1 -0
  308. package/web/_app/immutable/wolfram-DLL8P-h_.js +1 -0
  309. package/web/_app/immutable/xml-CwHcdUOz.js +1 -0
  310. package/web/_app/immutable/xsl-CR7B95n6.js +1 -0
  311. package/web/_app/immutable/yaml-1d7XLDFm.js +1 -0
  312. package/web/_app/immutable/zenscript-BnlCZFoB.js +1 -0
  313. package/web/_app/immutable/zig-CMLA9XwU.js +1 -0
  314. package/web/index.html +6 -40
  315. package/web/_app/immutable/assets/0.DhTAbCoa.css +0 -2
  316. package/web/_app/immutable/assets/2.Dxz0Zeak.css +0 -1
  317. package/web/_app/immutable/chunks/B_0TmK76.js +0 -62
  318. package/web/_app/immutable/chunks/Bjy-W4x2.js +0 -81
  319. package/web/_app/immutable/chunks/BvmBrUGQ.js +0 -3
  320. package/web/_app/immutable/chunks/Ct62QGa7.js +0 -1
  321. package/web/_app/immutable/chunks/D5VhrrfP.js +0 -1
  322. package/web/_app/immutable/chunks/Dq0ey8RK.js +0 -2
  323. package/web/_app/immutable/chunks/iGtbSQf_.js +0 -1
  324. package/web/_app/immutable/chunks/qZTzdLCS.js +0 -1
  325. package/web/_app/immutable/chunks/xihTtKlq.js +0 -1
  326. package/web/_app/immutable/entry/app.CRj5xLq4.js +0 -2
  327. package/web/_app/immutable/entry/start.DFykc1ei.js +0 -1
  328. package/web/_app/immutable/nodes/0.DOQ4pqDO.js +0 -1
  329. package/web/_app/immutable/nodes/1.zT2AfUFP.js +0 -1
  330. package/web/_app/immutable/nodes/2.Bw3UfpV4.js +0 -128
  331. package/web/_app/immutable/nodes/3.CP6Fy3to.js +0 -1
  332. package/web/_app/version.json +0 -1
  333. package/web/callback.html +0 -50
  334. /package/web/_app/immutable/{assets/dm-sans-latin-400-normal.BwCSEQnW.woff → dm-sans-latin-400-normal-BwCSEQnW.woff} +0 -0
  335. /package/web/_app/immutable/{assets/dm-sans-latin-400-normal.CW0RaeGs.woff2 → dm-sans-latin-400-normal-CW0RaeGs.woff2} +0 -0
  336. /package/web/_app/immutable/{assets/dm-sans-latin-ext-400-normal.BjWJ59Pq.woff → dm-sans-latin-ext-400-normal-BjWJ59Pq.woff} +0 -0
  337. /package/web/_app/immutable/{assets/dm-sans-latin-ext-400-normal.BtiwyxMk.woff2 → dm-sans-latin-ext-400-normal-BtiwyxMk.woff2} +0 -0
  338. /package/web/_app/immutable/{assets/ibm-plex-mono-cyrillic-400-normal.BSMlKf0J.woff2 → ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2} +0 -0
  339. /package/web/_app/immutable/{assets/ibm-plex-mono-cyrillic-400-normal.CEL4l2ZJ.woff → ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff} +0 -0
  340. /package/web/_app/immutable/{assets/ibm-plex-mono-cyrillic-500-normal.Ael50iVv.woff → ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff} +0 -0
  341. /package/web/_app/immutable/{assets/ibm-plex-mono-cyrillic-500-normal.Bq9vWWag.woff2 → ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2} +0 -0
  342. /package/web/_app/immutable/{assets/ibm-plex-mono-cyrillic-ext-400-normal.DMdlQ8Kv.woff → ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff} +0 -0
  343. /package/web/_app/immutable/{assets/ibm-plex-mono-cyrillic-ext-400-normal.xuaO2J-f.woff2 → ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2} +0 -0
  344. /package/web/_app/immutable/{assets/ibm-plex-mono-cyrillic-ext-500-normal.BIfNGwUT.woff → ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff} +0 -0
  345. /package/web/_app/immutable/{assets/ibm-plex-mono-cyrillic-ext-500-normal.BqneJy0T.woff2 → ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2} +0 -0
  346. /package/web/_app/immutable/{assets/ibm-plex-mono-latin-400-normal.CvHOgSBP.woff → ibm-plex-mono-latin-400-normal-CvHOgSBP.woff} +0 -0
  347. /package/web/_app/immutable/{assets/ibm-plex-mono-latin-400-normal.DMJ8VG8y.woff2 → ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2} +0 -0
  348. /package/web/_app/immutable/{assets/ibm-plex-mono-latin-500-normal.CB9ihrfo.woff → ibm-plex-mono-latin-500-normal-CB9ihrfo.woff} +0 -0
  349. /package/web/_app/immutable/{assets/ibm-plex-mono-latin-500-normal.DSY6xOcd.woff2 → ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2} +0 -0
  350. /package/web/_app/immutable/{assets/ibm-plex-mono-latin-ext-400-normal.BmRBH3aV.woff2 → ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2} +0 -0
  351. /package/web/_app/immutable/{assets/ibm-plex-mono-latin-ext-400-normal.D3D2R8hC.woff → ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff} +0 -0
  352. /package/web/_app/immutable/{assets/ibm-plex-mono-latin-ext-500-normal.CAhNIIs5.woff2 → ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2} +0 -0
  353. /package/web/_app/immutable/{assets/ibm-plex-mono-latin-ext-500-normal.CZ70TYgx.woff → ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff} +0 -0
  354. /package/web/_app/immutable/{assets/ibm-plex-mono-vietnamese-400-normal.BulugwFq.woff2 → ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2} +0 -0
  355. /package/web/_app/immutable/{assets/ibm-plex-mono-vietnamese-400-normal.DDuiU_S-.woff → ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff} +0 -0
  356. /package/web/_app/immutable/{assets/ibm-plex-mono-vietnamese-500-normal.C8zxqsMH.woff → ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff} +0 -0
  357. /package/web/_app/immutable/{assets/ibm-plex-mono-vietnamese-500-normal.DZ4AoWbu.woff2 → ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2} +0 -0
  358. /package/web/_app/immutable/{assets/ibm-plex-sans-cyrillic-ext-wght-normal.d45eAU9y.woff2 → ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2} +0 -0
  359. /package/web/_app/immutable/{assets/ibm-plex-sans-cyrillic-wght-normal.BAAhND-U.woff2 → ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2} +0 -0
  360. /package/web/_app/immutable/{assets/ibm-plex-sans-greek-wght-normal.CmyJS8uq.woff2 → ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2} +0 -0
  361. /package/web/_app/immutable/{assets/ibm-plex-sans-latin-ext-wght-normal.CIII54If.woff2 → ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2} +0 -0
  362. /package/web/_app/immutable/{assets/ibm-plex-sans-latin-wght-normal.IvpUvPa2.woff2 → ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2} +0 -0
  363. /package/web/_app/immutable/{assets/ibm-plex-sans-vietnamese-wght-normal.Dg1JeJN0.woff2 → ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2} +0 -0
package/lib/update.js CHANGED
@@ -5,21 +5,33 @@ import os from 'node:os';
5
5
  import path from 'node:path';
6
6
 
7
7
  export const PACKAGE_NAME = '@spikonado/sprocket';
8
+
8
9
  export const UPDATE_API_FILENAME = 'update-api.js';
10
+
9
11
  export const DEFAULT_REGISTRY = 'https://registry.npmjs.org';
12
+
10
13
  export const RELAUNCH_MESSAGE =
11
14
  'Wait for active agents to finish, then stop Sprocket and launch it again.';
15
+
12
16
  export const UNSUPPORTED_MESSAGE =
13
17
  'This copy of Sprocket was not installed globally with npm, bun, pnpm, or yarn, so it cannot be updated in place.';
14
18
 
15
19
  const STABLE_VERSION = /^[0-9]+\.[0-9]+\.[0-9]+$/;
20
+
16
21
  const CANARY_VERSION = /^[0-9]+\.[0-9]+\.[0-9]+-canary\.[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*$/;
22
+
17
23
  const DEV_VERSION = /^[0-9]+\.[0-9]+\.[0-9]+-dev\.[0-9a-f]{40}$/;
24
+
18
25
  const NUMERIC_IDENTIFIER = /^[0-9]+$/;
26
+
19
27
  const QUERY_TIMEOUT_MS = 10_000;
28
+
20
29
  const INSTALL_TIMEOUT_MS = 5 * 60 * 1000;
30
+
21
31
  const FETCH_TIMEOUT_MS = 15_000;
32
+
22
33
  const KILL_WAIT_MS = 5_000;
34
+
23
35
  const OUTPUT_LIMIT = 1_000_000;
24
36
 
25
37
  export const PACKAGE_ROOT = path.resolve(import.meta.dirname, '..');
@@ -31,6 +43,7 @@ const MANAGERS = [
31
43
  installArgs: (version) => ['add', '--global', packageSpec(version)],
32
44
  globalRoot(queryStdout) {
33
45
  const binDir = firstAbsolutePath(queryStdout);
46
+
34
47
  return binDir ? path.resolve(binDir, '..', 'install', 'global', 'node_modules') : '';
35
48
  }
36
49
  },
@@ -48,6 +61,7 @@ const MANAGERS = [
48
61
  installArgs: (version) => ['global', 'add', packageSpec(version)],
49
62
  globalRoot(queryStdout) {
50
63
  const dir = firstAbsolutePath(queryStdout);
64
+
51
65
  return dir ? path.join(dir, 'node_modules') : '';
52
66
  }
53
67
  },
@@ -69,56 +83,70 @@ export function asText(value) {
69
83
  if (value == null) {
70
84
  return '';
71
85
  }
86
+
72
87
  return `${value}`;
73
88
  }
74
89
 
75
90
  export function parseVersionField(value) {
76
91
  const text = asText(value).trim();
92
+
77
93
  if (!text || text.length > 128) {
78
94
  return '';
79
95
  }
96
+
80
97
  return text;
81
98
  }
82
99
 
83
100
  export function releaseChannel(version) {
84
101
  const text = asText(version);
102
+
85
103
  if (text.includes('-canary.')) {
86
104
  return 'canary';
87
105
  }
106
+
88
107
  if (text.includes('-dev.')) {
89
108
  return 'dev';
90
109
  }
110
+
91
111
  return 'latest';
92
112
  }
93
113
 
94
114
  export function isAllowedVersion(version, channel) {
95
115
  const text = parseVersionField(version);
116
+
96
117
  if (!text) {
97
118
  return false;
98
119
  }
120
+
99
121
  if (channel === 'canary') {
100
122
  return CANARY_VERSION.test(text);
101
123
  }
124
+
102
125
  if (channel === 'dev') {
103
126
  return DEV_VERSION.test(text);
104
127
  }
128
+
105
129
  return STABLE_VERSION.test(text);
106
130
  }
107
131
 
108
132
  export function compareReleaseVersions(left, right) {
109
133
  const parsedLeft = parseComparable(left);
110
134
  const parsedRight = parseComparable(right);
135
+
111
136
  if (!parsedLeft || !parsedRight) {
112
137
  return null;
113
138
  }
139
+
114
140
  for (let index = 0; index < 3; index += 1) {
115
141
  if (parsedLeft.core[index] < parsedRight.core[index]) {
116
142
  return -1;
117
143
  }
144
+
118
145
  if (parsedLeft.core[index] > parsedRight.core[index]) {
119
146
  return 1;
120
147
  }
121
148
  }
149
+
122
150
  return comparePrerelease(parsedLeft.pre, parsedRight.pre);
123
151
  }
124
152
 
@@ -126,16 +154,21 @@ export function channelUpdate(currentVersion, registryVersion) {
126
154
  if (currentVersion === registryVersion) {
127
155
  return { status: 'idle' };
128
156
  }
157
+
129
158
  if (releaseChannel(currentVersion) === 'dev') {
130
159
  return { status: 'available', version: registryVersion };
131
160
  }
161
+
132
162
  const comparison = compareReleaseVersions(registryVersion, currentVersion);
163
+
133
164
  if (comparison == null) {
134
165
  throw new Error('Could not compare the installed version with the registry version.');
135
166
  }
167
+
136
168
  if (comparison <= 0) {
137
169
  return { status: 'idle' };
138
170
  }
171
+
139
172
  return { status: 'available', version: registryVersion };
140
173
  }
141
174
 
@@ -152,20 +185,26 @@ export function makePayload(fields) {
152
185
 
153
186
  export function parseUpdateArgs(args) {
154
187
  const command = args[0];
188
+
155
189
  if (command !== 'update' && command !== 'upgrade') {
156
190
  return { kind: 'none' };
157
191
  }
192
+
158
193
  let check = false;
194
+
159
195
  for (const arg of args.slice(1)) {
160
196
  if (arg === '--help' || arg === '-h') {
161
197
  return { kind: 'native' };
162
198
  }
199
+
163
200
  if (arg === '--check') {
164
201
  check = true;
165
202
  continue;
166
203
  }
204
+
167
205
  return { kind: 'invalid', error: `Unknown option '${arg}'.` };
168
206
  }
207
+
169
208
  return { kind: 'run', check };
170
209
  }
171
210
 
@@ -179,8 +218,10 @@ export function isManagedUpdate(env = {}) {
179
218
 
180
219
  export function taskkillPath(env = {}) {
181
220
  const root = asText(env.SystemRoot || env.SYSTEMROOT);
221
+
182
222
  if (!path.win32.isAbsolute(root))
183
223
  throw new Error('SystemRoot is unavailable; cannot stop the update process tree.');
224
+
184
225
  return path.win32.join(root, 'System32', 'taskkill.exe');
185
226
  }
186
227
 
@@ -192,6 +233,7 @@ export function updateLockPath(host, globalRoot) {
192
233
  const resolved = path.resolve(globalPackageDir(globalRoot));
193
234
  const identity = host.platform === 'win32' ? resolved.toLowerCase() : resolved;
194
235
  const id = createHash('sha256').update(identity).digest('hex').slice(0, 16);
236
+
195
237
  return path.join(host.tmpdir(), `sprocket-update-${id}.lock`);
196
238
  }
197
239
 
@@ -199,33 +241,42 @@ export function waitForClose(child, deadlineMs) {
199
241
  return new Promise((resolve, reject) => {
200
242
  if (child.exitCode != null || child.signalCode != null) {
201
243
  resolve();
244
+
202
245
  return;
203
246
  }
247
+
204
248
  const finish = () => {
205
249
  clearTimeout(timer);
206
250
  child.off?.('error', fail);
207
251
  resolve();
208
252
  };
253
+
209
254
  const fail = (error) => {
210
255
  clearTimeout(timer);
211
256
  child.off?.('close', finish);
212
257
  reject(error);
213
258
  };
259
+
214
260
  const timer = setTimeout(() => {
215
261
  child.off?.('close', finish);
216
262
  child.off?.('error', fail);
217
263
  reject(new Error('process did not exit'));
218
264
  }, deadlineMs);
265
+
219
266
  if (child.once) {
220
267
  child.once('close', finish);
221
268
  child.once('error', fail);
269
+
222
270
  return;
223
271
  }
272
+
224
273
  if (child.on) {
225
274
  child.on('close', finish);
226
275
  child.on('error', fail);
276
+
227
277
  return;
228
278
  }
279
+
229
280
  clearTimeout(timer);
230
281
  resolve();
231
282
  });
@@ -233,12 +284,16 @@ export function waitForClose(child, deadlineMs) {
233
284
 
234
285
  export async function killProcessTree(child, platform = process.platform, extras = {}) {
235
286
  const pid = child?.pid;
287
+
236
288
  if (pid == null || pid <= 0) {
237
289
  return;
238
290
  }
291
+
239
292
  const deadlineMs = extras.deadlineMs ?? KILL_WAIT_MS;
293
+
240
294
  if (platform === 'win32') {
241
295
  const spawnImpl = extras.spawn ?? spawn;
296
+
242
297
  const killer = spawnImpl(
243
298
  extras.taskkillPath ?? taskkillPath(extras.env),
244
299
  ['/PID', String(pid), '/T', '/F'],
@@ -250,10 +305,14 @@ export async function killProcessTree(child, platform = process.platform, extras
250
305
  killSignal: 'SIGKILL'
251
306
  }
252
307
  );
308
+
253
309
  await Promise.all([waitForClose(killer, deadlineMs), waitForClose(child, deadlineMs)]);
310
+
254
311
  if (killer.exitCode !== 0) throw new Error('taskkill could not stop the update process tree.');
312
+
255
313
  return;
256
314
  }
315
+
257
316
  try {
258
317
  process.kill(-pid, 'SIGKILL');
259
318
  } catch {
@@ -271,6 +330,7 @@ export async function killProcessTree(child, platform = process.platform, extras
271
330
 
272
331
  export function createRunCommand(spawnImpl, treeKiller = killProcessTree, selfKill) {
273
332
  const killHelperGroup = selfKill ?? ((groupPid) => process.kill(groupPid, 'SIGKILL'));
333
+
274
334
  return function runCommand(command, args, options = {}) {
275
335
  return new Promise((resolve) => {
276
336
  let settled = false;
@@ -281,16 +341,19 @@ export function createRunCommand(spawnImpl, treeKiller = killProcessTree, selfKi
281
341
  const platform = options.platform ?? process.platform;
282
342
  const managed = isManagedUpdate(options.env);
283
343
  const killWaitMs = options.killWaitMs ?? KILL_WAIT_MS;
344
+
284
345
  const done = (result) => {
285
346
  if (settled) {
286
347
  return;
287
348
  }
349
+
288
350
  settled = true;
289
351
  clearTimeout(timer);
290
352
  resolve(result);
291
353
  };
292
354
 
293
355
  let child;
356
+
294
357
  try {
295
358
  child = spawnImpl(command, args, {
296
359
  cwd: options.cwd,
@@ -308,6 +371,7 @@ export function createRunCommand(spawnImpl, treeKiller = killProcessTree, selfKi
308
371
  error,
309
372
  timedOut: false
310
373
  });
374
+
311
375
  return;
312
376
  }
313
377
 
@@ -343,13 +407,16 @@ export function createRunCommand(spawnImpl, treeKiller = killProcessTree, selfKi
343
407
  if (settled) {
344
408
  return;
345
409
  }
410
+
346
411
  timingOut = true;
412
+
347
413
  if (managed && platform !== 'win32') {
348
414
  try {
349
415
  killHelperGroup(-process.pid);
350
416
  } catch {
351
417
  // Tests inject a no-op killer; production SIGKILL does not return.
352
418
  }
419
+
353
420
  done({
354
421
  status: 1,
355
422
  stdout,
@@ -357,9 +424,12 @@ export function createRunCommand(spawnImpl, treeKiller = killProcessTree, selfKi
357
424
  timedOut: true,
358
425
  uncertain: true
359
426
  });
427
+
360
428
  return;
361
429
  }
430
+
362
431
  let uncertain = false;
432
+
363
433
  try {
364
434
  await treeKiller(child, platform, {
365
435
  spawn: spawnImpl,
@@ -369,13 +439,16 @@ export function createRunCommand(spawnImpl, treeKiller = killProcessTree, selfKi
369
439
  } catch {
370
440
  uncertain = true;
371
441
  }
442
+
372
443
  child.stdout?.destroy();
373
444
  child.stderr?.destroy();
445
+
374
446
  try {
375
447
  await waitForClose(child, killWaitMs);
376
448
  } catch {
377
449
  uncertain = true;
378
450
  }
451
+
379
452
  done({
380
453
  status: 1,
381
454
  stdout,
@@ -395,6 +468,7 @@ export function createHost(overrides = {}) {
395
468
  const packageRoot = overrides.packageRoot ?? PACKAGE_ROOT;
396
469
  const readFile = overrides.readFile ?? ((file, encoding) => readFileSync(file, encoding));
397
470
  const isFile = overrides.isFile ?? defaultIsFile;
471
+
398
472
  const host = {
399
473
  env,
400
474
  platform,
@@ -416,19 +490,24 @@ export function createHost(overrides = {}) {
416
490
  writeStdout: overrides.writeStdout ?? ((text) => process.stdout.write(text)),
417
491
  writeStderr: overrides.writeStderr ?? ((text) => process.stderr.write(text))
418
492
  };
493
+
419
494
  if (host.currentVersion === undefined) {
420
495
  host.currentVersion = readCurrentVersion(host);
421
496
  }
497
+
422
498
  return host;
423
499
  }
424
500
 
425
501
  export function readCurrentVersion(host) {
426
502
  const configured = parseVersionField(host.currentVersion);
503
+
427
504
  if (configured) {
428
505
  return configured;
429
506
  }
507
+
430
508
  try {
431
509
  const manifest = JSON.parse(host.readFile(path.join(host.packageRoot, 'package.json'), 'utf8'));
510
+
432
511
  return parseVersionField(manifest?.version);
433
512
  } catch {
434
513
  return '';
@@ -437,15 +516,20 @@ export function readCurrentVersion(host) {
437
516
 
438
517
  export async function detectInstall(host) {
439
518
  const packageRoot = path.resolve(host.packageRoot);
519
+
440
520
  for (const manager of MANAGERS) {
441
521
  const invocation = resolveManagerInvocation(manager.name, host);
522
+
442
523
  if (!invocation) {
443
524
  continue;
444
525
  }
526
+
445
527
  const globalRoot = await queryGlobalRoot(manager, invocation, host);
528
+
446
529
  if (!globalRoot) {
447
530
  continue;
448
531
  }
532
+
449
533
  if (isExactGlobalPackage(packageRoot, globalRoot, host)) {
450
534
  return {
451
535
  supported: true,
@@ -457,12 +541,14 @@ export async function detectInstall(host) {
457
541
  };
458
542
  }
459
543
  }
544
+
460
545
  return { supported: false };
461
546
  }
462
547
 
463
548
  export async function checkForUpdate(host) {
464
549
  const currentVersion = readCurrentVersion(host);
465
550
  const install = await detectInstall(host);
551
+
466
552
  if (!install.supported) {
467
553
  return makePayload({
468
554
  status: 'unavailable',
@@ -470,12 +556,15 @@ export async function checkForUpdate(host) {
470
556
  message: UNSUPPORTED_MESSAGE
471
557
  });
472
558
  }
559
+
473
560
  const channel = releaseChannel(currentVersion);
474
561
  const registryVersion = await fetchChannelVersion(host, channel, currentVersion);
475
562
  const decision = channelUpdate(currentVersion, registryVersion);
563
+
476
564
  if (decision.status === 'idle') {
477
565
  return makePayload({ status: 'idle', currentVersion });
478
566
  }
567
+
479
568
  return makePayload({
480
569
  status: 'available',
481
570
  currentVersion,
@@ -486,6 +575,7 @@ export async function checkForUpdate(host) {
486
575
  export async function installUpdate(host) {
487
576
  const currentVersion = readCurrentVersion(host);
488
577
  const detected = await detectInstall(host);
578
+
489
579
  if (!detected.supported) {
490
580
  return makePayload({
491
581
  status: 'unavailable',
@@ -493,14 +583,19 @@ export async function installUpdate(host) {
493
583
  message: UNSUPPORTED_MESSAGE
494
584
  });
495
585
  }
586
+
496
587
  const lockPath = updateLockPath(host, detected.globalRoot);
588
+
497
589
  try {
498
590
  return await withUpdateLock(host, lockPath, async () => {
499
591
  const checked = await checkForUpdate(host);
592
+
500
593
  if (checked.status !== 'available') {
501
594
  return { payload: checked };
502
595
  }
596
+
503
597
  const install = await detectInstall(host);
598
+
504
599
  if (!install.supported) {
505
600
  return {
506
601
  payload: makePayload({
@@ -510,6 +605,7 @@ export async function installUpdate(host) {
510
605
  })
511
606
  };
512
607
  }
608
+
513
609
  if (!isAllowedVersion(checked.version, releaseChannel(currentVersion))) {
514
610
  return {
515
611
  payload: makePayload({
@@ -520,9 +616,11 @@ export async function installUpdate(host) {
520
616
  })
521
617
  };
522
618
  }
619
+
523
620
  if (updateLockPath(host, install.globalRoot) !== lockPath) {
524
621
  throw new Error('The installation location changed during the update check. Try again.');
525
622
  }
623
+
526
624
  const result = await host.runCommand(
527
625
  install.command,
528
626
  [...install.argsPrefix, ...install.installArgs(checked.version)],
@@ -533,6 +631,7 @@ export async function installUpdate(host) {
533
631
  timeout: INSTALL_TIMEOUT_MS
534
632
  }
535
633
  );
634
+
536
635
  if (result.timedOut || result.uncertain) {
537
636
  return {
538
637
  retainLock: true,
@@ -544,6 +643,7 @@ export async function installUpdate(host) {
544
643
  })
545
644
  };
546
645
  }
646
+
547
647
  if ((result.status ?? 1) !== 0) {
548
648
  return {
549
649
  payload: makePayload({
@@ -557,6 +657,7 @@ export async function installUpdate(host) {
557
657
  })
558
658
  };
559
659
  }
660
+
560
661
  return {
561
662
  payload: makePayload({
562
663
  status: 'installed',
@@ -577,6 +678,7 @@ export async function installUpdate(host) {
577
678
 
578
679
  export async function runUpdateApi(command, host = createHost()) {
579
680
  const currentVersion = readCurrentVersion(host);
681
+
580
682
  try {
581
683
  if (command !== 'check' && command !== 'install') {
582
684
  return {
@@ -588,7 +690,9 @@ export async function runUpdateApi(command, host = createHost()) {
588
690
  })
589
691
  };
590
692
  }
693
+
591
694
  const payload = command === 'check' ? await checkForUpdate(host) : await installUpdate(host);
695
+
592
696
  return {
593
697
  exitCode: payload.status === 'error' ? 1 : 0,
594
698
  payload
@@ -608,48 +712,63 @@ export async function runUpdateApi(command, host = createHost()) {
608
712
  export async function runUpdateCli(parsed, host = createHost()) {
609
713
  if (parsed.kind === 'invalid') {
610
714
  host.writeStderr(`sprocket: ${parsed.error}\nTry \`sprocket update --help\`.\n`);
715
+
611
716
  return 1;
612
717
  }
718
+
613
719
  try {
614
720
  const payload = parsed.check ? await checkForUpdate(host) : await installUpdate(host);
721
+
615
722
  if (payload.status === 'error') {
616
723
  host.writeStderr(`sprocket: ${payload.error}\n`);
724
+
617
725
  return 1;
618
726
  }
727
+
619
728
  host.writeStdout(formatCli(payload, parsed.check));
729
+
620
730
  return payload.status === 'unavailable' ? 1 : 0;
621
731
  } catch (error) {
622
732
  host.writeStderr(`sprocket: ${publicError(error)}\n`);
733
+
623
734
  return 1;
624
735
  }
625
736
  }
626
737
 
627
738
  export function registryUrl(env = {}) {
628
- const values = [env.npm_config_registry, env.NPM_CONFIG_REGISTRY]
629
- .map((value) => asText(value).trim())
630
- .filter(Boolean);
739
+ const values = [env.npm_config_registry, env.NPM_CONFIG_REGISTRY].flatMap((value) => {
740
+ const text = asText(value).trim();
741
+
742
+ return text ? [text] : [];
743
+ });
744
+
631
745
  for (const value of values) {
632
746
  let url;
747
+
633
748
  try {
634
749
  url = new URL(value);
635
750
  } catch {
636
751
  throw new Error('Package updates require a valid HTTPS npm registry URL.');
637
752
  }
753
+
638
754
  if (url.protocol !== 'https:' || /\s/.test(value) || url.search || url.hash) {
639
755
  throw new Error('Package updates require a valid HTTPS npm registry URL.');
640
756
  }
641
757
  }
758
+
642
759
  return values[0]?.replace(/\/$/, '') ?? DEFAULT_REGISTRY;
643
760
  }
644
761
 
645
762
  export function channelManifestUrl(registry, channel, name = PACKAGE_NAME) {
646
763
  const base = registry.replace(/\/$/, '');
647
764
  const encodedName = encodeURIComponent(name);
765
+
648
766
  return `${base}/${encodedName}/${encodeURIComponent(channel)}`;
649
767
  }
650
768
 
651
769
  export async function withUpdateLock(host, lockPath, operation) {
652
770
  let handle;
771
+
653
772
  try {
654
773
  handle = await host.open(lockPath, 'wx');
655
774
  } catch (error) {
@@ -658,19 +777,25 @@ export async function withUpdateLock(host, lockPath, operation) {
658
777
  `Another Sprocket update is already running. If it is not, delete ${lockPath} and retry.`
659
778
  );
660
779
  }
780
+
661
781
  if (error?.code === 'EACCES' || error?.code === 'EPERM') {
662
782
  throw new Error(`Cannot write the update lock at ${lockPath}. Check permissions and retry.`);
663
783
  }
784
+
664
785
  throw error;
665
786
  }
787
+
666
788
  let retainLock = false;
789
+
667
790
  try {
668
791
  await handle.writeFile(String(host.pid));
669
792
  const outcome = await operation();
670
793
  retainLock = outcome?.retainLock === true;
794
+
671
795
  return outcome?.payload ?? outcome;
672
796
  } finally {
673
797
  await handle.close().catch(() => {});
798
+
674
799
  if (!retainLock) {
675
800
  await host.unlink(lockPath).catch(() => {});
676
801
  }
@@ -681,27 +806,34 @@ function formatCli(payload, check) {
681
806
  if (payload.status === 'unavailable') {
682
807
  return `${payload.message ?? UNSUPPORTED_MESSAGE}\n`;
683
808
  }
809
+
684
810
  if (payload.status === 'idle') {
685
811
  return `Sprocket ${payload.currentVersion} is up to date (${releaseChannel(payload.currentVersion)} channel).\n`;
686
812
  }
813
+
687
814
  if (payload.status === 'available') {
688
815
  const lines = [
689
816
  `Sprocket ${payload.version} is available (currently ${payload.currentVersion}).`
690
817
  ];
818
+
691
819
  if (check) {
692
820
  lines.push('Run `sprocket update` to install it.');
693
821
  }
822
+
694
823
  return `${lines.join('\n')}\n`;
695
824
  }
825
+
696
826
  if (payload.status === 'installed') {
697
827
  return `Updated Sprocket to ${payload.version}.\n${payload.message ?? RELAUNCH_MESSAGE}\n`;
698
828
  }
829
+
699
830
  return '';
700
831
  }
701
832
 
702
833
  async function fetchChannelVersion(host, channel, currentVersion) {
703
834
  const url = channelManifestUrl(registryUrl(host.env), channel);
704
835
  let response;
836
+
705
837
  try {
706
838
  response = await host.fetch(url, {
707
839
  redirect: 'error',
@@ -714,56 +846,71 @@ async function fetchChannelVersion(host, channel, currentVersion) {
714
846
  } catch {
715
847
  throw new Error('Could not reach the npm registry. Try again.');
716
848
  }
849
+
717
850
  if (!response.ok) {
718
851
  throw new Error(`npm registry returned HTTP ${response.status}.`);
719
852
  }
853
+
720
854
  let body;
855
+
721
856
  try {
722
857
  body = await response.json();
723
858
  } catch {
724
859
  throw new Error('npm registry returned an invalid package document.');
725
860
  }
861
+
726
862
  const version = parseVersionField(body?.version);
863
+
727
864
  if (!isAllowedVersion(version, channel)) {
728
865
  throw new Error(`npm dist-tag '${channel}' does not point at a valid ${channel} release.`);
729
866
  }
867
+
730
868
  return version;
731
869
  }
732
870
 
733
871
  function isExactGlobalPackage(packageRoot, globalRoot, host) {
734
872
  const expected = globalPackageDir(globalRoot);
735
873
  const actual = pathIdentities(host, packageRoot);
874
+
736
875
  for (const candidate of pathIdentities(host, expected)) {
737
876
  if (actual.has(candidate)) {
738
877
  return true;
739
878
  }
740
879
  }
880
+
741
881
  return false;
742
882
  }
743
883
 
744
884
  function pathIdentities(host, file) {
745
885
  const identities = new Set([normalizePath(file, host.platform)]);
746
886
  identities.add(normalizePath(tryRealpath(host, file), host.platform));
887
+
747
888
  return identities;
748
889
  }
749
890
 
750
891
  function normalizePath(file, platform) {
751
892
  const resolved = path.resolve(file);
893
+
752
894
  return platform === 'win32' ? resolved.toLowerCase() : resolved;
753
895
  }
754
896
 
755
897
  function resolveManagerInvocation(manager, host) {
756
898
  const execDir = path.dirname(host.execPath);
757
899
  const execBase = path.basename(host.execPath, '.exe').toLowerCase();
900
+
758
901
  if (manager === 'bun' && execBase === 'bun') {
759
902
  return { command: host.execPath, argsPrefix: [] };
760
903
  }
904
+
761
905
  if (manager === 'npm') {
762
906
  const npmCli = path.join(execDir, 'node_modules', 'npm', 'bin', 'npm-cli.js');
907
+
763
908
  if (host.isFile(npmCli)) {
764
909
  return { command: host.execPath, argsPrefix: [npmCli] };
765
910
  }
911
+
766
912
  const npmExecPath = asText(host.env.npm_execpath);
913
+
767
914
  if (
768
915
  npmExecPath &&
769
916
  isAbsolutePath(npmExecPath, host.platform) &&
@@ -773,10 +920,13 @@ function resolveManagerInvocation(manager, host) {
773
920
  return { command: host.execPath, argsPrefix: [npmExecPath] };
774
921
  }
775
922
  }
923
+
776
924
  const found = host.findExecutable(manager);
925
+
777
926
  if (!found) {
778
927
  return null;
779
928
  }
929
+
780
930
  return spawnPlan(found, manager, host);
781
931
  }
782
932
 
@@ -784,18 +934,23 @@ function spawnPlan(binary, manager, host) {
784
934
  if (/\.(cjs|js|mjs)$/i.test(binary)) {
785
935
  return { command: host.execPath, argsPrefix: [binary] };
786
936
  }
937
+
787
938
  if (host.platform === 'win32' && /\.(cmd|bat)$/i.test(binary)) {
788
939
  const jsCli = jsCliBesideShim(binary, manager, host);
940
+
789
941
  if (jsCli) {
790
942
  return { command: host.execPath, argsPrefix: [jsCli] };
791
943
  }
944
+
792
945
  return null;
793
946
  }
947
+
794
948
  return { command: binary, argsPrefix: [] };
795
949
  }
796
950
 
797
951
  function jsCliBesideShim(binary, manager, host) {
798
952
  const dir = path.dirname(binary);
953
+
799
954
  const candidates =
800
955
  manager === 'npm'
801
956
  ? [path.join(dir, 'node_modules', 'npm', 'bin', 'npm-cli.js'), path.join(dir, 'npm-cli.js')]
@@ -804,6 +959,7 @@ function jsCliBesideShim(binary, manager, host) {
804
959
  : manager === 'yarn'
805
960
  ? [path.join(dir, 'yarn.js'), path.join(dir, 'node_modules', 'yarn', 'bin', 'yarn.js')]
806
961
  : [];
962
+
807
963
  return candidates.find((candidate) => host.isFile(candidate));
808
964
  }
809
965
 
@@ -822,28 +978,37 @@ async function queryGlobalRoot(manager, invocation, host) {
822
978
  timeout: QUERY_TIMEOUT_MS
823
979
  }
824
980
  );
981
+
825
982
  if ((result.status ?? 1) !== 0) {
826
983
  return '';
827
984
  }
985
+
828
986
  const globalRoot = manager.globalRoot(result.stdout ?? '');
987
+
829
988
  if (!globalRoot || globalRoot.includes('\0')) {
830
989
  return '';
831
990
  }
991
+
832
992
  return path.resolve(globalRoot);
833
993
  }
834
994
 
835
995
  function parseComparable(version) {
836
996
  const text = asText(version);
997
+
837
998
  if (STABLE_VERSION.test(text)) {
838
999
  const [major, minor, patch] = text.split('.');
1000
+
839
1001
  return { core: [Number(major), Number(minor), Number(patch)], pre: [] };
840
1002
  }
1003
+
841
1004
  if (!CANARY_VERSION.test(text)) {
842
1005
  return null;
843
1006
  }
1007
+
844
1008
  const marker = '-canary.';
845
1009
  const index = text.indexOf(marker);
846
1010
  const [major, minor, patch] = text.slice(0, index).split('.');
1011
+
847
1012
  return {
848
1013
  core: [Number(major), Number(minor), Number(patch)],
849
1014
  pre: ['canary', ...text.slice(index + marker.length).split('.')]
@@ -854,53 +1019,70 @@ function comparePrerelease(left, right) {
854
1019
  if (left.length === 0 && right.length === 0) {
855
1020
  return 0;
856
1021
  }
1022
+
857
1023
  if (left.length === 0) {
858
1024
  return 1;
859
1025
  }
1026
+
860
1027
  if (right.length === 0) {
861
1028
  return -1;
862
1029
  }
1030
+
863
1031
  const length = Math.max(left.length, right.length);
1032
+
864
1033
  for (let index = 0; index < length; index += 1) {
865
1034
  if (index >= left.length) {
866
1035
  return -1;
867
1036
  }
1037
+
868
1038
  if (index >= right.length) {
869
1039
  return 1;
870
1040
  }
1041
+
871
1042
  const comparison = compareIdentifier(left[index], right[index]);
1043
+
872
1044
  if (comparison !== 0) {
873
1045
  return comparison;
874
1046
  }
875
1047
  }
1048
+
876
1049
  return 0;
877
1050
  }
878
1051
 
879
1052
  function compareIdentifier(left, right) {
880
1053
  const leftNumeric = NUMERIC_IDENTIFIER.test(left);
881
1054
  const rightNumeric = NUMERIC_IDENTIFIER.test(right);
1055
+
882
1056
  if (leftNumeric && rightNumeric) {
883
1057
  const delta = Number(left) - Number(right);
1058
+
884
1059
  if (delta < 0) {
885
1060
  return -1;
886
1061
  }
1062
+
887
1063
  if (delta > 0) {
888
1064
  return 1;
889
1065
  }
1066
+
890
1067
  return 0;
891
1068
  }
1069
+
892
1070
  if (leftNumeric) {
893
1071
  return -1;
894
1072
  }
1073
+
895
1074
  if (rightNumeric) {
896
1075
  return 1;
897
1076
  }
1077
+
898
1078
  if (left < right) {
899
1079
  return -1;
900
1080
  }
1081
+
901
1082
  if (left > right) {
902
1083
  return 1;
903
1084
  }
1085
+
904
1086
  return 0;
905
1087
  }
906
1088
 
@@ -908,14 +1090,18 @@ function installFailureMessage(output, platform) {
908
1090
  if (isWindowsBusyExecutable(output, platform)) {
909
1091
  return 'Windows cannot replace Sprocket while it is running. Stop Sprocket, then run `sprocket update` again.';
910
1092
  }
1093
+
911
1094
  const lines = output
912
1095
  .split(/\r?\n/)
913
1096
  .map((line) => line.trim())
914
1097
  .filter(Boolean);
1098
+
915
1099
  const useful = lines
916
1100
  .filter((line) => /npm ERR!|error|ERR!|EACCES|EPERM|EBUSY|denied|ELIFECYCLE/i.test(line))
917
1101
  .slice(-5);
1102
+
918
1103
  const detail = useful.join(' ') || 'the package manager failed';
1104
+
919
1105
  return `Failed to install the update: ${sanitize(detail)}`;
920
1106
  }
921
1107
 
@@ -923,6 +1109,7 @@ export function isWindowsBusyExecutable(output, platform) {
923
1109
  if (platform !== 'win32') {
924
1110
  return false;
925
1111
  }
1112
+
926
1113
  return (
927
1114
  /sprocket\.exe/i.test(output) &&
928
1115
  /(?:EBUSY|EPERM|EACCES|being used by another process|resource busy|locked)/i.test(output)
@@ -933,6 +1120,7 @@ function publicError(error) {
933
1120
  if (error instanceof Error) {
934
1121
  return sanitize(error.message);
935
1122
  }
1123
+
936
1124
  return sanitize(asText(error));
937
1125
  }
938
1126
 
@@ -944,40 +1132,51 @@ function isAbsolutePath(file, platform) {
944
1132
  if (platform === 'win32') {
945
1133
  return path.win32.isAbsolute(file) || /^[a-zA-Z]:[\\/]/.test(file) || file.startsWith('\\\\');
946
1134
  }
1135
+
947
1136
  return path.isAbsolute(file);
948
1137
  }
949
1138
 
950
1139
  function findExecutable(name, env, platform, isFile) {
951
1140
  const pathValue = asText(env.PATH || env.Path || env.path);
952
1141
  const directories = pathValue.split(path.delimiter);
1142
+
953
1143
  const extensions =
954
1144
  platform === 'win32'
955
1145
  ? asText(env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
956
1146
  .split(';')
957
1147
  .filter(Boolean)
958
1148
  : [''];
1149
+
959
1150
  for (const directory of directories) {
960
1151
  if (!directory || !isAbsolutePath(directory, platform)) {
961
1152
  continue;
962
1153
  }
1154
+
963
1155
  if (platform === 'win32') {
964
1156
  const exact = path.join(directory, name);
1157
+
965
1158
  if (isFile(exact)) {
966
1159
  return exact;
967
1160
  }
1161
+
968
1162
  for (const extension of extensions) {
969
1163
  const candidate = path.join(directory, name + extension);
1164
+
970
1165
  if (isFile(candidate)) {
971
1166
  return candidate;
972
1167
  }
973
1168
  }
1169
+
974
1170
  continue;
975
1171
  }
1172
+
976
1173
  const candidate = path.join(directory, name);
1174
+
977
1175
  if (isFile(candidate)) {
978
1176
  return candidate;
979
1177
  }
980
1178
  }
1179
+
981
1180
  return undefined;
982
1181
  }
983
1182
 
@@ -1004,17 +1203,21 @@ function tryRealpath(host, file) {
1004
1203
  function firstAbsolutePath(text) {
1005
1204
  for (const line of asText(text).split(/\r?\n/)) {
1006
1205
  const trimmed = line.trim();
1206
+
1007
1207
  if (!trimmed || trimmed.includes('\0')) {
1008
1208
  continue;
1009
1209
  }
1210
+
1010
1211
  if (path.isAbsolute(trimmed) || /^[a-zA-Z]:[\\/]/.test(trimmed) || trimmed.startsWith('\\\\')) {
1011
1212
  return trimmed;
1012
1213
  }
1013
1214
  }
1215
+
1014
1216
  return '';
1015
1217
  }
1016
1218
 
1017
1219
  function appendBounded(previous, chunk) {
1018
1220
  const next = previous + chunk;
1221
+
1019
1222
  return next.length > OUTPUT_LIMIT ? next.slice(next.length - OUTPUT_LIMIT) : next;
1020
1223
  }