@socketsecurity/lib 0.0.0 → 1.0.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 (555) hide show
  1. package/CHANGELOG.md +276 -0
  2. package/LICENSE +21 -0
  3. package/README.md +80 -2
  4. package/data/extensions.json +28 -0
  5. package/dist/abort.d.ts +11 -0
  6. package/dist/abort.js +62 -0
  7. package/dist/abort.js.map +7 -0
  8. package/dist/agent.d.ts +102 -0
  9. package/dist/agent.js +288 -0
  10. package/dist/agent.js.map +7 -0
  11. package/dist/ansi.d.ts +29 -0
  12. package/dist/ansi.js +62 -0
  13. package/dist/ansi.js.map +7 -0
  14. package/dist/argv/flags.d.ts +199 -0
  15. package/dist/argv/flags.js +284 -0
  16. package/dist/argv/flags.js.map +7 -0
  17. package/dist/argv/parse.d.ts +76 -0
  18. package/dist/argv/parse.js +173 -0
  19. package/dist/argv/parse.js.map +7 -0
  20. package/dist/arrays.d.ts +29 -0
  21. package/dist/arrays.js +87 -0
  22. package/dist/arrays.js.map +7 -0
  23. package/dist/bin.d.ts +50 -0
  24. package/dist/bin.js +405 -0
  25. package/dist/bin.js.map +7 -0
  26. package/dist/cacache.d.ts +86 -0
  27. package/dist/cacache.js +140 -0
  28. package/dist/cacache.js.map +7 -0
  29. package/dist/cache-with-ttl.d.ts +133 -0
  30. package/dist/cache-with-ttl.js +225 -0
  31. package/dist/cache-with-ttl.js.map +7 -0
  32. package/dist/constants/agents.d.ts +37 -0
  33. package/dist/constants/agents.js +128 -0
  34. package/dist/constants/agents.js.map +7 -0
  35. package/dist/constants/core.d.ts +22 -0
  36. package/dist/constants/core.js +59 -0
  37. package/dist/constants/core.js.map +7 -0
  38. package/dist/constants/encoding.d.ts +13 -0
  39. package/dist/constants/encoding.js +50 -0
  40. package/dist/constants/encoding.js.map +7 -0
  41. package/dist/constants/github.d.ts +7 -0
  42. package/dist/constants/github.js +32 -0
  43. package/dist/constants/github.js.map +7 -0
  44. package/dist/constants/licenses.d.ts +8 -0
  45. package/dist/constants/licenses.js +68 -0
  46. package/dist/constants/licenses.js.map +7 -0
  47. package/dist/constants/node.d.ts +29 -0
  48. package/dist/constants/node.js +173 -0
  49. package/dist/constants/node.js.map +7 -0
  50. package/dist/constants/packages.d.ts +19 -0
  51. package/dist/constants/packages.js +130 -0
  52. package/dist/constants/packages.js.map +7 -0
  53. package/dist/constants/paths.d.ts +51 -0
  54. package/dist/constants/paths.js +152 -0
  55. package/dist/constants/paths.js.map +7 -0
  56. package/dist/constants/platform.d.ts +6 -0
  57. package/dist/constants/platform.js +43 -0
  58. package/dist/constants/platform.js.map +7 -0
  59. package/dist/constants/process.d.ts +7 -0
  60. package/dist/constants/process.js +54 -0
  61. package/dist/constants/process.js.map +7 -0
  62. package/dist/constants/socket.d.ts +29 -0
  63. package/dist/constants/socket.js +83 -0
  64. package/dist/constants/socket.js.map +7 -0
  65. package/dist/constants/testing.d.ts +9 -0
  66. package/dist/constants/testing.js +38 -0
  67. package/dist/constants/testing.js.map +7 -0
  68. package/dist/constants/time.d.ts +11 -0
  69. package/dist/constants/time.js +41 -0
  70. package/dist/constants/time.js.map +7 -0
  71. package/dist/constants/typescript.d.ts +6 -0
  72. package/dist/constants/typescript.js +56 -0
  73. package/dist/constants/typescript.js.map +7 -0
  74. package/dist/cover/code.d.ts +8 -0
  75. package/dist/cover/code.js +137 -0
  76. package/dist/cover/code.js.map +7 -0
  77. package/dist/cover/formatters.d.ts +9 -0
  78. package/dist/cover/formatters.js +103 -0
  79. package/dist/cover/formatters.js.map +7 -0
  80. package/dist/cover/type.d.ts +7 -0
  81. package/dist/cover/type.js +65 -0
  82. package/dist/cover/type.js.map +7 -0
  83. package/dist/cover/types.d.ts +70 -0
  84. package/dist/cover/types.js +17 -0
  85. package/dist/cover/types.js.map +7 -0
  86. package/dist/debug.d.ts +99 -0
  87. package/dist/debug.js +345 -0
  88. package/dist/debug.js.map +7 -0
  89. package/dist/dlx-binary.d.ts +49 -0
  90. package/dist/dlx-binary.js +261 -0
  91. package/dist/dlx-binary.js.map +7 -0
  92. package/dist/dlx.d.ts +64 -0
  93. package/dist/dlx.js +168 -0
  94. package/dist/dlx.js.map +7 -0
  95. package/dist/download-lock.d.ts +48 -0
  96. package/dist/download-lock.js +139 -0
  97. package/dist/download-lock.js.map +7 -0
  98. package/dist/effects/pulse-frames.d.ts +23 -0
  99. package/dist/effects/pulse-frames.js +66 -0
  100. package/dist/effects/pulse-frames.js.map +7 -0
  101. package/dist/effects/text-shimmer.d.ts +37 -0
  102. package/dist/effects/text-shimmer.js +175 -0
  103. package/dist/effects/text-shimmer.js.map +7 -0
  104. package/dist/effects/types.d.ts +41 -0
  105. package/dist/effects/types.js +17 -0
  106. package/dist/effects/types.js.map +7 -0
  107. package/dist/effects/ultra.d.ts +16 -0
  108. package/dist/effects/ultra.js +63 -0
  109. package/dist/effects/ultra.js.map +7 -0
  110. package/dist/env/appdata.d.ts +1 -0
  111. package/dist/env/appdata.js +30 -0
  112. package/dist/env/appdata.js.map +7 -0
  113. package/dist/env/ci.d.ts +1 -0
  114. package/dist/env/ci.js +31 -0
  115. package/dist/env/ci.js.map +7 -0
  116. package/dist/env/comspec.d.ts +1 -0
  117. package/dist/env/comspec.js +30 -0
  118. package/dist/env/comspec.js.map +7 -0
  119. package/dist/env/debug.d.ts +1 -0
  120. package/dist/env/debug.js +30 -0
  121. package/dist/env/debug.js.map +7 -0
  122. package/dist/env/getters.d.ts +40 -0
  123. package/dist/env/getters.js +283 -0
  124. package/dist/env/getters.js.map +7 -0
  125. package/dist/env/github-api-url.d.ts +1 -0
  126. package/dist/env/github-api-url.js +30 -0
  127. package/dist/env/github-api-url.js.map +7 -0
  128. package/dist/env/github-base-ref.d.ts +1 -0
  129. package/dist/env/github-base-ref.js +30 -0
  130. package/dist/env/github-base-ref.js.map +7 -0
  131. package/dist/env/github-ref-name.d.ts +1 -0
  132. package/dist/env/github-ref-name.js +30 -0
  133. package/dist/env/github-ref-name.js.map +7 -0
  134. package/dist/env/github-ref-type.d.ts +1 -0
  135. package/dist/env/github-ref-type.js +30 -0
  136. package/dist/env/github-ref-type.js.map +7 -0
  137. package/dist/env/github-repository.d.ts +1 -0
  138. package/dist/env/github-repository.js +30 -0
  139. package/dist/env/github-repository.js.map +7 -0
  140. package/dist/env/github-server-url.d.ts +1 -0
  141. package/dist/env/github-server-url.js +30 -0
  142. package/dist/env/github-server-url.js.map +7 -0
  143. package/dist/env/github-token.d.ts +1 -0
  144. package/dist/env/github-token.js +30 -0
  145. package/dist/env/github-token.js.map +7 -0
  146. package/dist/env/helpers.d.ts +6 -0
  147. package/dist/env/helpers.js +49 -0
  148. package/dist/env/helpers.js.map +7 -0
  149. package/dist/env/home.d.ts +1 -0
  150. package/dist/env/home.js +30 -0
  151. package/dist/env/home.js.map +7 -0
  152. package/dist/env/jest-worker-id.d.ts +1 -0
  153. package/dist/env/jest-worker-id.js +30 -0
  154. package/dist/env/jest-worker-id.js.map +7 -0
  155. package/dist/env/lang.d.ts +1 -0
  156. package/dist/env/lang.js +30 -0
  157. package/dist/env/lang.js.map +7 -0
  158. package/dist/env/lc-all.d.ts +1 -0
  159. package/dist/env/lc-all.js +30 -0
  160. package/dist/env/lc-all.js.map +7 -0
  161. package/dist/env/lc-messages.d.ts +1 -0
  162. package/dist/env/lc-messages.js +30 -0
  163. package/dist/env/lc-messages.js.map +7 -0
  164. package/dist/env/localappdata.d.ts +1 -0
  165. package/dist/env/localappdata.js +30 -0
  166. package/dist/env/localappdata.js.map +7 -0
  167. package/dist/env/node-auth-token.d.ts +1 -0
  168. package/dist/env/node-auth-token.js +30 -0
  169. package/dist/env/node-auth-token.js.map +7 -0
  170. package/dist/env/node-env.d.ts +1 -0
  171. package/dist/env/node-env.js +30 -0
  172. package/dist/env/node-env.js.map +7 -0
  173. package/dist/env/npm-config-registry.d.ts +1 -0
  174. package/dist/env/npm-config-registry.js +30 -0
  175. package/dist/env/npm-config-registry.js.map +7 -0
  176. package/dist/env/npm-config-user-agent.d.ts +1 -0
  177. package/dist/env/npm-config-user-agent.js +30 -0
  178. package/dist/env/npm-config-user-agent.js.map +7 -0
  179. package/dist/env/npm-lifecycle-event.d.ts +1 -0
  180. package/dist/env/npm-lifecycle-event.js +30 -0
  181. package/dist/env/npm-lifecycle-event.js.map +7 -0
  182. package/dist/env/npm-registry.d.ts +1 -0
  183. package/dist/env/npm-registry.js +30 -0
  184. package/dist/env/npm-registry.js.map +7 -0
  185. package/dist/env/npm-token.d.ts +1 -0
  186. package/dist/env/npm-token.js +30 -0
  187. package/dist/env/npm-token.js.map +7 -0
  188. package/dist/env/path.d.ts +1 -0
  189. package/dist/env/path.js +30 -0
  190. package/dist/env/path.js.map +7 -0
  191. package/dist/env/pre-commit.d.ts +1 -0
  192. package/dist/env/pre-commit.js +31 -0
  193. package/dist/env/pre-commit.js.map +7 -0
  194. package/dist/env/shell.d.ts +1 -0
  195. package/dist/env/shell.js +30 -0
  196. package/dist/env/shell.js.map +7 -0
  197. package/dist/env/socket-accept-risks.d.ts +1 -0
  198. package/dist/env/socket-accept-risks.js +31 -0
  199. package/dist/env/socket-accept-risks.js.map +7 -0
  200. package/dist/env/socket-api-base-url.d.ts +1 -0
  201. package/dist/env/socket-api-base-url.js +30 -0
  202. package/dist/env/socket-api-base-url.js.map +7 -0
  203. package/dist/env/socket-api-proxy.d.ts +1 -0
  204. package/dist/env/socket-api-proxy.js +30 -0
  205. package/dist/env/socket-api-proxy.js.map +7 -0
  206. package/dist/env/socket-api-timeout.d.ts +1 -0
  207. package/dist/env/socket-api-timeout.js +31 -0
  208. package/dist/env/socket-api-timeout.js.map +7 -0
  209. package/dist/env/socket-api-token.d.ts +1 -0
  210. package/dist/env/socket-api-token.js +30 -0
  211. package/dist/env/socket-api-token.js.map +7 -0
  212. package/dist/env/socket-cacache-dir.d.ts +1 -0
  213. package/dist/env/socket-cacache-dir.js +30 -0
  214. package/dist/env/socket-cacache-dir.js.map +7 -0
  215. package/dist/env/socket-cli-accept-risks.d.ts +1 -0
  216. package/dist/env/socket-cli-accept-risks.js +33 -0
  217. package/dist/env/socket-cli-accept-risks.js.map +7 -0
  218. package/dist/env/socket-cli-api-base-url.d.ts +1 -0
  219. package/dist/env/socket-cli-api-base-url.js +30 -0
  220. package/dist/env/socket-cli-api-base-url.js.map +7 -0
  221. package/dist/env/socket-cli-api-proxy.d.ts +1 -0
  222. package/dist/env/socket-cli-api-proxy.js +30 -0
  223. package/dist/env/socket-cli-api-proxy.js.map +7 -0
  224. package/dist/env/socket-cli-api-timeout.d.ts +1 -0
  225. package/dist/env/socket-cli-api-timeout.js +31 -0
  226. package/dist/env/socket-cli-api-timeout.js.map +7 -0
  227. package/dist/env/socket-cli-api-token.d.ts +1 -0
  228. package/dist/env/socket-cli-api-token.js +30 -0
  229. package/dist/env/socket-cli-api-token.js.map +7 -0
  230. package/dist/env/socket-cli-config.d.ts +1 -0
  231. package/dist/env/socket-cli-config.js +30 -0
  232. package/dist/env/socket-cli-config.js.map +7 -0
  233. package/dist/env/socket-cli-fix.d.ts +1 -0
  234. package/dist/env/socket-cli-fix.js +30 -0
  235. package/dist/env/socket-cli-fix.js.map +7 -0
  236. package/dist/env/socket-cli-no-api-token.d.ts +1 -0
  237. package/dist/env/socket-cli-no-api-token.js +33 -0
  238. package/dist/env/socket-cli-no-api-token.js.map +7 -0
  239. package/dist/env/socket-cli-optimize.d.ts +1 -0
  240. package/dist/env/socket-cli-optimize.js +31 -0
  241. package/dist/env/socket-cli-optimize.js.map +7 -0
  242. package/dist/env/socket-cli-org-slug.d.ts +1 -0
  243. package/dist/env/socket-cli-org-slug.js +30 -0
  244. package/dist/env/socket-cli-org-slug.js.map +7 -0
  245. package/dist/env/socket-cli-shadow-accept-risks.d.ts +1 -0
  246. package/dist/env/socket-cli-shadow-accept-risks.js +33 -0
  247. package/dist/env/socket-cli-shadow-accept-risks.js.map +7 -0
  248. package/dist/env/socket-cli-shadow-api-token.d.ts +1 -0
  249. package/dist/env/socket-cli-shadow-api-token.js +30 -0
  250. package/dist/env/socket-cli-shadow-api-token.js.map +7 -0
  251. package/dist/env/socket-cli-shadow-bin.d.ts +1 -0
  252. package/dist/env/socket-cli-shadow-bin.js +30 -0
  253. package/dist/env/socket-cli-shadow-bin.js.map +7 -0
  254. package/dist/env/socket-cli-shadow-progress.d.ts +1 -0
  255. package/dist/env/socket-cli-shadow-progress.js +33 -0
  256. package/dist/env/socket-cli-shadow-progress.js.map +7 -0
  257. package/dist/env/socket-cli-shadow-silent.d.ts +1 -0
  258. package/dist/env/socket-cli-shadow-silent.js +33 -0
  259. package/dist/env/socket-cli-shadow-silent.js.map +7 -0
  260. package/dist/env/socket-cli-view-all-risks.d.ts +1 -0
  261. package/dist/env/socket-cli-view-all-risks.js +33 -0
  262. package/dist/env/socket-cli-view-all-risks.js.map +7 -0
  263. package/dist/env/socket-config.d.ts +1 -0
  264. package/dist/env/socket-config.js +30 -0
  265. package/dist/env/socket-config.js.map +7 -0
  266. package/dist/env/socket-debug.d.ts +1 -0
  267. package/dist/env/socket-debug.js +30 -0
  268. package/dist/env/socket-debug.js.map +7 -0
  269. package/dist/env/socket-home.d.ts +1 -0
  270. package/dist/env/socket-home.js +30 -0
  271. package/dist/env/socket-home.js.map +7 -0
  272. package/dist/env/socket-no-api-token.d.ts +1 -0
  273. package/dist/env/socket-no-api-token.js +31 -0
  274. package/dist/env/socket-no-api-token.js.map +7 -0
  275. package/dist/env/socket-npm-registry.d.ts +1 -0
  276. package/dist/env/socket-npm-registry.js +30 -0
  277. package/dist/env/socket-npm-registry.js.map +7 -0
  278. package/dist/env/socket-org-slug.d.ts +1 -0
  279. package/dist/env/socket-org-slug.js +30 -0
  280. package/dist/env/socket-org-slug.js.map +7 -0
  281. package/dist/env/socket-registry-url.d.ts +1 -0
  282. package/dist/env/socket-registry-url.js +30 -0
  283. package/dist/env/socket-registry-url.js.map +7 -0
  284. package/dist/env/socket-view-all-risks.d.ts +1 -0
  285. package/dist/env/socket-view-all-risks.js +31 -0
  286. package/dist/env/socket-view-all-risks.js.map +7 -0
  287. package/dist/env/temp.d.ts +1 -0
  288. package/dist/env/temp.js +30 -0
  289. package/dist/env/temp.js.map +7 -0
  290. package/dist/env/term.d.ts +1 -0
  291. package/dist/env/term.js +30 -0
  292. package/dist/env/term.js.map +7 -0
  293. package/dist/env/tmp.d.ts +1 -0
  294. package/dist/env/tmp.js +30 -0
  295. package/dist/env/tmp.js.map +7 -0
  296. package/dist/env/tmpdir.d.ts +1 -0
  297. package/dist/env/tmpdir.js +30 -0
  298. package/dist/env/tmpdir.js.map +7 -0
  299. package/dist/env/userprofile.d.ts +1 -0
  300. package/dist/env/userprofile.js +30 -0
  301. package/dist/env/userprofile.js.map +7 -0
  302. package/dist/env/vitest.d.ts +1 -0
  303. package/dist/env/vitest.js +31 -0
  304. package/dist/env/vitest.js.map +7 -0
  305. package/dist/env/xdg-cache-home.d.ts +1 -0
  306. package/dist/env/xdg-cache-home.js +30 -0
  307. package/dist/env/xdg-cache-home.js.map +7 -0
  308. package/dist/env/xdg-config-home.d.ts +1 -0
  309. package/dist/env/xdg-config-home.js +30 -0
  310. package/dist/env/xdg-config-home.js.map +7 -0
  311. package/dist/env/xdg-data-home.d.ts +1 -0
  312. package/dist/env/xdg-data-home.js +30 -0
  313. package/dist/env/xdg-data-home.js.map +7 -0
  314. package/dist/env.d.ts +15 -0
  315. package/dist/env.js +63 -0
  316. package/dist/env.js.map +7 -0
  317. package/dist/external/@inquirer/checkbox.js +4 -0
  318. package/dist/external/@inquirer/confirm.js +22 -0
  319. package/dist/external/@inquirer/core.js +4 -0
  320. package/dist/external/@inquirer/input.js +1 -0
  321. package/dist/external/@inquirer/password.js +1 -0
  322. package/dist/external/@inquirer/prompts.js +4 -0
  323. package/dist/external/@inquirer/search.js +1 -0
  324. package/dist/external/@inquirer/select.js +25 -0
  325. package/dist/external/@npmcli/package-json/index.js +1 -0
  326. package/dist/external/@npmcli/package-json/lib/read-package.js +1 -0
  327. package/dist/external/@npmcli/package-json/lib/sort.js +1 -0
  328. package/dist/external/@npmcli/promise-spawn.js +5 -0
  329. package/dist/external/@socketregistry/is-unicode-supported.d.ts +2 -0
  330. package/dist/external/@socketregistry/is-unicode-supported.js +5 -0
  331. package/dist/external/@socketregistry/packageurl-js.js +34 -0
  332. package/dist/external/@socketregistry/yocto-spinner.d.ts +12 -0
  333. package/dist/external/@socketregistry/yocto-spinner.js +8 -0
  334. package/dist/external/@yarnpkg/extensions.d.ts +5 -0
  335. package/dist/external/@yarnpkg/extensions.js +5 -0
  336. package/dist/external/cacache.d.ts +93 -0
  337. package/dist/external/cacache.js +32 -0
  338. package/dist/external/debug.d.ts +25 -0
  339. package/dist/external/debug.js +9 -0
  340. package/dist/external/del.d.ts +1 -0
  341. package/dist/external/del.js +54 -0
  342. package/dist/external/fast-glob.js +54 -0
  343. package/dist/external/fast-sort.d.ts +4 -0
  344. package/dist/external/fast-sort.js +5 -0
  345. package/dist/external/get-east-asian-width.d.ts +5 -0
  346. package/dist/external/get-east-asian-width.js +5 -0
  347. package/dist/external/libnpmpack.d.ts +3 -0
  348. package/dist/external/libnpmpack.js +225 -0
  349. package/dist/external/make-fetch-happen.d.ts +16 -0
  350. package/dist/external/make-fetch-happen.js +69 -0
  351. package/dist/external/normalize-package-data.js +6 -0
  352. package/dist/external/npm-package-arg.js +6 -0
  353. package/dist/external/pacote.d.ts +19 -0
  354. package/dist/external/pacote.js +105 -0
  355. package/dist/external/picomatch.js +5 -0
  356. package/dist/external/semver.d.ts +3 -0
  357. package/dist/external/semver.js +5 -0
  358. package/dist/external/spdx-correct.js +5 -0
  359. package/dist/external/spdx-expression-parse.js +5 -0
  360. package/dist/external/streaming-iterables.js +5 -0
  361. package/dist/external/validate-npm-package-name.js +5 -0
  362. package/dist/external/which.js +5 -0
  363. package/dist/external/yargs-parser.d.ts +3 -0
  364. package/dist/external/yargs-parser.js +26 -0
  365. package/dist/external/yoctocolors-cjs.d.ts +38 -0
  366. package/dist/external/yoctocolors-cjs.js +5 -0
  367. package/dist/external/zod.d.ts +1 -0
  368. package/dist/external/zod.js +27 -0
  369. package/dist/fs.d.ts +184 -0
  370. package/dist/fs.js +610 -0
  371. package/dist/fs.js.map +7 -0
  372. package/dist/functions.d.ts +27 -0
  373. package/dist/functions.js +70 -0
  374. package/dist/functions.js.map +7 -0
  375. package/dist/git.d.ts +93 -0
  376. package/dist/git.js +321 -0
  377. package/dist/git.js.map +7 -0
  378. package/dist/github.d.ts +121 -0
  379. package/dist/github.js +203 -0
  380. package/dist/github.js.map +7 -0
  381. package/dist/globs.d.ts +46 -0
  382. package/dist/globs.js +154 -0
  383. package/dist/globs.js.map +7 -0
  384. package/dist/http-request.d.ts +53 -0
  385. package/dist/http-request.js +315 -0
  386. package/dist/http-request.js.map +7 -0
  387. package/dist/index.d.ts +13 -0
  388. package/dist/index.js +64 -0
  389. package/dist/index.js.map +7 -0
  390. package/dist/ipc.d.ts +366 -0
  391. package/dist/ipc.js +234 -0
  392. package/dist/ipc.js.map +7 -0
  393. package/dist/json.d.ts +23 -0
  394. package/dist/json.js +75 -0
  395. package/dist/json.js.map +7 -0
  396. package/dist/logger.d.ts +183 -0
  397. package/dist/logger.js +653 -0
  398. package/dist/logger.js.map +7 -0
  399. package/dist/maintained-node-versions.d.ts +7 -0
  400. package/dist/maintained-node-versions.js +37 -0
  401. package/dist/maintained-node-versions.js.map +7 -0
  402. package/dist/memoization.d.ts +142 -0
  403. package/dist/memoization.js +212 -0
  404. package/dist/memoization.js.map +7 -0
  405. package/dist/objects.d.ts +146 -0
  406. package/dist/objects.js +321 -0
  407. package/dist/objects.js.map +7 -0
  408. package/dist/packages/editable.d.ts +107 -0
  409. package/dist/packages/editable.js +358 -0
  410. package/dist/packages/editable.js.map +7 -0
  411. package/dist/packages/exports.d.ts +30 -0
  412. package/dist/packages/exports.js +164 -0
  413. package/dist/packages/exports.js.map +7 -0
  414. package/dist/packages/isolation.d.ts +22 -0
  415. package/dist/packages/isolation.js +197 -0
  416. package/dist/packages/isolation.js.map +7 -0
  417. package/dist/packages/licenses.d.ts +68 -0
  418. package/dist/packages/licenses.js +216 -0
  419. package/dist/packages/licenses.js.map +7 -0
  420. package/dist/packages/manifest.d.ts +16 -0
  421. package/dist/packages/manifest.js +192 -0
  422. package/dist/packages/manifest.js.map +7 -0
  423. package/dist/packages/normalize.d.ts +21 -0
  424. package/dist/packages/normalize.js +122 -0
  425. package/dist/packages/normalize.js.map +7 -0
  426. package/dist/packages/operations.d.ts +54 -0
  427. package/dist/packages/operations.js +306 -0
  428. package/dist/packages/operations.js.map +7 -0
  429. package/dist/packages/paths.d.ts +10 -0
  430. package/dist/packages/paths.js +55 -0
  431. package/dist/packages/paths.js.map +7 -0
  432. package/dist/packages/provenance.d.ts +10 -0
  433. package/dist/packages/provenance.js +180 -0
  434. package/dist/packages/provenance.js.map +7 -0
  435. package/dist/packages/registry.d.ts +8 -0
  436. package/dist/packages/registry.js +30 -0
  437. package/dist/packages/registry.js.map +7 -0
  438. package/dist/packages/specs.d.ts +28 -0
  439. package/dist/packages/specs.js +85 -0
  440. package/dist/packages/specs.js.map +7 -0
  441. package/dist/packages/validation.d.ts +15 -0
  442. package/dist/packages/validation.js +53 -0
  443. package/dist/packages/validation.js.map +7 -0
  444. package/dist/packages.d.ts +154 -0
  445. package/dist/packages.js +131 -0
  446. package/dist/packages.js.map +7 -0
  447. package/dist/path.d.ts +74 -0
  448. package/dist/path.js +442 -0
  449. package/dist/path.js.map +7 -0
  450. package/dist/paths.d.ts +42 -0
  451. package/dist/paths.js +145 -0
  452. package/dist/paths.js.map +7 -0
  453. package/dist/performance.d.ts +178 -0
  454. package/dist/performance.js +219 -0
  455. package/dist/performance.js.map +7 -0
  456. package/dist/promise-queue.d.ts +35 -0
  457. package/dist/promise-queue.js +111 -0
  458. package/dist/promise-queue.js.map +7 -0
  459. package/dist/promises.d.ts +67 -0
  460. package/dist/promises.js +268 -0
  461. package/dist/promises.js.map +7 -0
  462. package/dist/prompts.d.ts +27 -0
  463. package/dist/prompts.js +60 -0
  464. package/dist/prompts.js.map +7 -0
  465. package/dist/regexps.d.ts +13 -0
  466. package/dist/regexps.js +32 -0
  467. package/dist/regexps.js.map +7 -0
  468. package/dist/sea.d.ts +10 -0
  469. package/dist/sea.js +46 -0
  470. package/dist/sea.js.map +7 -0
  471. package/dist/shadow.d.ts +17 -0
  472. package/dist/shadow.js +60 -0
  473. package/dist/shadow.js.map +7 -0
  474. package/dist/signal-exit.d.ts +23 -0
  475. package/dist/signal-exit.js +250 -0
  476. package/dist/signal-exit.js.map +7 -0
  477. package/dist/sorts.d.ts +28 -0
  478. package/dist/sorts.js +96 -0
  479. package/dist/sorts.js.map +7 -0
  480. package/dist/spawn.d.ts +207 -0
  481. package/dist/spawn.js +201 -0
  482. package/dist/spawn.js.map +7 -0
  483. package/dist/spinner.d.ts +208 -0
  484. package/dist/spinner.js +729 -0
  485. package/dist/spinner.js.map +7 -0
  486. package/dist/ssri.d.ts +95 -0
  487. package/dist/ssri.js +73 -0
  488. package/dist/ssri.js.map +7 -0
  489. package/dist/stdio/clear.d.ts +40 -0
  490. package/dist/stdio/clear.js +84 -0
  491. package/dist/stdio/clear.js.map +7 -0
  492. package/dist/stdio/divider.d.ts +48 -0
  493. package/dist/stdio/divider.js +81 -0
  494. package/dist/stdio/divider.js.map +7 -0
  495. package/dist/stdio/footer.d.ts +25 -0
  496. package/dist/stdio/footer.js +96 -0
  497. package/dist/stdio/footer.js.map +7 -0
  498. package/dist/stdio/header.d.ts +25 -0
  499. package/dist/stdio/header.js +102 -0
  500. package/dist/stdio/header.js.map +7 -0
  501. package/dist/stdio/mask.d.ts +72 -0
  502. package/dist/stdio/mask.js +187 -0
  503. package/dist/stdio/mask.js.map +7 -0
  504. package/dist/stdio/progress.d.ts +51 -0
  505. package/dist/stdio/progress.js +171 -0
  506. package/dist/stdio/progress.js.map +7 -0
  507. package/dist/stdio/prompts.d.ts +46 -0
  508. package/dist/stdio/prompts.js +90 -0
  509. package/dist/stdio/prompts.js.map +7 -0
  510. package/dist/stdio/stderr.d.ts +48 -0
  511. package/dist/stdio/stderr.js +91 -0
  512. package/dist/stdio/stderr.js.map +7 -0
  513. package/dist/stdio/stdout.d.ts +48 -0
  514. package/dist/stdio/stdout.js +105 -0
  515. package/dist/stdio/stdout.js.map +7 -0
  516. package/dist/streams.d.ts +20 -0
  517. package/dist/streams.js +80 -0
  518. package/dist/streams.js.map +7 -0
  519. package/dist/strings.d.ts +139 -0
  520. package/dist/strings.js +253 -0
  521. package/dist/strings.js.map +7 -0
  522. package/dist/suppress-warnings.d.ts +66 -0
  523. package/dist/suppress-warnings.js +100 -0
  524. package/dist/suppress-warnings.js.map +7 -0
  525. package/dist/tables.d.ts +69 -0
  526. package/dist/tables.js +130 -0
  527. package/dist/tables.js.map +7 -0
  528. package/dist/temporary-executor.d.ts +9 -0
  529. package/dist/temporary-executor.js +54 -0
  530. package/dist/temporary-executor.js.map +7 -0
  531. package/dist/types.d.ts +65 -0
  532. package/dist/types.js +74 -0
  533. package/dist/types.js.map +7 -0
  534. package/dist/url.d.ts +60 -0
  535. package/dist/url.js +144 -0
  536. package/dist/url.js.map +7 -0
  537. package/dist/utils/get-ipc.d.ts +16 -0
  538. package/dist/utils/get-ipc.js +60 -0
  539. package/dist/utils/get-ipc.js.map +7 -0
  540. package/dist/validation/json-parser.d.ts +10 -0
  541. package/dist/validation/json-parser.js +129 -0
  542. package/dist/validation/json-parser.js.map +7 -0
  543. package/dist/validation/types.d.ts +40 -0
  544. package/dist/validation/types.js +17 -0
  545. package/dist/validation/types.js.map +7 -0
  546. package/dist/versions.d.ts +87 -0
  547. package/dist/versions.js +155 -0
  548. package/dist/versions.js.map +7 -0
  549. package/dist/words.d.ts +22 -0
  550. package/dist/words.js +52 -0
  551. package/dist/words.js.map +7 -0
  552. package/dist/zod.d.ts +5 -0
  553. package/dist/zod.js +29 -0
  554. package/dist/zod.js.map +7 -0
  555. package/package.json +856 -7
