@mnaoumov/typescript-dev-toolkit 0.0.0 → 1.1.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 (332) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -1
  3. package/bundlers/esbuild-impl/change-extension-plugin/package.json +6 -0
  4. package/bundlers/esbuild-impl/custom-esbuild-options-plugin/package.json +6 -0
  5. package/bundlers/esbuild-impl/fix-esm-plugin/package.json +6 -0
  6. package/bundlers/esbuild-impl/index/package.json +6 -0
  7. package/bundlers/esbuild-impl/package.json +6 -0
  8. package/bundlers/esbuild-impl/preprocess-plugin/package.json +6 -0
  9. package/bundlers/esbuild-impl/svelte-wrapper-plugin/package.json +6 -0
  10. package/bundlers/index/package.json +6 -0
  11. package/bundlers/package.json +6 -0
  12. package/dist/lib/cjs/build.cjs +191 -0
  13. package/dist/lib/cjs/build.d.cts +59 -0
  14. package/dist/lib/cjs/bundlers/esbuild-impl/change-extension-plugin.cjs +139 -0
  15. package/dist/lib/cjs/bundlers/esbuild-impl/change-extension-plugin.d.cts +25 -0
  16. package/dist/lib/cjs/bundlers/esbuild-impl/custom-esbuild-options-plugin.cjs +96 -0
  17. package/dist/lib/cjs/bundlers/esbuild-impl/custom-esbuild-options-plugin.d.cts +14 -0
  18. package/dist/lib/cjs/bundlers/esbuild-impl/fix-esm-plugin.cjs +106 -0
  19. package/dist/lib/cjs/bundlers/esbuild-impl/fix-esm-plugin.d.cts +13 -0
  20. package/dist/lib/cjs/bundlers/esbuild-impl/index.cjs +111 -0
  21. package/dist/lib/cjs/bundlers/esbuild-impl/index.d.cts +6 -0
  22. package/dist/lib/cjs/bundlers/esbuild-impl/preprocess-plugin.cjs +211 -0
  23. package/dist/lib/cjs/bundlers/esbuild-impl/preprocess-plugin.d.cts +143 -0
  24. package/dist/lib/cjs/bundlers/esbuild-impl/svelte-wrapper-plugin.cjs +129 -0
  25. package/dist/lib/cjs/bundlers/esbuild-impl/svelte-wrapper-plugin.d.cts +14 -0
  26. package/dist/lib/cjs/bundlers/index.cjs +99 -0
  27. package/dist/lib/cjs/bundlers/index.d.cts +2 -0
  28. package/dist/lib/cjs/check-project-types.cjs +163 -0
  29. package/dist/lib/cjs/check-project-types.d.cts +92 -0
  30. package/dist/lib/cjs/cli-utils.cjs +276 -0
  31. package/dist/lib/cjs/cli-utils.d.cts +123 -0
  32. package/dist/lib/cjs/code-generator.cjs +96 -0
  33. package/dist/lib/cjs/code-generator.d.cts +14 -0
  34. package/dist/lib/cjs/commitlint-config.cjs +110 -0
  35. package/dist/lib/cjs/commitlint-config.d.cts +14 -0
  36. package/dist/lib/cjs/commitlint-forbidden-patterns.cjs +110 -0
  37. package/dist/lib/cjs/commitlint-forbidden-patterns.d.cts +37 -0
  38. package/dist/lib/cjs/commitlint-spellcheck-header.cjs +126 -0
  39. package/dist/lib/cjs/commitlint-spellcheck-header.d.cts +40 -0
  40. package/dist/lib/cjs/env-toggle.cjs +133 -0
  41. package/dist/lib/cjs/env-toggle.d.cts +42 -0
  42. package/dist/lib/cjs/exec.cjs +455 -0
  43. package/dist/lib/cjs/exec.d.cts +162 -0
  44. package/dist/lib/cjs/forbidden-patterns.cjs +157 -0
  45. package/dist/lib/cjs/forbidden-patterns.d.cts +57 -0
  46. package/dist/lib/cjs/formatters/dprint.cjs +108 -0
  47. package/dist/lib/cjs/formatters/dprint.d.cts +33 -0
  48. package/dist/lib/cjs/formatters/index.cjs +99 -0
  49. package/dist/lib/cjs/formatters/index.d.cts +2 -0
  50. package/dist/lib/cjs/fs.cjs +123 -0
  51. package/dist/lib/cjs/fs.d.cts +80 -0
  52. package/dist/lib/cjs/gate.cjs +140 -0
  53. package/dist/lib/cjs/gate.d.cts +93 -0
  54. package/dist/lib/cjs/git.cjs +109 -0
  55. package/dist/lib/cjs/git.d.cts +37 -0
  56. package/dist/lib/cjs/index.cjs +186 -0
  57. package/dist/lib/cjs/index.d.cts +35 -0
  58. package/dist/lib/cjs/json.cjs +141 -0
  59. package/dist/lib/cjs/json.d.cts +102 -0
  60. package/dist/lib/cjs/library-build.cjs +483 -0
  61. package/dist/lib/cjs/library-build.d.cts +101 -0
  62. package/dist/lib/cjs/library-references.d.cts +5 -0
  63. package/dist/lib/cjs/linters/cspell-content.cjs +124 -0
  64. package/dist/lib/cjs/linters/cspell-content.d.cts +46 -0
  65. package/dist/lib/cjs/linters/cspell.cjs +103 -0
  66. package/dist/lib/cjs/linters/cspell.d.cts +36 -0
  67. package/dist/lib/cjs/linters/eslint-agnostic-core-boundary.cjs +94 -0
  68. package/dist/lib/cjs/linters/eslint-agnostic-core-boundary.d.cts +49 -0
  69. package/dist/lib/cjs/linters/eslint-config.cjs +1068 -0
  70. package/dist/lib/cjs/linters/eslint-config.d.cts +123 -0
  71. package/dist/lib/cjs/linters/eslint-no-restricted-syntax.cjs +130 -0
  72. package/dist/lib/cjs/linters/eslint-no-restricted-syntax.d.cts +27 -0
  73. package/dist/lib/cjs/linters/eslint-rules/in-house-plugin.cjs +116 -0
  74. package/dist/lib/cjs/linters/eslint-rules/in-house-plugin.d.cts +26 -0
  75. package/dist/lib/cjs/linters/eslint-rules/index.cjs +132 -0
  76. package/dist/lib/cjs/linters/eslint-rules/index.d.cts +13 -0
  77. package/dist/lib/cjs/linters/eslint-rules/no-async-callback-to-unsafe-return.cjs +175 -0
  78. package/dist/lib/cjs/linters/eslint-rules/no-async-callback-to-unsafe-return.d.cts +10 -0
  79. package/dist/lib/cjs/linters/eslint-rules/no-unresolved-jsdoc-link.cjs +290 -0
  80. package/dist/lib/cjs/linters/eslint-rules/no-unresolved-jsdoc-link.d.cts +10 -0
  81. package/dist/lib/cjs/linters/eslint-rules/no-unused-params-members.cjs +265 -0
  82. package/dist/lib/cjs/linters/eslint-rules/no-unused-params-members.d.cts +41 -0
  83. package/dist/lib/cjs/linters/eslint-rules/no-used-underscore-variables.cjs +134 -0
  84. package/dist/lib/cjs/linters/eslint-rules/no-used-underscore-variables.d.cts +20 -0
  85. package/dist/lib/cjs/linters/eslint-rules/params-options-name-match.cjs +217 -0
  86. package/dist/lib/cjs/linters/eslint-rules/params-options-name-match.d.cts +36 -0
  87. package/dist/lib/cjs/linters/eslint-rules/prefer-noop-async.cjs +126 -0
  88. package/dist/lib/cjs/linters/eslint-rules/prefer-noop-async.d.cts +10 -0
  89. package/dist/lib/cjs/linters/eslint-rules/readonly-params-options-result-members.cjs +125 -0
  90. package/dist/lib/cjs/linters/eslint-rules/readonly-params-options-result-members.d.cts +20 -0
  91. package/dist/lib/cjs/linters/eslint-rules/require-method-template.cjs +181 -0
  92. package/dist/lib/cjs/linters/eslint-rules/require-method-template.d.cts +14 -0
  93. package/dist/lib/cjs/linters/eslint-rules/require-super-call.cjs +217 -0
  94. package/dist/lib/cjs/linters/eslint-rules/require-super-call.d.cts +10 -0
  95. package/dist/lib/cjs/linters/eslint-rules/rule-tester-helper.cjs +92 -0
  96. package/dist/lib/cjs/linters/eslint-rules/rule-tester-helper.d.cts +18 -0
  97. package/dist/lib/cjs/linters/eslint-rules/ts-estree-node.cjs +92 -0
  98. package/dist/lib/cjs/linters/eslint-rules/ts-estree-node.d.cts +23 -0
  99. package/dist/lib/cjs/linters/eslint-types/@types/@eslint-community__eslint-plugin-eslint-comments__configs.d.cts +20 -0
  100. package/dist/lib/cjs/linters/eslint-types/@types/eslint-plugin-verify-tsdoc.d.cts +17 -0
  101. package/dist/lib/cjs/linters/eslint.cjs +196 -0
  102. package/dist/lib/cjs/linters/eslint.d.cts +74 -0
  103. package/dist/lib/cjs/linters/index.cjs +138 -0
  104. package/dist/lib/cjs/linters/index.d.cts +15 -0
  105. package/dist/lib/cjs/linters/lint-ignores.cjs +91 -0
  106. package/dist/lib/cjs/linters/lint-ignores.d.cts +30 -0
  107. package/dist/lib/cjs/linters/markdownlint-cli2-config.cjs +169 -0
  108. package/dist/lib/cjs/linters/markdownlint-cli2-config.d.cts +11 -0
  109. package/dist/lib/cjs/linters/markdownlint-content.cjs +120 -0
  110. package/dist/lib/cjs/linters/markdownlint-content.d.cts +47 -0
  111. package/dist/lib/cjs/linters/markdownlint-ignores.cjs +95 -0
  112. package/dist/lib/cjs/linters/markdownlint-ignores.d.cts +35 -0
  113. package/dist/lib/cjs/linters/markdownlint-rules/index.cjs +99 -0
  114. package/dist/lib/cjs/linters/markdownlint-rules/index.d.cts +2 -0
  115. package/dist/lib/cjs/linters/markdownlint-rules/no-soft-break-in-paragraph.cjs +152 -0
  116. package/dist/lib/cjs/linters/markdownlint-rules/no-soft-break-in-paragraph.d.cts +35 -0
  117. package/dist/lib/cjs/linters/markdownlint-types/@types/markdownlint-cli2-config-schema.d.cts +1344 -0
  118. package/dist/lib/cjs/linters/markdownlint-types/@types/markdownlint-cli2.d.cts +67 -0
  119. package/dist/lib/cjs/linters/markdownlint.cjs +151 -0
  120. package/dist/lib/cjs/linters/markdownlint.d.cts +32 -0
  121. package/dist/lib/cjs/linters/over-exposure.cjs +685 -0
  122. package/dist/lib/cjs/linters/over-exposure.d.cts +357 -0
  123. package/dist/lib/cjs/nano-staged-config.cjs +148 -0
  124. package/dist/lib/cjs/nano-staged-config.d.cts +54 -0
  125. package/dist/lib/cjs/npm-publish.cjs +93 -0
  126. package/dist/lib/cjs/npm-publish.d.cts +19 -0
  127. package/dist/lib/cjs/npm-run.cjs +120 -0
  128. package/dist/lib/cjs/npm-run.d.cts +34 -0
  129. package/dist/lib/cjs/npm.cjs +200 -0
  130. package/dist/lib/cjs/npm.d.cts +168 -0
  131. package/dist/lib/cjs/package-lock-integrity.cjs +134 -0
  132. package/dist/lib/cjs/package-lock-integrity.d.cts +38 -0
  133. package/dist/lib/cjs/package-manager.cjs +291 -0
  134. package/dist/lib/cjs/package-manager.d.cts +93 -0
  135. package/dist/lib/cjs/released-issues.cjs +178 -0
  136. package/dist/lib/cjs/released-issues.d.cts +79 -0
  137. package/dist/lib/cjs/repo-paths.cjs +167 -0
  138. package/dist/lib/cjs/repo-paths.d.cts +318 -0
  139. package/dist/lib/cjs/root.cjs +150 -0
  140. package/dist/lib/cjs/root.d.cts +107 -0
  141. package/dist/lib/cjs/test-runners/index.cjs +102 -0
  142. package/dist/lib/cjs/test-runners/index.d.cts +3 -0
  143. package/dist/lib/cjs/test-runners/vitest-config.cjs +126 -0
  144. package/dist/lib/cjs/test-runners/vitest-config.d.cts +90 -0
  145. package/dist/lib/cjs/test-runners/vitest.cjs +115 -0
  146. package/dist/lib/cjs/test-runners/vitest.d.cts +52 -0
  147. package/dist/lib/cjs/validate-declarations.cjs +120 -0
  148. package/dist/lib/cjs/validate-declarations.d.cts +37 -0
  149. package/dist/lib/cjs/version.cjs +758 -0
  150. package/dist/lib/cjs/version.d.cts +418 -0
  151. package/dist/lib/esm/build.d.mts +59 -0
  152. package/dist/lib/esm/build.mjs +165 -0
  153. package/dist/lib/esm/bundlers/esbuild-impl/change-extension-plugin.d.mts +25 -0
  154. package/dist/lib/esm/bundlers/esbuild-impl/change-extension-plugin.mjs +101 -0
  155. package/dist/lib/esm/bundlers/esbuild-impl/custom-esbuild-options-plugin.d.mts +14 -0
  156. package/dist/lib/esm/bundlers/esbuild-impl/custom-esbuild-options-plugin.mjs +59 -0
  157. package/dist/lib/esm/bundlers/esbuild-impl/fix-esm-plugin.d.mts +13 -0
  158. package/dist/lib/esm/bundlers/esbuild-impl/fix-esm-plugin.mjs +69 -0
  159. package/dist/lib/esm/bundlers/esbuild-impl/index.d.mts +6 -0
  160. package/dist/lib/esm/bundlers/esbuild-impl/index.mjs +60 -0
  161. package/dist/lib/esm/bundlers/esbuild-impl/preprocess-plugin.d.mts +143 -0
  162. package/dist/lib/esm/bundlers/esbuild-impl/preprocess-plugin.mjs +176 -0
  163. package/dist/lib/esm/bundlers/esbuild-impl/svelte-wrapper-plugin.d.mts +14 -0
  164. package/dist/lib/esm/bundlers/esbuild-impl/svelte-wrapper-plugin.mjs +82 -0
  165. package/dist/lib/esm/bundlers/index.d.mts +2 -0
  166. package/dist/lib/esm/bundlers/index.mjs +52 -0
  167. package/dist/lib/esm/check-project-types.d.mts +92 -0
  168. package/dist/lib/esm/check-project-types.mjs +123 -0
  169. package/dist/lib/esm/cli-utils.d.mts +123 -0
  170. package/dist/lib/esm/cli-utils.mjs +225 -0
  171. package/dist/lib/esm/code-generator.d.mts +14 -0
  172. package/dist/lib/esm/code-generator.mjs +59 -0
  173. package/dist/lib/esm/commitlint-config.d.mts +14 -0
  174. package/dist/lib/esm/commitlint-config.mjs +79 -0
  175. package/dist/lib/esm/commitlint-forbidden-patterns.d.mts +37 -0
  176. package/dist/lib/esm/commitlint-forbidden-patterns.mjs +75 -0
  177. package/dist/lib/esm/commitlint-spellcheck-header.d.mts +40 -0
  178. package/dist/lib/esm/commitlint-spellcheck-header.mjs +87 -0
  179. package/dist/lib/esm/env-toggle.d.mts +42 -0
  180. package/dist/lib/esm/env-toggle.mjs +84 -0
  181. package/dist/lib/esm/exec.d.mts +162 -0
  182. package/dist/lib/esm/exec.mjs +410 -0
  183. package/dist/lib/esm/forbidden-patterns.d.mts +57 -0
  184. package/dist/lib/esm/forbidden-patterns.mjs +108 -0
  185. package/dist/lib/esm/formatters/dprint.d.mts +33 -0
  186. package/dist/lib/esm/formatters/dprint.mjs +75 -0
  187. package/dist/lib/esm/formatters/index.d.mts +2 -0
  188. package/dist/lib/esm/formatters/index.mjs +52 -0
  189. package/dist/lib/esm/fs.d.mts +80 -0
  190. package/dist/lib/esm/fs.mjs +89 -0
  191. package/dist/lib/esm/gate.d.mts +93 -0
  192. package/dist/lib/esm/gate.mjs +106 -0
  193. package/dist/lib/esm/git.d.mts +37 -0
  194. package/dist/lib/esm/git.mjs +72 -0
  195. package/dist/lib/esm/index.d.mts +35 -0
  196. package/dist/lib/esm/index.mjs +110 -0
  197. package/dist/lib/esm/json.d.mts +102 -0
  198. package/dist/lib/esm/json.mjs +106 -0
  199. package/dist/lib/esm/library-build.d.mts +101 -0
  200. package/dist/lib/esm/library-build.mjs +443 -0
  201. package/dist/lib/esm/library-references.d.mts +5 -0
  202. package/dist/lib/esm/linters/cspell-content.d.mts +46 -0
  203. package/dist/lib/esm/linters/cspell-content.mjs +87 -0
  204. package/dist/lib/esm/linters/cspell.d.mts +36 -0
  205. package/dist/lib/esm/linters/cspell.mjs +69 -0
  206. package/dist/lib/esm/linters/eslint-agnostic-core-boundary.d.mts +49 -0
  207. package/dist/lib/esm/linters/eslint-agnostic-core-boundary.mjs +57 -0
  208. package/dist/lib/esm/linters/eslint-config.d.mts +123 -0
  209. package/dist/lib/esm/linters/eslint-config.mjs +1022 -0
  210. package/dist/lib/esm/linters/eslint-no-restricted-syntax.d.mts +27 -0
  211. package/dist/lib/esm/linters/eslint-no-restricted-syntax.mjs +93 -0
  212. package/dist/lib/esm/linters/eslint-rules/in-house-plugin.d.mts +26 -0
  213. package/dist/lib/esm/linters/eslint-rules/in-house-plugin.mjs +77 -0
  214. package/dist/lib/esm/linters/eslint-rules/index.d.mts +13 -0
  215. package/dist/lib/esm/linters/eslint-rules/index.mjs +74 -0
  216. package/dist/lib/esm/linters/eslint-rules/no-async-callback-to-unsafe-return.d.mts +10 -0
  217. package/dist/lib/esm/linters/eslint-rules/no-async-callback-to-unsafe-return.mjs +144 -0
  218. package/dist/lib/esm/linters/eslint-rules/no-unresolved-jsdoc-link.d.mts +10 -0
  219. package/dist/lib/esm/linters/eslint-rules/no-unresolved-jsdoc-link.mjs +277 -0
  220. package/dist/lib/esm/linters/eslint-rules/no-unused-params-members.d.mts +41 -0
  221. package/dist/lib/esm/linters/eslint-rules/no-unused-params-members.mjs +227 -0
  222. package/dist/lib/esm/linters/eslint-rules/no-used-underscore-variables.d.mts +20 -0
  223. package/dist/lib/esm/linters/eslint-rules/no-used-underscore-variables.mjs +96 -0
  224. package/dist/lib/esm/linters/eslint-rules/params-options-name-match.d.mts +36 -0
  225. package/dist/lib/esm/linters/eslint-rules/params-options-name-match.mjs +179 -0
  226. package/dist/lib/esm/linters/eslint-rules/prefer-noop-async.d.mts +10 -0
  227. package/dist/lib/esm/linters/eslint-rules/prefer-noop-async.mjs +88 -0
  228. package/dist/lib/esm/linters/eslint-rules/readonly-params-options-result-members.d.mts +20 -0
  229. package/dist/lib/esm/linters/eslint-rules/readonly-params-options-result-members.mjs +87 -0
  230. package/dist/lib/esm/linters/eslint-rules/require-method-template.d.mts +14 -0
  231. package/dist/lib/esm/linters/eslint-rules/require-method-template.mjs +142 -0
  232. package/dist/lib/esm/linters/eslint-rules/require-super-call.d.mts +10 -0
  233. package/dist/lib/esm/linters/eslint-rules/require-super-call.mjs +183 -0
  234. package/dist/lib/esm/linters/eslint-rules/rule-tester-helper.d.mts +18 -0
  235. package/dist/lib/esm/linters/eslint-rules/rule-tester-helper.mjs +55 -0
  236. package/dist/lib/esm/linters/eslint-rules/ts-estree-node.d.mts +23 -0
  237. package/dist/lib/esm/linters/eslint-rules/ts-estree-node.mjs +55 -0
  238. package/dist/lib/esm/linters/eslint-types/@types/@eslint-community__eslint-plugin-eslint-comments__configs.d.mts +20 -0
  239. package/dist/lib/esm/linters/eslint-types/@types/eslint-plugin-verify-tsdoc.d.mts +17 -0
  240. package/dist/lib/esm/linters/eslint.d.mts +74 -0
  241. package/dist/lib/esm/linters/eslint.mjs +159 -0
  242. package/dist/lib/esm/linters/index.d.mts +15 -0
  243. package/dist/lib/esm/linters/index.mjs +78 -0
  244. package/dist/lib/esm/linters/lint-ignores.d.mts +30 -0
  245. package/dist/lib/esm/linters/lint-ignores.mjs +54 -0
  246. package/dist/lib/esm/linters/markdownlint-cli2-config.d.mts +11 -0
  247. package/dist/lib/esm/linters/markdownlint-cli2-config.mjs +122 -0
  248. package/dist/lib/esm/linters/markdownlint-content.d.mts +47 -0
  249. package/dist/lib/esm/linters/markdownlint-content.mjs +83 -0
  250. package/dist/lib/esm/linters/markdownlint-ignores.d.mts +35 -0
  251. package/dist/lib/esm/linters/markdownlint-ignores.mjs +57 -0
  252. package/dist/lib/esm/linters/markdownlint-rules/index.d.mts +2 -0
  253. package/dist/lib/esm/linters/markdownlint-rules/index.mjs +52 -0
  254. package/dist/lib/esm/linters/markdownlint-rules/no-soft-break-in-paragraph.d.mts +35 -0
  255. package/dist/lib/esm/linters/markdownlint-rules/no-soft-break-in-paragraph.mjs +114 -0
  256. package/dist/lib/esm/linters/markdownlint-types/@types/markdownlint-cli2-config-schema.d.mts +1344 -0
  257. package/dist/lib/esm/linters/markdownlint-types/@types/markdownlint-cli2.d.mts +67 -0
  258. package/dist/lib/esm/linters/markdownlint.d.mts +32 -0
  259. package/dist/lib/esm/linters/markdownlint.mjs +124 -0
  260. package/dist/lib/esm/linters/over-exposure.d.mts +357 -0
  261. package/dist/lib/esm/linters/over-exposure.mjs +672 -0
  262. package/dist/lib/esm/nano-staged-config.d.mts +54 -0
  263. package/dist/lib/esm/nano-staged-config.mjs +103 -0
  264. package/dist/lib/esm/npm-publish.d.mts +19 -0
  265. package/dist/lib/esm/npm-publish.mjs +56 -0
  266. package/dist/lib/esm/npm-run.d.mts +34 -0
  267. package/dist/lib/esm/npm-run.mjs +81 -0
  268. package/dist/lib/esm/npm.d.mts +168 -0
  269. package/dist/lib/esm/npm.mjs +155 -0
  270. package/dist/lib/esm/package-lock-integrity.d.mts +38 -0
  271. package/dist/lib/esm/package-lock-integrity.mjs +99 -0
  272. package/dist/lib/esm/package-manager.d.mts +93 -0
  273. package/dist/lib/esm/package-manager.mjs +245 -0
  274. package/dist/lib/esm/released-issues.d.mts +79 -0
  275. package/dist/lib/esm/released-issues.mjs +143 -0
  276. package/dist/lib/esm/repo-paths.d.mts +318 -0
  277. package/dist/lib/esm/repo-paths.mjs +130 -0
  278. package/dist/lib/esm/root.d.mts +107 -0
  279. package/dist/lib/esm/root.mjs +115 -0
  280. package/dist/lib/esm/test-runners/index.d.mts +3 -0
  281. package/dist/lib/esm/test-runners/index.mjs +54 -0
  282. package/dist/lib/esm/test-runners/vitest-config.d.mts +90 -0
  283. package/dist/lib/esm/test-runners/vitest-config.mjs +86 -0
  284. package/dist/lib/esm/test-runners/vitest.d.mts +52 -0
  285. package/dist/lib/esm/test-runners/vitest.mjs +76 -0
  286. package/dist/lib/esm/validate-declarations.d.mts +37 -0
  287. package/dist/lib/esm/validate-declarations.mjs +87 -0
  288. package/dist/lib/esm/version.d.mts +418 -0
  289. package/dist/lib/esm/version.mjs +723 -0
  290. package/formatters/dprint/package.json +6 -0
  291. package/formatters/index/package.json +6 -0
  292. package/formatters/package.json +6 -0
  293. package/linters/cspell/package.json +6 -0
  294. package/linters/cspell-content/package.json +6 -0
  295. package/linters/eslint/package.json +6 -0
  296. package/linters/eslint-agnostic-core-boundary/package.json +6 -0
  297. package/linters/eslint-config/package.json +6 -0
  298. package/linters/eslint-no-restricted-syntax/package.json +6 -0
  299. package/linters/eslint-rules/in-house-plugin/package.json +6 -0
  300. package/linters/eslint-rules/index/package.json +6 -0
  301. package/linters/eslint-rules/no-async-callback-to-unsafe-return/package.json +6 -0
  302. package/linters/eslint-rules/no-unresolved-jsdoc-link/package.json +6 -0
  303. package/linters/eslint-rules/no-unused-params-members/package.json +6 -0
  304. package/linters/eslint-rules/no-used-underscore-variables/package.json +6 -0
  305. package/linters/eslint-rules/package.json +6 -0
  306. package/linters/eslint-rules/params-options-name-match/package.json +6 -0
  307. package/linters/eslint-rules/prefer-noop-async/package.json +6 -0
  308. package/linters/eslint-rules/readonly-params-options-result-members/package.json +6 -0
  309. package/linters/eslint-rules/require-method-template/package.json +6 -0
  310. package/linters/eslint-rules/require-super-call/package.json +6 -0
  311. package/linters/eslint-rules/rule-tester-helper/package.json +6 -0
  312. package/linters/eslint-rules/ts-estree-node/package.json +6 -0
  313. package/linters/eslint-types/@types/@eslint-community__eslint-plugin-eslint-comments__configs/package.json +4 -0
  314. package/linters/eslint-types/@types/eslint-plugin-verify-tsdoc/package.json +4 -0
  315. package/linters/index/package.json +6 -0
  316. package/linters/lint-ignores/package.json +6 -0
  317. package/linters/markdownlint/package.json +6 -0
  318. package/linters/markdownlint-cli2-config/package.json +6 -0
  319. package/linters/markdownlint-content/package.json +6 -0
  320. package/linters/markdownlint-ignores/package.json +6 -0
  321. package/linters/markdownlint-rules/index/package.json +6 -0
  322. package/linters/markdownlint-rules/no-soft-break-in-paragraph/package.json +6 -0
  323. package/linters/markdownlint-rules/package.json +6 -0
  324. package/linters/markdownlint-types/@types/markdownlint-cli2/package.json +4 -0
  325. package/linters/markdownlint-types/@types/markdownlint-cli2-config-schema/package.json +4 -0
  326. package/linters/over-exposure/package.json +6 -0
  327. package/linters/package.json +6 -0
  328. package/package.json +329 -13
  329. package/test-runners/index/package.json +6 -0
  330. package/test-runners/package.json +6 -0
  331. package/test-runners/vitest/package.json +6 -0
  332. package/test-runners/vitest-config/package.json +6 -0