package/CHANGELOG.md ADDED
@@ -0,0 +1,276 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.1] - 2025-10-21
9
+
10
+ ### Fixed
11
+
12
+ - Fixed relative import paths in compiled CommonJS output (changed `require("../external/...")` to `require("./external/...")` for root-level dist files)
13
+
14
+ ## [1.0.0] - 2025-10-20
15
+
16
+ ### Changed
17
+
18
+ - Consolidated parseArgs into argv/parse module
19
+
20
+ ---
21
+
22
+ **Historical Entries**: The entries below are from when this package was named `@socketsecurity/registry`. This package was renamed to `@socketsecurity/lib` starting with version 1.0.0.
23
+
24
+ ---
25
+
26
+ ## [1.5.3] - 2025-10-07
27
+
28
+ ### Added
29
+
30
+ - Fix bad build and add validation to prevent in future
31
+
32
+ ## [1.5.2] - 2025-10-07
33
+
34
+ ### Added
35
+
36
+ - Added coverage utilities to parse v8 and type coverage reports
37
+
38
+ ### Fixed
39
+
40
+ - Fixed `isPath` function to exclude URLs with protocols
41
+ - Fixed `isolatePackage` to handle file: URLs and npm-package-arg paths correctly
42
+
43
+ ## [1.5.1] - 2025-10-05
44
+
45
+ ### Added
46
+
47
+ - Added `isolatePackage` to `lib/packages/isolation` for creating isolated package test environments
48
+
49
+ ### Changed
50
+
51
+ - Removed `dependencies/index` barrel file to prevent eager loading of all dependency modules
52
+
53
+ ## [1.5.0] - 2025-10-05
54
+
55
+ ### Added
56
+
57
+ - Added support for testing local development packages in addition to socket-registry packages
58
+ - Exposed isolation module as part of public API via `lib/packages`
59
+
60
+ ### Changed
61
+
62
+ - Renamed `setupPackageTest` to `isolatePackage` for clearer intent
63
+ - Refactored `installPackageForTesting` to accept explicit `sourcePath` and `packageName` parameters
64
+ - Simplified package installation logic by removing path detection from low-level function
65
+ - Consolidated `setupPackageTest` and `setupMultiEntryTest` into single `isolatePackage` function with options
66
+
67
+ ## [1.4.6] - 2025-10-05
68
+
69
+ ### Added
70
+
71
+ - Added comprehensive package.json exports validation tests
72
+
73
+ ## [1.4.5] - 2025-10-05
74
+
75
+ ### Added
76
+
77
+ - Added performance monitoring utilities with timer, measurement, and reporting functions
78
+ - Added memoization utilities with LRU, TTL, weak references, and promise deduplication support
79
+ - Added table formatting utilities (`formatTable`, `formatSimpleTable`) for CLI output
80
+ - Added progress tracking to spinner with `updateProgress()` and `incrementProgress()` methods
81
+ - Added `isDir` and `safeStats` async helpers to fs module
82
+
83
+ ### Changed
84
+
85
+ - Removed `platform` and `arch` options from `dlxBinary` function as cross-platform binary execution is not supported
86
+
87
+ ### Fixed
88
+
89
+ - Fixed Windows shell execution in `dlxBinary` by adding cache directory to PATH
90
+
91
+ ## [1.4.4] - 2025-10-05
92
+
93
+ ### Fixed
94
+
95
+ - Fixed subpath exports
96
+
97
+ ## [1.4.3] - 2025-10-04
98
+
99
+ ### Added
100
+
101
+ - Spinner lifecycle utilities (`withSpinner`, `withSpinnerRestore`, `withSpinnerSync`) for automatic spinner cleanup with try/finally blocks
102
+
103
+ ## [1.4.2] - 2025-10-04
104
+
105
+ ### Added
106
+
107
+ - Added `GITHUB_API_BASE_URL` constant for GitHub API endpoint configuration
108
+ - Added `SOCKET_API_BASE_URL` constant for Socket API endpoint configuration
109
+ - Added generic TTL cache utility (`createTtlCache`) with in-memory memoization and persistent storage support
110
+
111
+ ### Changed
112
+
113
+ - Refactored GitHub caching to use the new `cache-with-ttl` utility for better performance and consistency
114
+
115
+ ## [1.4.1] - 2025-10-04
116
+
117
+ ### Changed
118
+
119
+ - Update maintained Node.js versions of `constants.maintainedNodeVersions`
120
+
121
+ ## [1.4.0] - 2025-10-04
122
+
123
+ ### Added
124
+
125
+ - Added `PromiseQueue` utility for controlled concurrency operations
126
+ - Added lazy dependency loaders and test utilities
127
+ - Added HTTP utilities with retry logic and download locking
128
+ - Added `.claude` directory for scratch documents
129
+ - Added `noUnusedLocals` and `noUnusedParameters` to TypeScript config
130
+
131
+ ### Changed
132
+
133
+ - Refactored all library functions to use options objects for better API consistency
134
+ - `lib/strings.ts` - String manipulation functions
135
+ - `lib/url.ts` - URL handling functions
136
+ - `lib/words.ts` - Word manipulation functions
137
+ - Refactored `lib/packages` module into specialized submodules for improved code organization
138
+ - `lib/packages/editable.ts` - Package editing functionality
139
+ - `lib/packages/exports.ts` - Export resolution utilities
140
+ - `lib/packages/licenses.ts` - License handling and validation
141
+ - `lib/packages/manifest.ts` - Manifest data operations
142
+ - `lib/packages/normalize.ts` - Path normalization utilities
143
+ - `lib/packages/operations.ts` - Package installation and modification operations
144
+ - `lib/packages/paths.ts` - Package path utilities
145
+ - `lib/packages/provenance.ts` - Package provenance verification
146
+ - `lib/packages/specs.ts` - Package spec parsing
147
+ - `lib/packages/validation.ts` - Package validation utilities
148
+ - Moved configuration files (vitest, eslint, knip, oxlint, taze) to `.config` directory
149
+ - Replaced `fetch()` with Node.js native `http`/`https` modules for better reliability
150
+ - Replaced `any` types with meaningful types across library utilities
151
+ - Improved pnpm security with build script allowlist
152
+ - Updated vitest coverage thresholds to 80%
153
+ - Consolidated test files to reduce duplication
154
+ - Note: Public API remains unchanged; these are internal organizational improvements
155
+
156
+ ### Fixed
157
+
158
+ - Fixed resource leaks and race conditions in socket-registry
159
+ - Fixed `yarn-cache-path` constant to return string type consistently
160
+ - Fixed Yarn Windows temp path detection in `shouldSkipShadow`
161
+ - Fixed path normalization for Windows compatibility across all path utilities
162
+ - Fixed cache path tests for Windows case sensitivity
163
+ - Fixed type errors in promises, parse-args, logger, and specs tests
164
+ - Fixed GitHub tests to mock `httpRequest` correctly
165
+ - Fixed SEA build tests to mock `httpRequest`
166
+ - Decoded URL percent-encoding in `pathLikeToString` fallback
167
+
168
+ ## [1.3.10] - 2025-10-03
169
+
170
+ ### Added
171
+
172
+ - New utility modules for DLX, shadow, SEA, cacache, and versions functionality
173
+ - getSocketHomePath alias to paths module
174
+ - del dependency and external wrapper for safer file deletion
175
+ - @fileoverview tags to lib modules
176
+ - camelCase expansion for kebab-case arguments in parseArgs
177
+ - Coerce and configuration options to parseArgs
178
+
179
+ ### Changed
180
+
181
+ - Updated file removal to use del package for safer deletion
182
+ - Normalized path returns in fs and Socket directory utilities
183
+ - Removed default exports from git and parse-args modules
184
+ - Enhanced test coverage across multiple modules (parse-args, prompts, strings, env, spawn, json)
185
+
186
+ ## [1.3.9] - 2025-10-03
187
+
188
+ ### Changed
189
+
190
+ - Internal build and distribution updates
191
+
192
+ ## [1.3.8] - 2025-10-03
193
+
194
+ ### Added
195
+
196
+ - Added unified directory structure for Socket ecosystem tools
197
+ - New path utilities module for cross-platform directory resolution
198
+ - Directory structure constants for Socket CLI, Registry, Firewall, and DLX
199
+
200
+ ## [1.3.7] - 2025-10-02
201
+
202
+ ### Changed
203
+
204
+ - Updated manifest.json entries
205
+
206
+ ## [1.3.6] - 2025-10-01
207
+
208
+ ### Fixed
209
+
210
+ - Fixed indent-string interoperability with older v1 and v2 versions
211
+
212
+ ## [1.3.5] - 2025-10-01
213
+
214
+ ### Added
215
+
216
+ - Added lib/git utilities module
217
+
218
+ ### Fixed
219
+
220
+ - Fixed invalid manifest entries
221
+ - Fixed parseArgs strip-aliased bug
222
+
223
+ ## [1.3.4] - 2025-10-01
224
+
225
+ ### Changed
226
+
227
+ - Updated various package override versions
228
+
229
+ ## [1.3.3] - 2025-10-01
230
+
231
+ ### Fixed
232
+
233
+ - Fixed normalizePath collapsing multiple leading `..` segments incorrectly
234
+
235
+ ## [1.3.2] - 2025-10-01
236
+
237
+ ### Added
238
+
239
+ - Added 'sfw' to isBlessedPackageName method check
240
+ - Added ENV.DEBUG normalization for debug package compatibility
241
+ - `DEBUG='1'` or `DEBUG='true'` automatically expands to `DEBUG='*'` (enables all namespaces)
242
+ - `DEBUG='0'` or `DEBUG='false'` automatically converts to empty string (disables all output)
243
+ - Namespace patterns like `DEBUG='app:*'` are preserved unchanged
244
+
245
+ ## [1.3.1] - 2025-09-30
246
+
247
+ ### Changed
248
+
249
+ - Renamed debug functions from *Complex to *Ns
250
+
251
+ ### Fixed
252
+
253
+ - Fixed regression with lib/prompts module imports
254
+
255
+ ## [1.3.0] - 2025-09-29
256
+
257
+ ### Changed
258
+
259
+ - Updated registry subpath exports
260
+
261
+ ### Fixed
262
+
263
+ - Fixed Node.js built-in module imports in CommonJS output
264
+
265
+ ## [1.2.2] - 2025-09-29
266
+
267
+ ### Changed
268
+
269
+ - Internal improvements to module structure
270
+
271
+ ## [1.2.1] - 2025-09-29
272
+
273
+ ### Changed
274
+
275
+ - Restructured constants module with new architecture
276
+ - Updated build configuration and package exports
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Socket Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,8 +1,86 @@
1
1
  # @socketsecurity/lib