@@ -0,0 +1,75 @@
1
+ /*
2
+ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
3
+ if you want to view the source, please visit the github repository of this plugin
4
+ */
5
+
6
+ (function () {
7
+ function ensureDisposeSymbols(symbolConstructor = Symbol) {
8
+ symbolConstructor.asyncDispose ??= symbolConstructor.for('Symbol.asyncDispose');
9
+ symbolConstructor.dispose ??= symbolConstructor.for('Symbol.dispose');
10
+ }
11
+
12
+ function ensureBrowserProcess() {
13
+ const browserProcess = {
14
+ browser: true,
15
+ cwd() {
16
+ return '/';
17
+ },
18
+ env: {},
19
+ platform: 'android'
20
+ };
21
+
22
+ const existingProcess = globalThis.process;
23
+
24
+ if (!existingProcess) {
25
+ globalThis.process = browserProcess;
26
+ return;
27
+ }
28
+
29
+ if (existingProcess.versions?.node) {
30
+ return;
31
+ }
32
+
33
+ const existingProcessRecord = existingProcess;
34
+
35
+ for (const [key, value] of Object.entries(browserProcess)) {
36
+ existingProcessRecord[key] ??= value;
37
+ }
38
+
39
+ existingProcessRecord['browser'] = true;
40
+ }
41
+
42
+ (function initEsm() {
43
+ ensureDisposeSymbols();
44
+ ensureBrowserProcess();
45
+ })();
46
+ })();
47
+
48
+ import {
49
+ findForbiddenPatternMatches,
50
+ FORBIDDEN_PATTERNS_FILE_ENV_VARIABLE,
51
+ readForbiddenPatterns
52
+ } from "./forbidden-patterns.mjs";
53
+ const NO_FORBIDDEN_PATTERNS_RULE_NAME = "obsidian-dev-utils/no-forbidden-patterns";
54
+ async function noForbiddenPatternsRule(commit) {
55
+ const patterns = await readForbiddenPatterns();
56
+ const text = [commit.header, commit.body, commit.footer].filter((part) => part !== null).join("\n");
57
+ const matches = findForbiddenPatternMatches(text, patterns);
58
+ if (matches.length === 0) {
59
+ return [true];
60
+ }
61
+ const offendingLines = matches.map(({ line, match }) => `${line} <- ${match}`).join("\n");
62
+ return [false, `the commit message matches a pattern from the file ${FORBIDDEN_PATTERNS_FILE_ENV_VARIABLE} names:
63
+ ${offendingLines}`];
64
+ }
65
+ const forbiddenPatternsPlugin = {
66
+ rules: {
67
+ [NO_FORBIDDEN_PATTERNS_RULE_NAME]: noForbiddenPatternsRule
68
+ }
69
+ };
70
+ export {
71
+ NO_FORBIDDEN_PATTERNS_RULE_NAME,
72
+ forbiddenPatternsPlugin,
73
+ noForbiddenPatternsRule
74
+ };
75
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vc3JjL2NvbW1pdGxpbnQtZm9yYmlkZGVuLXBhdHRlcm5zLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogQSBjb21taXRsaW50IHJ1bGUgdGhhdCByZWZ1c2VzIGEgY29tbWl0IG1lc3NhZ2UgbWF0Y2hpbmcgYSBwYXR0ZXJuIGZyb20gdGhlIFVOUFVCTElTSEVEIGZvcmJpZGRlbi1wYXR0ZXJuc1xuICogbGlzdCBcdTIwMTQgaW4gaXRzIGhlYWRlciwgaXRzIGJvZHkgb3IgaXRzIGZvb3Rlci5cbiAqXG4gKiBUaGUgcmVsZWFzZSBhbHJlYWR5IHJlZnVzZXMgYSBjaGFuZ2Vsb2cgc2VjdGlvbiBjYXJyeWluZyBzdWNoIGEgcGF0dGVybiwgYnV0IGE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sRUFDRTtBQUFBLEVBQ0E7QUFBQSxFQUNBO0FBQUEsT0FDSztBQUtBLE1BQU0sa0NBQWtDO0FBYS9DLGVBQXNCLHdCQUF3QixRQUFzQztBQUNsRixRQUFNLFdBQVcsTUFBTSxzQkFBc0I7QUFDN0MsUUFBTSxPQUFPLENBQUMsT0FBTyxRQUFRLE9BQU8sTUFBTSxPQUFPLE1BQU0sRUFBRSxPQUFPLENBQUMsU0FBUyxTQUFTLElBQUksRUFBRSxLQUFLLElBQUk7QUFDbEcsUUFBTSxVQUFVLDRCQUE0QixNQUFNLFFBQVE7QUFFMUQsTUFBSSxRQUFRLFdBQVcsR0FBRztBQUN4QixXQUFPLENBQUMsSUFBSTtBQUFBLEVBQ2Q7QUFFQSxRQUFNLGlCQUFpQixRQUFRLElBQUksQ0FBQyxFQUFFLE1BQU0sTUFBTSxNQUFNLEdBQUcsSUFBSSxVQUFVLEtBQUssRUFBRSxFQUFFLEtBQUssSUFBSTtBQUMzRixTQUFPLENBQUMsT0FBTyxzREFBc0Qsb0NBQW9DO0FBQUEsRUFBWSxjQUFjLEVBQUU7QUFDdkk7QUFLTyxNQUFNLDBCQUFrQztBQUFBLEVBQzdDLE9BQU87QUFBQSxJQUNMLENBQUMsK0JBQStCLEdBQUc7QUFBQSxFQUNyQztBQUNGOyIsCiAgIm5hbWVzIjogW10KfQo=
@@ -0,0 +1,40 @@
1
+ /// <reference path="./library-references.d.mts" />
2
+ /**
3
+ * @file
4
+ *
5
+ * A commitlint rule that spellchecks a commit HEADER with the project's own `spellcheck` configuration.
6
+ *
7
+ * The header is the one part of a commit message that ships verbatim: a release turns every commit subject
8
+ * since the last tag into a `- <subject>` bullet of the new `CHANGELOG.md` section, and spellchecks that
9
+ * section before writing it. That check works, but it runs at release time, after the whole preflight gate,
10
+ * and weeks after the subject was pushed to the default branch. At that point the only fixes are rewriting
11
+ * published history or supplying the release notes by hand. The commit-msg hook is the last point at which
12
+ * the word can still be changed for free.
13
+ *
14
+ * The header is checked AS the bullet it will become, attributed to `CHANGELOG.md`, so the verdict is the one
15
+ * the release would give: the same `cspell` configuration, the same `words`, the same `ignorePaths`. And it
16
+ * runs only where the project defines a `spellcheck` script, which is the condition the release applies too.
17
+ * A project with no spelling configuration would otherwise have its commits judged against the stock
18
+ * dictionaries alone, and refused over its own name.
19
+ */
20
+ import type { AsyncRule, Plugin, RuleOutcome } from '@commitlint/types';
21
+ /**
22
+ * The name the rule is registered under.
23
+ */
24
+ export declare const SPELLCHECK_HEADER_RULE_NAME = "obsidian-dev-utils/spellcheck-header";
25
+ type Commit = Parameters<AsyncRule>[0];
26
+ /**
27
+ * Spellchecks the commit header as the changelog bullet it will become.
28
+ *
29
+ * Only the `always` condition is meaningful: `never` would require the header to be misspelled, so it is
30
+ * treated the same way rather than inverted.
31
+ *
32
+ * @param commit - The parsed commit.
33
+ * @returns A {@link Promise} that resolves to the rule outcome, naming each unknown word.
34
+ */
35
+ export declare function spellcheckHeaderRule(commit: Commit): Promise<RuleOutcome>;
36
+ /**
37
+ * The commitlint plugin carrying {@link spellcheckHeaderRule}.
38
+ */
39
+ export declare const spellcheckHeaderPlugin: Plugin;
40
+ export {};
@@ -0,0 +1,87 @@
1
+ /*
2
+ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
3
+ if you want to view the source, please visit the github repository of this plugin
4
+ */
5
+
6
+ (function () {
7
+ function ensureDisposeSymbols(symbolConstructor = Symbol) {
8
+ symbolConstructor.asyncDispose ??= symbolConstructor.for('Symbol.asyncDispose');
9
+ symbolConstructor.dispose ??= symbolConstructor.for('Symbol.dispose');
10
+ }
11
+
12
+ function ensureBrowserProcess() {
13
+ const browserProcess = {
14
+ browser: true,
15
+ cwd() {
16
+ return '/';
17
+ },
18
+ env: {},
19
+ platform: 'android'
20
+ };
21
+
22
+ const existingProcess = globalThis.process;
23
+
24
+ if (!existingProcess) {
25
+ globalThis.process = browserProcess;
26
+ return;
27
+ }
28
+
29
+ if (existingProcess.versions?.node) {
30
+ return;
31
+ }
32
+
33
+ const existingProcessRecord = existingProcess;
34
+
35
+ for (const [key, value] of Object.entries(browserProcess)) {
36
+ existingProcessRecord[key] ??= value;
37
+ }
38
+
39
+ existingProcessRecord['browser'] = true;
40
+ }
41
+
42
+ (function initEsm() {
43
+ ensureDisposeSymbols();
44
+ ensureBrowserProcess();
45
+ })();
46
+ })();
47
+
48
+ import { spellcheckContent } from "./linters/cspell-content.mjs";
49
+ import { readPackageJson } from "./npm.mjs";
50
+ import { RepoPaths } from "./repo-paths.mjs";
51
+ import { resolvePathFromRootSafe } from "./root.mjs";
52
+ const SPELLCHECK_HEADER_RULE_NAME = "obsidian-dev-utils/spellcheck-header";
53
+ const SPELLCHECK_SCRIPT_NAME = "spellcheck";
54
+ async function spellcheckHeaderRule(commit) {
55
+ if (!commit.header) {
56
+ return [true];
57
+ }
58
+ const packageJson = await readPackageJson();
59
+ if (!Object.keys(packageJson.scripts ?? {}).includes(SPELLCHECK_SCRIPT_NAME)) {
60
+ return [true];
61
+ }
62
+ const findings = await spellcheckContent({
63
+ content: `- ${commit.header}
64
+ `,
65
+ filePath: resolvePathFromRootSafe({ path: RepoPaths.ChangelogMd })
66
+ });
67
+ if (findings.length === 0) {
68
+ return [true];
69
+ }
70
+ return [
71
+ false,
72
+ `the header does not pass \`${SPELLCHECK_SCRIPT_NAME}\`, and it ships verbatim into the next release's changelog:
73
+ ${findings.join("\n")}
74
+ Reword it, or, for a word this project really does use, add it to the project's \`cspell\` configuration.`
75
+ ];
76
+ }
77
+ const spellcheckHeaderPlugin = {
78
+ rules: {
79
+ [SPELLCHECK_HEADER_RULE_NAME]: spellcheckHeaderRule
80
+ }
81
+ };
82
+ export {
83
+ SPELLCHECK_HEADER_RULE_NAME,
84
+ spellcheckHeaderPlugin,
85
+ spellcheckHeaderRule
86
+ };
87
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vc3JjL2NvbW1pdGxpbnQtc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UFBQSxJQUNMLENBQUMsMkJBQTJCLEdBQUc7QUFBQSxFQUNqQztBQUNGOyIsCiAgIm5hbWVzIjogW10KfQo=
@@ -0,0 +1,42 @@
1
+ /// <reference path="./library-references.d.mts" />
2
+ /**
3
+ * @file
4
+ *
5
+ * Shared environment-variable off switches for the CLI scripts.
6
+ *
7
+ * Every npm script can be skipped by setting an environment variable named after it — the script name
8
+ * uppercased, with every non-alphanumeric character replaced by `_`:
9
+ *
10
+ * | Script | Switch |
11
+ * |---------------------|---------------------|
12
+ * | `lint` | `LINT=0` |
13
+ * | `lint:md:fix` | `LINT_MD_FIX=0` |
14
+ * | `format:check` | `FORMAT_CHECK=0` |
15
+ * | `find-overexposed` | `FIND_OVEREXPOSED=0`|
16
+ *
17
+ * This mirrors the pre-existing `NANO_STAGED=0` / `HUSKY=0` escape hatches, and reuses their notion of an
18
+ * "off" value, so there is a single answer to what counts as off across the whole tool set.
19
+ */
20
+ /**
21
+ * Resolves the off switch for the npm script that is currently running, loading {@link ENV_FILE_PATH} first.
22
+ *
23
+ * The script name comes from npm itself, so no script has to declare its own switch. When the script was
24
+ * started directly rather than through npm, there is no name to derive from and nothing is ever skipped.
25
+ *
26
+ * @returns The name of the environment variable that switched the current script off, or `null` when the
27
+ * script should run.
28
+ */
29
+ export declare function getDisabledScriptEnvVariableName(): null | string;
30
+ /**
31
+ * Determines whether the environment variable is set to an off value (`0`, `false`, `no`, or `off`,
32
+ * case-insensitively and ignoring surrounding whitespace).
33
+ *
34
+ * @param envVariableName - The name of the environment variable to inspect.
35
+ * @returns `true` when the variable is set to an off value, otherwise `false`.
36
+ */
37
+ export declare function isEnvVariableOff(envVariableName: string): boolean;
38
+ /**
39
+ * Loads the optional {@link ENV_FILE_PATH} file into `process.env` when it exists, so a developer can park a
40
+ * switch such as `LINT_MD=0` there instead of prefixing every command.
41
+ */
42
+ export declare function loadEnvFileIfExists(): void;
@@ -0,0 +1,84 @@
1
+ /*
2
+ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
3
+ if you want to view the source, please visit the github repository of this plugin
4
+ */
5
+
6
+ (function () {
7
+ function ensureDisposeSymbols(symbolConstructor = Symbol) {
8
+ symbolConstructor.asyncDispose ??= symbolConstructor.for('Symbol.asyncDispose');
9
+ symbolConstructor.dispose ??= symbolConstructor.for('Symbol.dispose');
10
+ }
11
+
12
+ function ensureBrowserProcess() {
13
+ const browserProcess = {
14
+ browser: true,
15
+ cwd() {
16
+ return '/';
17
+ },
18
+ env: {},
19
+ platform: 'android'
20
+ };
21
+
22
+ const existingProcess = globalThis.process;
23
+
24
+ if (!existingProcess) {
25
+ globalThis.process = browserProcess;
26
+ return;
27
+ }
28
+
29
+ if (existingProcess.versions?.node) {
30
+ return;
31
+ }
32
+
33
+ const existingProcessRecord = existingProcess;
34
+
35
+ for (const [key, value] of Object.entries(browserProcess)) {
36
+ existingProcessRecord[key] ??= value;
37
+ }
38
+
39
+ existingProcessRecord['browser'] = true;
40
+ }
41
+
42
+ (function initEsm() {
43
+ ensureDisposeSymbols();
44
+ ensureBrowserProcess();
45
+ })();
46
+ })();
47
+
48
+ import { replaceAll } from "@mnaoumov/typescript-lib/string";
49
+ import { existsSync } from "node:fs";
50
+ import process from "node:process";
51
+ const OFF_VALUES = /* @__PURE__ */ new Set(["0", "false", "no", "off"]);
52
+ const ENV_FILE_PATH = ".env";
53
+ const NON_ALPHANUMERIC_REG_EXP = /[^a-z0-9]+/gi;
54
+ const NPM_SCRIPT_NAME_ENV_VARIABLE = "npm_lifecycle_event";
55
+ function getDisabledScriptEnvVariableName() {
56
+ loadEnvFileIfExists();
57
+ const scriptName = process.env[NPM_SCRIPT_NAME_ENV_VARIABLE];
58
+ if (!scriptName) {
59
+ return null;
60
+ }
61
+ const envVariableName = toEnvVariableName(scriptName);
62
+ return isEnvVariableOff(envVariableName) ? envVariableName : null;
63
+ }
64
+ function isEnvVariableOff(envVariableName) {
65
+ return OFF_VALUES.has((process.env[envVariableName] ?? "").trim().toLowerCase());
66
+ }
67
+ function loadEnvFileIfExists() {
68
+ if (existsSync(ENV_FILE_PATH)) {
69
+ process.loadEnvFile(ENV_FILE_PATH);
70
+ }
71
+ }
72
+ function toEnvVariableName(scriptName) {
73
+ return replaceAll({
74
+ $string: scriptName,
75
+ replacer: "_",
76
+ searchValue: NON_ALPHANUMERIC_REG_EXP
77
+ }).toUpperCase();
78
+ }
79
+ export {
80
+ getDisabledScriptEnvVariableName,
81
+ isEnvVariableOff,
82
+ loadEnvFileIfExists
83
+ };
84
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vc3JjL2Vudi10b2dnbGUudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBTaGFyZWQgZW52aXJvbm1lbnQtdmFyaWFibGUgb2ZmIHN3aXRjaGVzIGZvciB0aGUgQ0xJIHNjcmlwdHMuXG4gKlxuICogRXZlcnkgbnBtIHNjcmlwdCBjYW4gYmUgc2tpcHBlZCBieSBzZXR0aW5nIGFuIGVudmlyb25tZW50IHZhcmlhYmxlIG5hbWVkIGFmdGVyIGl0IFx1MjAxNCB0aGUgc2NyaXB0IG5hbWVcbiAqIHVwcGVyY2FzZWQsIHdpdGggZXZlcnkgbm9uLWFscGhhbnVtZXJpYyBjaGFyYWN0ZXIgcmVwbGFjZWQgYnkgYF9gOlxuICpcbiAqIHwgU2NyaXB0ICAgICAgICAgICAgICB8IFN3aXRjaCAgICAgICAgICAgICAgfFxuICogfC0tLS0tLS0tLS0tLS0tLS0tLS0tLXwtLS0tLS0tLS0tLS0tLS0tLS0tLS18XG4gKiB8IGBsaW50YCAgICAgICAgICAgICAgfCBgTElOVD0wYCAgICAgICAgICAgIHxcbiAqIHwgYGxpbnQ6bWQ6Zml4YCAgICAgICB8IGBMSU5UX01EX0ZJWD0wYCAgICAgfFxuICogfCBgZm9ybWF0OmNoZWNrYCAgICAgIHwgYEZPUk1BV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+ *
5
+ * Contains utility functions for executing commands.
6
+ */
7
+ /**
8
+ * A command part: either a plain string or an {@link ExecArgument} with batched arguments.
9
+ */
10
+ export type CommandPart = ExecArgument | string;
11
+ /**
12
+ * A command argument that contains a list of args to be batched.
13
+ * If the expanded command exceeds the platform's max command length,
14
+ * the batched args are split into sequential executions.
15
+ */
16
+ export interface ExecArgument {
17
+ /**
18
+ * The arguments to batch.
19
+ */
20
+ readonly batchedArguments: readonly string[];
21
+ }
22
+ /**
23
+ * Options for {@link exec} that return detailed results.
24
+ */
25
+ export interface ExecDetailedOptions extends ExecOptions {
26
+ /**
27
+ * Must be `true` to receive detailed results.
28
+ */
29
+ readonly shouldIncludeDetails: true;
30
+ }
31
+ /**
32
+ * Options for executing a command.
33
+ */
34
+ export interface ExecOptions {
35
+ /**
36
+ * A current working folder for the command execution.
37
+ */
38
+ readonly cwd?: string;
39
+ /**
40
+ * Additional environment variables for the child process, merged over the inherited environment.
41
+ *
42
+ * @default `{}`
43
+ */
44
+ readonly env?: NodeJS.ProcessEnv;
45
+ /**
46
+ * If `true`, attaches the child process's stdio directly to the terminal (`stdio: 'inherit'`) instead
47
+ * of capturing it. Use for long-running or interactive commands such as dev servers and watch mode.
48
+ * Because the output is not captured, the resolved stdout is an empty string.
49
+ *
50
+ * @default `false`
51
+ */
52
+ readonly isInteractive?: boolean;
53
+ /**
54
+ * If `true`, suppresses the output of the command.
55
+ *
56
+ * @default `false`
57
+ */
58
+ readonly isQuiet?: boolean;
59
+ /**
60
+ * If `true`, throws an error if the command fails.
61
+ *
62
+ * @default `true`
63
+ */
64
+ readonly shouldFailIfCalledFromOutsideRoot?: boolean;
65
+ /**
66
+ * If `true`, ignores the exit code of the command.
67
+ *
68
+ * @default `false`
69
+ */
70
+ readonly shouldIgnoreExitCode?: boolean;
71
+ /**
72
+ * If `false`, only returns the output of the command.
73
+ *
74
+ * @default `false`
75
+ */
76
+ readonly shouldIncludeDetails?: boolean;
77
+ /**
78
+ * An input to be passed to the command.
79
+ *
80
+ * @default `''`
81
+ */
82
+ readonly stdin?: string;
83
+ }
84
+ /**
85
+ * A result of {@link exec}.
86
+ */
87
+ export interface ExecResult {
88
+ /**
89
+ * An exit code of the command. A value of `null` indicates that the process did not exit normally.
90
+ */
91
+ readonly exitCode: null | number;
92
+ /**
93
+ * A signal that caused the process to be terminated. A value of `null` indicates that no signal was received.
94
+ */
95
+ readonly exitSignal: NodeJS.Signals | null;
96
+ /**
97
+ * A standard error output from the command.
98
+ */
99
+ readonly stderr: string;
100
+ /**
101
+ * A standard output from the command.
102
+ */
103
+ readonly stdout: string;
104
+ }
105
+ /**
106
+ * Options for {@link exec} that return only stdout.
107
+ */
108
+ export interface ExecSimpleOptions extends ExecOptions {
109
+ /**
110
+ * Must be `false` or omitted to receive only stdout.
111
+ *
112
+ * @default `false`
113
+ */
114
+ readonly shouldIncludeDetails?: false;
115
+ }
116
+ /**
117
+ * Appends a single `node` CLI option to a `NODE_OPTIONS` string, preserving any options already present.
118
+ *
119
+ * @param existingNodeOptions - The current `NODE_OPTIONS` value (e.g. `process.env.NODE_OPTIONS`), if any.
120
+ * @param option - The `node` CLI option to append (e.g. `--localstorage-file=:memory:`).
121
+ * @returns The combined `NODE_OPTIONS` string. If `option` is already present, the value is returned unchanged.
122
+ */
123
+ export declare function appendNodeOption(existingNodeOptions: string | undefined, option: string): string;
124
+ /**
125
+ * Builds the environment for child processes: the parent environment plus `DEBUG_COLORS`, and — when
126
+ * the running `node` supports it — {@link LOCAL_STORAGE_NODE_OPTION} appended to `NODE_OPTIONS`.
127
+ *
128
+ * The support check guards against older `node` (< 22): passing an option `node` does not recognize via
129
+ * `NODE_OPTIONS` makes it exit before running, which would break every spawned tool.
130
+ *
131
+ * @param baseEnv - The parent environment to extend (typically `process.env`).
132
+ * @param allowedNodeEnvironmentFlags - The `node` options accepted via `NODE_OPTIONS` (typically `process.allowedNodeEnvironmentFlags`).
133
+ * @returns The environment to pass to spawned child processes.
134
+ */
135
+ export declare function buildChildEnv(baseEnv: NodeJS.ProcessEnv, allowedNodeEnvironmentFlags: ReadonlySet<string>): NodeJS.ProcessEnv;
136
+ /**
137
+ * Executes a command.
138
+ *
139
+ * @param command - The command to execute. It can be a string or an array of strings.
140
+ * @param options - The options for the execution.
141
+ * @returns A {@link Promise} that resolves with the output of the command.
142
+ * @throws If the command fails with a non-zero exit code and ignoreExitCode is `false`.
143
+ * The error message includes the exit code, the command, stderr, and stdout (or a note that it was
144
+ * printed), and says when the child crashed or was killed rather than exiting on its own.
145
+ * If an error occurs during the execution and ignoreExitCode is `true`,
146
+ * the error is resolved with the stdout and stderr.
147
+ */
148
+ export declare function exec(command: CommandPart[] | string, options?: ExecSimpleOptions): Promise<string>;
149
+ /**
150
+ * Executes a command.
151
+ *
152
+ * @param command - The command to execute. It can be a string or an array of strings.
153
+ * @param options - The options for the execution.
154
+ * @returns A {@link Promise} that resolves with ExecResult object.
155
+ * The ExecResult object contains the exit code, exit signal, stderr, and stdout.
156
+ * @throws If the command fails with a non-zero exit code and ignoreExitCode is `false`.
157
+ * The error message includes the exit code, the command, stderr, and stdout (or a note that it was
158
+ * printed), and says when the child crashed or was killed rather than exiting on its own.
159
+ * If an error occurs during the execution and ignoreExitCode is `true`,
160
+ * the error is resolved with the stdout and stderr.
161
+ */
162
+ export declare function exec(command: CommandPart[] | string, options: ExecDetailedOptions): Promise<ExecResult>;