2
2
 
3
- Core utilities for Socket.dev security tools.
3
+ [![Socket Badge](https://socket.dev/api/badge/npm/package/@socketsecurity/lib)](https://socket.dev/npm/package/@socketsecurity/lib)
4
+ [![CI - SocketDev/socket-lib](https://github.com/SocketDev/socket-lib/actions/workflows/ci.yml/badge.svg)](https://github.com/SocketDev/socket-lib/actions/workflows/ci.yml)
4
5
 
5
- This package is currently a placeholder for setting up npm trusted publishing. Full documentation will be added in version 2.0.
6
+ [![Follow @SocketSecurity](https://img.shields.io/twitter/follow/SocketSecurity?style=social)](https://twitter.com/SocketSecurity)
7
+ [![Follow @socket.dev on Bluesky](https://img.shields.io/badge/Follow-@socket.dev-1DA1F2?style=social&logo=bluesky)](https://bsky.app/profile/socket.dev)
8
+
9
+ > Core utilities, constants, and helper functions for Socket.dev security tools.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ pnpm install @socketsecurity/lib
15
+ ```
16
+
17
+ ## Features
18
+
19
+ - **Constants** — Access Node.js, npm, and package manager constants
20
+ - **Type Definitions** — Full TypeScript support with comprehensive type exports
21
+ - **Helper Utilities** — File system, path, package, and process utilities
22
+ - **Environment Variables** — Typed access to environment variables
23
+ - **Effects** — Visual effects for CLI applications
24
+
25
+ ## Usage
26
+
27
+ ### Constants
28
+
29
+ Import Node.js and package manager constants:
30
+
31
+ ```typescript
32
+ import {
33
+ NODE_MODULES,
34
+ PACKAGE_JSON,
35
+ PNPM_LOCK_YAML,
36
+ NPM_REGISTRY_URL,
37
+ } from '@socketsecurity/lib/constants/packages'
38
+ ```
39
+
40
+ ### Environment Variables
41
+
42
+ Access typed environment variables:
43
+
44
+ ```typescript
45
+ import { getEnv } from '@socketsecurity/lib/env/getters'
46
+ import { NODE_ENV } from '@socketsecurity/lib/env/node-env'
47
+
48
+ const env = getEnv('NODE_ENV')
49
+ console.log(NODE_ENV) // 'production' | 'development' | 'test'
50
+ ```
51
+
52
+ For a complete list of available modules, see the [package.json exports](./package.json).
53
+
54
+ ## Type Definitions
55
+
56
+ All types are exported for TypeScript projects:
57
+
58
+ ```typescript
59
+ import type {
60
+ PackageJson,
61
+ TsConfig,
62
+ LockFile,
63
+ } from '@socketsecurity/lib/types'
64
+ ```
65
+
66
+ ## Utilities
67
+
68
+ Access utility modules for common operations:
69
+
70
+ ```typescript
71
+ // File system utilities
72
+ import { readJsonFile, writeJsonFile } from '@socketsecurity/lib/fs'
73
+
74
+ // Package utilities
75
+ import { parsePackageSpec } from '@socketsecurity/lib/packages'
76
+
77
+ // Path utilities
78
+ import { normalizePath } from '@socketsecurity/lib/paths'
79
+
80
+ // And many more...
81
+ ```
82
+
83
+ See the [exports map](./package.json) for all available utility modules.
6
84
 
7
85
  ## License
8
86
 
@@ -0,0 +1,28 @@
1
+ {
2
+ "npm": [
3
+ [
4
+ "pkg:npm/%40socketregistry/packageurl-js@latest",
5
+ {
6
+ "categories": ["levelup"],
7
+ "engines": { "node": ">=18" },
8
+ "interop": ["cjs"],
9
+ "license": "MIT",
10
+ "name": "@socketregistry/packageurl-js",
11
+ "package": "packageurl-js",
12
+ "version": "latest"
13
+ }
14
+ ],
15
+ [
16
+ "pkg:npm/shell-quote@latest",
17
+ {
18
+ "categories": ["tuneup"],
19
+ "engines": { "node": ">=18" },
20
+ "interop": ["cjs"],
21
+ "license": "MIT",
22
+ "name": "shell-quote",
23
+ "package": "shell-quote",
24
+ "version": "latest"
25
+ }
26
+ ]
27
+ ]
28
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @fileoverview Abort signal utilities.
3
+ */
4
+ /**
5
+ * Create a composite AbortSignal from multiple signals.
6
+ */
7
+ export declare function createCompositeAbortSignal(...signals: Array<AbortSignal | null | undefined>): AbortSignal;
8
+ /**
9
+ * Create an AbortSignal that triggers after a timeout.
10
+ */
11
+ export declare function createTimeoutSignal(ms: number): AbortSignal;
package/dist/abort.js ADDED
@@ -0,0 +1,62 @@
1
+ /* Socket Lib - Built with esbuild */
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var abort_exports = {};
20
+ __export(abort_exports, {
21
+ createCompositeAbortSignal: () => createCompositeAbortSignal,
22
+ createTimeoutSignal: () => createTimeoutSignal
23
+ });
24
+ module.exports = __toCommonJS(abort_exports);
25
+ function createCompositeAbortSignal(...signals) {
26
+ const validSignals = signals.filter((s) => s != null);
27
+ if (validSignals.length === 0) {
28
+ return new AbortController().signal;
29
+ }
30
+ if (validSignals.length === 1) {
31
+ return validSignals[0];
32
+ }
33
+ const controller = new AbortController();
34
+ for (const signal of validSignals) {
35
+ if (signal.aborted) {
36
+ controller.abort();
37
+ return controller.signal;
38
+ }
39
+ signal.addEventListener("abort", () => controller.abort(), { once: true });
40
+ }
41
+ return controller.signal;
42
+ }
43
+ function createTimeoutSignal(ms) {
44
+ if (typeof ms !== "number" || Number.isNaN(ms)) {
45
+ throw new TypeError("timeout must be a number");
46
+ }
47
+ if (!Number.isFinite(ms)) {
48
+ throw new TypeError("timeout must be a finite number");
49
+ }
50
+ if (ms <= 0) {
51
+ throw new TypeError("timeout must be a positive number");
52
+ }
53
+ const controller = new AbortController();
54
+ setTimeout(() => controller.abort(), ms);
55
+ return controller.signal;
56
+ }
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {
59
+ createCompositeAbortSignal,
60
+ createTimeoutSignal
61
+ });
62
+ //# sourceMappingURL=abort.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/abort.ts"],
4
+ "sourcesContent": ["/**\n * @fileoverview Abort signal utilities.\n */\n\n/**\n * Create a composite AbortSignal from multiple signals.\n */\nexport function createCompositeAbortSignal(\n ...signals: Array<AbortSignal | null | undefined>\n): AbortSignal {\n const validSignals = signals.filter(s => s != null) as AbortSignal[]\n\n if (validSignals.length === 0) {\n return new AbortController().signal\n }\n\n if (validSignals.length === 1) {\n // biome-ignore lint/style/noNonNullAssertion: Length check ensures array has exactly one element.\n return validSignals[0]!\n }\n\n const controller = new AbortController()\n\n for (const signal of validSignals) {\n if (signal.aborted) {\n controller.abort()\n return controller.signal\n }\n signal.addEventListener('abort', () => controller.abort(), { once: true })\n }\n\n return controller.signal\n}\n\n/**\n * Create an AbortSignal that triggers after a timeout.\n */\nexport function createTimeoutSignal(ms: number): AbortSignal {\n if (typeof ms !== 'number' || Number.isNaN(ms)) {\n throw new TypeError('timeout must be a number')\n }\n if (!Number.isFinite(ms)) {\n throw new TypeError('timeout must be a finite number')\n }\n if (ms <= 0) {\n throw new TypeError('timeout must be a positive number')\n }\n const controller = new AbortController()\n setTimeout(() => controller.abort(), ms)\n return controller.signal\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,SAAS,8BACX,SACU;AACb,QAAM,eAAe,QAAQ,OAAO,OAAK,KAAK,IAAI;AAElD,MAAI,aAAa,WAAW,GAAG;AAC7B,WAAO,IAAI,gBAAgB,EAAE;AAAA,EAC/B;AAEA,MAAI,aAAa,WAAW,GAAG;AAE7B,WAAO,aAAa,CAAC;AAAA,EACvB;AAEA,QAAM,aAAa,IAAI,gBAAgB;AAEvC,aAAW,UAAU,cAAc;AACjC,QAAI,OAAO,SAAS;AAClB,iBAAW,MAAM;AACjB,aAAO,WAAW;AAAA,IACpB;AACA,WAAO,iBAAiB,SAAS,MAAM,WAAW,MAAM,GAAG,EAAE,MAAM,KAAK,CAAC;AAAA,EAC3E;AAEA,SAAO,WAAW;AACpB;AAKO,SAAS,oBAAoB,IAAyB;AAC3D,MAAI,OAAO,OAAO,YAAY,OAAO,MAAM,EAAE,GAAG;AAC9C,UAAM,IAAI,UAAU,0BAA0B;AAAA,EAChD;AACA,MAAI,CAAC,OAAO,SAAS,EAAE,GAAG;AACxB,UAAM,IAAI,UAAU,iCAAiC;AAAA,EACvD;AACA,MAAI,MAAM,GAAG;AACX,UAAM,IAAI,UAAU,mCAAmC;AAAA,EACzD;AACA,QAAM,aAAa,IAAI,gBAAgB;AACvC,aAAW,MAAM,WAAW,MAAM,GAAG,EAAE;AACvC,SAAO,WAAW;AACpB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,102 @@
1
+ import type { SpawnOptions } from './spawn';
2
+ /**
3
+ * Execute npm commands with optimized flags and settings.
4
+ *
5
+ * SECURITY: Uses array-based arguments to prevent command injection. All elements
6
+ * in the args array are properly escaped by Node.js when passed to spawn().
7
+ */
8
+ /*@__NO_SIDE_EFFECTS__*/
9
+ export declare function execNpm(args: string[], options?: SpawnOptions | undefined): import("./spawn").PromiseSpawnResult;
10
+ export interface PnpmOptions extends SpawnOptions {
11
+ allowLockfileUpdate?: boolean;
12
+ }
13
+ /**
14
+ * Execute pnpm commands with optimized flags and settings.
15
+ *
16
+ * SECURITY: Uses array-based arguments to prevent command injection. All elements
17
+ * in the args array are properly escaped by Node.js when passed to execBin().
18
+ */
19
+ /*@__NO_SIDE_EFFECTS__*/
20
+ export declare function execPnpm(args: string[], options?: PnpmOptions | undefined): Promise<{
21
+ cmd: string;
22
+ args: string[] | readonly string[];
23
+ code: number;
24
+ signal: NodeJS.Signals;
25
+ stdout: string | Buffer<ArrayBufferLike>;
26
+ stderr: string | Buffer<ArrayBufferLike>;
27
+ }>;
28
+ /**
29
+ * Execute yarn commands with optimized flags and settings.
30
+ *
31
+ * SECURITY: Uses array-based arguments to prevent command injection. All elements
32
+ * in the args array are properly escaped by Node.js when passed to execBin().
33
+ */
34
+ /*@__NO_SIDE_EFFECTS__*/
35
+ export declare function execYarn(args: string[], options?: import('./spawn').SpawnOptions): Promise<{
36
+ cmd: string;
37
+ args: string[] | readonly string[];
38
+ code: number;
39
+ signal: NodeJS.Signals;
40
+ stdout: string | Buffer<ArrayBufferLike>;
41
+ stderr: string | Buffer<ArrayBufferLike>;
42
+ }>;
43
+ /**
44
+ * Check if a command argument is an npm audit flag.
45
+ */
46
+ /*@__NO_SIDE_EFFECTS__*/
47
+ export declare function isNpmAuditFlag(cmdArg: string): boolean;
48
+ /**
49
+ * Check if a command argument is an npm fund flag.
50
+ */
51
+ /*@__NO_SIDE_EFFECTS__*/
52
+ export declare function isNpmFundFlag(cmdArg: string): boolean;
53
+ /**
54
+ * Check if a command argument is an npm loglevel flag.
55
+ */
56
+ /*@__NO_SIDE_EFFECTS__*/
57
+ export declare function isNpmLoglevelFlag(cmdArg: string): boolean;
58
+ /**
59
+ * Check if a command argument is an npm node-options flag.
60
+ */
61
+ /*@__NO_SIDE_EFFECTS__*/
62
+ export declare function isNpmNodeOptionsFlag(cmdArg: string): boolean;
63
+ /**
64
+ * Check if a command argument is an npm progress flag.
65
+ */
66
+ /*@__NO_SIDE_EFFECTS__*/
67
+ export declare function isNpmProgressFlag(cmdArg: string): boolean;
68
+ /**
69
+ * Check if a command argument is a pnpm ignore-scripts flag.
70
+ */
71
+ /*@__NO_SIDE_EFFECTS__*/
72
+ export declare function isPnpmIgnoreScriptsFlag(cmdArg: string): boolean;
73
+ /**
74
+ * Check if a command argument is a pnpm frozen-lockfile flag.
75
+ */
76
+ /*@__NO_SIDE_EFFECTS__*/
77
+ export declare function isPnpmFrozenLockfileFlag(cmdArg: string): boolean;
78
+ /**
79
+ * Check if a command argument is a pnpm install command.
80
+ */
81
+ /*@__NO_SIDE_EFFECTS__*/
82
+ export declare function isPnpmInstallCommand(cmdArg: string): boolean;
83
+ /**
84
+ * Alias for isNpmLoglevelFlag for pnpm usage.
85
+ */
86
+ export declare const isPnpmLoglevelFlag: typeof isNpmLoglevelFlag;
87
+ /**
88
+ * Execute a package.json script using the appropriate package manager.
89
+ * Automatically detects pnpm, yarn, or npm based on lockfiles.
90
+ */
91
+ export interface ExecScriptOptions extends SpawnOptions {
92
+ prepost?: boolean | undefined;
93
+ }
94
+ /*@__NO_SIDE_EFFECTS__*/
95
+ export declare function execScript(scriptName: string, args?: string[] | readonly string[] | ExecScriptOptions | undefined, options?: ExecScriptOptions | undefined): Promise<{
96
+ cmd: string;
97
+ args: string[] | readonly string[];
98
+ code: number;
99
+ signal: NodeJS.Signals;
100
+ stdout: string | Buffer<ArrayBufferLike>;
101
+ stderr: string | Buffer<ArrayBufferLike>;
102
+ }>;