@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,101 @@
1
+ /// <reference path="./library-references.d.cts" />
2
+ /**
3
+ * @file
4
+ *
5
+ * The build pipeline of a TypeScript LIBRARY package: one `dist/lib/{cjs,esm}` tree of unbundled modules beside its
6
+ * `.d.cts` / `.d.mts` declarations, the generated `index.ts` barrels, and the generated `package.json` `exports` map.
7
+ *
8
+ * Each step works on the current working folder, which is the package being built. A repository's
9
+ * `scripts/build-*.ts` entry points are thin `wrapCliTask` wrappers around these functions, and its `build` script
10
+ * runs them in order through {@link runBuildSteps}.
11
+ */
12
+ import type { Plugin } from 'esbuild' with { 'resolution-mode': 'import' };
13
+ /**
14
+ * The banner every emitted library module opens with.
15
+ */
16
+ export declare const LIBRARY_BANNER = "/*\nTHIS IS A GENERATED/BUNDLED FILE BY ESBUILD\nif you want to view the source, please visit the github repository of this plugin\n*/\n";
17
+ /**
18
+ * The steps of a library build, in the order {@link runBuildSteps} runs them.
19
+ */
20
+ export declare const LIBRARY_BUILD_STEPS: readonly string[];
21
+ /**
22
+ * The export condition the `obsidian-dev-utils` workspace maps every subpath onto its TypeScript source with, so a
23
+ * package there can import a sibling package's source before anything is built. Pass it to
24
+ * {@link generateLibraryExports} through {@link GenerateLibraryExportsOptions.sourceCondition}.
25
+ */
26
+ export declare const SOURCE_CONDITION = "@mnaoumov/source";
27
+ /**
28
+ * Options for {@link buildLibrary}.
29
+ */
30
+ export interface BuildLibraryOptions {
31
+ /**
32
+ * Creates the preprocess plugin for one output format. Defaults to the generic one, which carries no
33
+ * environment-specific `require` patch.
34
+ */
35
+ readonly preprocessPluginFactory?: (isEsm: boolean) => Plugin;
36
+ }
37
+ /**
38
+ * Options for {@link generateLibraryExports}.
39
+ */
40
+ export interface GenerateLibraryExportsOptions {
41
+ /**
42
+ * An export condition to put first in every entry, mapping the subpath onto its TypeScript source. Only a
43
+ * repository holding several packages that import each other needs one; nothing outside it sets the condition, and
44
+ * the sources it points at do not ship, so the publish has to strip it again. Omitted, the map has none.
45
+ */
46
+ readonly sourceCondition?: string | undefined;
47
+ }
48
+ /**
49
+ * Removes everything an earlier build left: `dist/`, the generated `index.ts` barrels, the `.d.ts` files `tsc` wrote
50
+ * beside the sources (hand-authored ones under `@types` stay), and the per-subpath `package.json` stubs.
51
+ *
52
+ * @returns A {@link Promise} that resolves when everything has been removed.
53
+ */
54
+ export declare function buildCleanLibrary(): Promise<void>;
55
+ /**
56
+ * Builds every source module, unbundled, into `dist/lib/cjs` (`.cjs`) and `dist/lib/esm` (`.mjs`).
57
+ *
58
+ * The output folders must already exist; {@link buildLibraryTypes} creates them.
59
+ *
60
+ * @param options - The build options.
61
+ * @returns A {@link Promise} that resolves when both formats have been built.
62
+ */
63
+ export declare function buildLibrary(options?: BuildLibraryOptions): Promise<void>;
64
+ /**
65
+ * Emits the declarations with `tsc --project ./tsconfig.types.json`, then copies each one into `dist/lib` twice: as a
66
+ * `.d.cts` whose relative imports name `.cjs` files and whose bare type imports carry `resolution-mode: import`, and
67
+ * as a `.d.mts` whose relative imports name `.mjs` files.
68
+ *
69
+ * The library's root declaration (`library.ts` where the package has one, otherwise the generated `index.ts`) carries
70
+ * every `lib` and `types` reference the package needs, and so does a `library-references` declaration beside it that
71
+ * carries nothing else. Every other declaration references that one by path, never the root: the root barrel
72
+ * re-exports every module, so referencing it made each subpath load the whole package, and a consumer type-checking
73
+ * with `skipLibCheck: false` then needed every optional peer installed.
74
+ *
75
+ * @returns A {@link Promise} that resolves when the declarations have been written.
76
+ * @throws If a source module is named `library-references`, which would collide with the generated declaration.
77
+ */
78
+ export declare function buildLibraryTypes(): Promise<void>;
79
+ /**
80
+ * Regenerates the `exports` map of the package's `package.json` from its source folders, and writes a `package.json`
81
+ * stub per subpath for resolvers that do not read `exports`.
82
+ *
83
+ * @param options - The {@link GenerateLibraryExportsOptions}.
84
+ * @returns A {@link Promise} that resolves when the map is current.
85
+ * @throws If the map changed, so the change gets reviewed and committed rather than shipped unseen.
86
+ */
87
+ export declare function generateLibraryExports(options?: GenerateLibraryExportsOptions): Promise<void>;
88
+ /**
89
+ * Generates an `index.ts` barrel in every source folder that has something to export, re-exporting each module and
90
+ * each sub-barrel under its own name.
91
+ *
92
+ * @returns A {@link Promise} that resolves when the barrels have been written.
93
+ */
94
+ export declare function generateLibraryIndex(): Promise<void>;
95
+ /**
96
+ * Runs each named npm script the package defines, in order, skipping the ones it does not define.
97
+ *
98
+ * @param steps - The npm script names.
99
+ * @returns A {@link Promise} that resolves when every step has run.
100
+ */
101
+ export declare function runBuildSteps(steps?: readonly string[]): Promise<void>;
@@ -0,0 +1,5 @@
1
+ /// <reference lib="dom" />
2
+ /// <reference lib="dom.iterable" />
3
+ /// <reference lib="es2022" />
4
+ /// <reference lib="esnext.disposable" />
5
+ /// <reference types="node" />
@@ -0,0 +1,124 @@
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 keepName($unknown) {
43
+ return $unknown;
44
+ }
45
+
46
+ (function initCjs() {
47
+ const globalThisRecord = globalThis;
48
+ ensureDisposeSymbols();
49
+ globalThisRecord['__name'] ??= keepName;
50
+ globalThisRecord['__extractDefault'] ??= extractDefault;
51
+
52
+ ensureBrowserProcess();
53
+
54
+ // eslint-disable-next-line unicorn/consistent-function-scoping -- Serialized with initCjs into the banner; at module scope it would be left out of it.
55
+ function extractDefault(module) {
56
+ return module && module.__esModule && 'default' in module ? module.default : module;
57
+ }
58
+ })();
59
+ })();
60
+
61
+ "use strict";
62
+ var __defProp = Object.defineProperty;
63
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
64
+ var __getOwnPropNames = Object.getOwnPropertyNames;
65
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
66
+ var __export = (target, all) => {
67
+ for (var name in all)
68
+ __defProp(target, name, { get: all[name], enumerable: true });
69
+ };
70
+ var __copyProps = (to, from, except, desc) => {
71
+ if (from && typeof from === "object" || typeof from === "function") {
72
+ for (let key of __getOwnPropNames(from))
73
+ if (!__hasOwnProp.call(to, key) && key !== except)
74
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
75
+ }
76
+ return to;
77
+ };
78
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
79
+ var cspell_content_exports = {};
80
+ __export(cspell_content_exports, {
81
+ spellcheckContent: () => spellcheckContent
82
+ });
83
+ module.exports = __toCommonJS(cspell_content_exports);
84
+ var import_debug = require('@mnaoumov/typescript-lib/debug');
85
+ var import_path = require('@mnaoumov/typescript-lib/path');
86
+ var import_package_manager = require('../package-manager.cjs');
87
+ var import_root = require('../root.cjs');
88
+ const SUCCESS_EXIT_CODE = 0;
89
+ async function spellcheckContent(params) {
90
+ const { content, filePath } = params;
91
+ const contentDebugger = (0, import_debug.getLibDebugger)("cspell:spellcheckContent");
92
+ const result = await (0, import_root.execFromRoot)([
93
+ ...(0, import_package_manager.resolveToolCommand)({ tool: "cspell" }),
94
+ "lint",
95
+ "--no-progress",
96
+ "--no-must-find-files",
97
+ // The `CSpell: Files checked: …` summary and the color codes are both noise in a finding that ends up
98
+ // quoted in an error message, and both are printed by default when they are not asked away.
99
+ "--no-summary",
100
+ "--no-color",
101
+ // A POSIX path, because this is parsed as a URL: a Windows path's backslashes do not survive that.
102
+ `stdin://${(0, import_path.toPosixPath)(filePath)}`
103
+ ], {
104
+ isQuiet: true,
105
+ shouldIgnoreExitCode: true,
106
+ shouldIncludeDetails: true,
107
+ stdin: content
108
+ });
109
+ contentDebugger(result.stderr);
110
+ if (result.exitCode === SUCCESS_EXIT_CODE) {
111
+ return [];
112
+ }
113
+ const findings = result.stdout.split("\n").map((line) => line.trim()).filter(Boolean);
114
+ if (findings.length === 0) {
115
+ throw new Error(`\`cspell\` exited with ${String(result.exitCode)} without reporting anything:
116
+ ${result.stderr}`);
117
+ }
118
+ return findings;
119
+ }
120
+ // Annotate the CommonJS export names for ESM import in node:
121
+ 0 && (module.exports = {
122
+ spellcheckContent
123
+ });
124
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL2xpbnRlcnMvY3NwZWxsLWNvbnRlbnQudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBTcGVsbGNoZWNrcyBtYXJrZG93biB0aGF0IGlzIHN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O0FBQUEsSUFHQTtBQUFBLElBQ0E7QUFBQTtBQUFBLElBRUEsZUFBVyx5QkFBWSxRQUFRLENBQUM7QUFBQSxFQUNsQyxHQUFHO0FBQUEsSUFDRCxTQUFTO0FBQUEsSUFDVCxzQkFBc0I7QUFBQSxJQUN0QixzQkFBc0I7QUFBQSxJQUN0QixPQUFPO0FBQUEsRUFDVCxDQUFDO0FBRUQsa0JBQWdCLE9BQU8sTUFBTTtBQUU3QixNQUFJLE9BQU8sYUFBYSxtQkFBbUI7QUFDekMsV0FBTyxDQUFDO0FBQUEsRUFDVjtBQUVBLFFBQU0sV0FBVyxPQUFPLE9BQU8sTUFBTSxJQUFJLEVBQUUsSUFBSSxDQUFDLFNBQVMsS0FBSyxLQUFLLENBQUMsRUFBRSxPQUFPLE9BQU87QUFLcEYsTUFBSSxTQUFTLFdBQVcsR0FBRztBQUN6QixVQUFNLElBQUksTUFBTSwwQkFBMEIsT0FBTyxPQUFPLFFBQVEsQ0FBQztBQUFBLEVBQWlDLE9BQU8sTUFBTSxFQUFFO0FBQUEsRUFDbkg7QUFFQSxTQUFPO0FBQ1Q7IiwKICAibmFtZXMiOiBbXQp9Cg==
@@ -0,0 +1,46 @@
1
+ /// <reference path="../library-references.d.cts" />
2
+ /**
3
+ * @file
4
+ *
5
+ * Spellchecks markdown that is still in memory, with the repository's own `spellcheck` configuration.
6
+ *
7
+ * The sibling of `markdownlint-content.ts`, for the other half of the same gap: `spellcheck` can only answer
8
+ * for what is already on disk, so a document composed during a run — the release's changelog being the one
9
+ * that costs a red `main` — is checked by nothing until the next gate. A coined word in a release note lands
10
+ * on the default branch inside the release commit, and the NEXT release aborts in its second preflight step,
11
+ * in a repository nobody was working on.
12
+ *
13
+ * It SHELLS OUT where the markdownlint half calls a library, and the difference has a reason rather than
14
+ * being an oversight. `cspell` does export a CLI-layer `lint(fileGlobs, options, reporter)` that would be the
15
+ * exact analogue of `markdownlint-cli2`'s `main`, but the only way to hand it content that is not on disk is
16
+ * a `stdin://` glob, and its reader is `streamConsumers.text(process.stdin)` — the HOST process's own stdin,
17
+ * which the release's interactive review also uses. Reaching for it in-process would mean monkey-patching
18
+ * `process.stdin` for the whole process, so the content goes to a child's stdin instead.
19
+ *
20
+ * The `stdin://<path>` form is what makes the check the repository's own rather than a generic one: the
21
+ * virtual document is attributed to a REAL path, so `cspell.json` beside it — its `words`, its dictionaries,
22
+ * its `ignorePaths` — resolves exactly as it would for the written file. A temp file outside the repository
23
+ * would lose all of that, which is why it is not used.
24
+ */
25
+ /**
26
+ * Parameters for {@link spellcheckContent}.
27
+ */
28
+ export interface SpellcheckContentParams {
29
+ /**
30
+ * The content to spellcheck.
31
+ */
32
+ readonly content: string;
33
+ /**
34
+ * The path the content is checked AS — normally the path it is about to be written to. It decides which
35
+ * `cspell` configuration applies, and it is what every reported finding is named after.
36
+ */
37
+ readonly filePath: string;
38
+ }
39
+ /**
40
+ * Spellchecks content that is not on disk, with the configuration `spellcheck` would have used for it.
41
+ *
42
+ * @param params - The {@link SpellcheckContentParams}.
43
+ * @returns A {@link Promise} that resolves to the findings, each one the line the `spellcheck` output would
44
+ * have carried — `<path>:<line>:<column> - Unknown word (<word>)` — or an empty array when there are none.
45
+ */
46
+ export declare function spellcheckContent(params: SpellcheckContentParams): Promise<string[]>;
@@ -0,0 +1,103 @@
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 keepName($unknown) {
43
+ return $unknown;
44
+ }
45
+
46
+ (function initCjs() {
47
+ const globalThisRecord = globalThis;
48
+ ensureDisposeSymbols();
49
+ globalThisRecord['__name'] ??= keepName;
50
+ globalThisRecord['__extractDefault'] ??= extractDefault;
51
+
52
+ ensureBrowserProcess();
53
+
54
+ // eslint-disable-next-line unicorn/consistent-function-scoping -- Serialized with initCjs into the banner; at module scope it would be left out of it.
55
+ function extractDefault(module) {
56
+ return module && module.__esModule && 'default' in module ? module.default : module;
57
+ }
58
+ })();
59
+ })();
60
+
61
+ "use strict";
62
+ var __defProp = Object.defineProperty;
63
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
64
+ var __getOwnPropNames = Object.getOwnPropertyNames;
65
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
66
+ var __export = (target, all) => {
67
+ for (var name in all)
68
+ __defProp(target, name, { get: all[name], enumerable: true });
69
+ };
70
+ var __copyProps = (to, from, except, desc) => {
71
+ if (from && typeof from === "object" || typeof from === "function") {
72
+ for (let key of __getOwnPropNames(from))
73
+ if (!__hasOwnProp.call(to, key) && key !== except)
74
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
75
+ }
76
+ return to;
77
+ };
78
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
79
+ var cspell_exports = {};
80
+ __export(cspell_exports, {
81
+ spellcheck: () => spellcheck
82
+ });
83
+ module.exports = __toCommonJS(cspell_exports);
84
+ var import_package_manager = require('../package-manager.cjs');
85
+ var import_root = require('../root.cjs');
86
+ async function spellcheck(options) {
87
+ const { paths } = options ?? {};
88
+ const targets = paths?.length ? paths : ["."];
89
+ const rootFolder = (0, import_root.getRootFolder)();
90
+ await (0, import_root.execFromRoot)([
91
+ ...(0, import_package_manager.resolveToolCommand)({ tool: "cspell" }),
92
+ "--no-progress",
93
+ "--no-must-find-files",
94
+ "--gitignore",
95
+ ...rootFolder === null ? [] : ["--gitignore-root", rootFolder],
96
+ { batchedArguments: targets }
97
+ ]);
98
+ }
99
+ // Annotate the CommonJS export names for ESM import in node:
100
+ 0 && (module.exports = {
101
+ spellcheck
102
+ });
103
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL2xpbnRlcnMvY3NwZWxsLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogVGhpcyBtb2R1bGUgcHJvdmlkZXMgYSBmdW5jdGlvbiBmb3IgcnVubmluZyBhIHNwZWxsY2hlY2sgb24gdGhlIGNvZGViYXNlIHVzaW5nIHRoZSBgY3NwZWxsYCBsaWJyYXJ5LlxuICogSXQgcmVwb3J0cyBhbnkgc3BlbGxpbmcgaXNzdWVzIGZvdW5kIGluIHRoZSBjb2RlIGFuZCByZXR1cm5zIGEge0BsaW5rIENsaVRhc2tSZXN1bHR9IGluZGljYXRpbmcgd2hldGhlciB0aGUgc3BlbGxjaGVjayB3YXMgc3VjY2Vzc2Z1bC5cbiAqL1xuXG5pbXBvcnQgeyByZXNvbHZlVG9vbENvbW1hbmQgfSBmcm9tICcuLi9wYWNrYWdlLW1hbmFnZXIudHMnO1xuaW1wb3J0IHtcbiAgZXhlY0Zyb21Sb290LFxuICBnZXRSb290Rm9sZGVyXG59IGZyb20gJy4uL3Jvb3QudHMnO1xuXG4vKipcbiAqIFBhcmFtZXRlcnMgZm9yIHRoZSB7QGxpbmsgc3BlbGxjaGVja30gZnVuY3Rpb24uXG4gKi9cbmV4cG9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xrQkFBa0IsUUFBUTtBQUFBLEVBQzlCLENBQUM7QUFDSDsiLAogICJuYW1lcyI6IFtdCn0K
@@ -0,0 +1,36 @@
1
+ /// <reference path="../library-references.d.cts" />
2
+ /**
3
+ * @file
4
+ *
5
+ * This module provides a function for running a spellcheck on the codebase using the `cspell` library.
6
+ * It reports any spelling issues found in the code and returns a {@link CliTaskResult} indicating whether the spellcheck was successful.
7
+ */
8
+ /**
9
+ * Parameters for the {@link spellcheck} function.
10
+ */
11
+ export interface SpellcheckOptions {
12
+ /**
13
+ * Optional file paths to check. If omitted, checks the entire project.
14
+ */
15
+ readonly paths?: string[] | undefined;
16
+ }
17
+ /**
18
+ * Runs a spellcheck on the entire codebase using `cspell`.
19
+ *
20
+ * Checks all files in the current folder and its subfolders for spelling issues.
21
+ * If issues are found, they are logged to the console with their file path, line, and column number.
22
+ *
23
+ * Uses `--no-must-find-files` so that cspell does not fail when all provided paths
24
+ * are excluded by built-in ignore rules (e.g., `package-lock.json`).
25
+ *
26
+ * Uses `--gitignore` so a path git ignores is a path cspell skips — generated output, build folders and
27
+ * every `node_modules` are covered without a hand-maintained `ignorePaths` list that drifts from
28
+ * `.gitignore`. It is passed on the command line rather than set in `cspell.json` so that every project
29
+ * consuming this function inherits it, rather than each having to edit its own config. `--gitignore-root`
30
+ * stops the search at the project root, so a `.gitignore` in some parent folder outside the project cannot
31
+ * silently remove files from the check.
32
+ *
33
+ * @param options - The {@link SpellcheckOptions}.
34
+ * @returns A {@link Promise} that resolves to a {@link CliTaskResult}, indicating the success or failure of the spellcheck.
35
+ */
36
+ export declare function spellcheck(options?: SpellcheckOptions): Promise<void>;
@@ -0,0 +1,94 @@
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 keepName($unknown) {
43
+ return $unknown;
44
+ }
45
+
46
+ (function initCjs() {
47
+ const globalThisRecord = globalThis;
48
+ ensureDisposeSymbols();
49
+ globalThisRecord['__name'] ??= keepName;
50
+ globalThisRecord['__extractDefault'] ??= extractDefault;
51
+
52
+ ensureBrowserProcess();
53
+
54
+ // eslint-disable-next-line unicorn/consistent-function-scoping -- Serialized with initCjs into the banner; at module scope it would be left out of it.
55
+ function extractDefault(module) {
56
+ return module && module.__esModule && 'default' in module ? module.default : module;
57
+ }
58
+ })();
59
+ })();
60
+
61
+ "use strict";
62
+ var __defProp = Object.defineProperty;
63
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
64
+ var __getOwnPropNames = Object.getOwnPropertyNames;
65
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
66
+ var __export = (target, all) => {
67
+ for (var name in all)
68
+ __defProp(target, name, { get: all[name], enumerable: true });
69
+ };
70
+ var __copyProps = (to, from, except, desc) => {
71
+ if (from && typeof from === "object" || typeof from === "function") {
72
+ for (let key of __getOwnPropNames(from))
73
+ if (!__hasOwnProp.call(to, key) && key !== except)
74
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
75
+ }
76
+ return to;
77
+ };
78
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
79
+ var eslint_agnostic_core_boundary_exports = {};
80
+ __export(eslint_agnostic_core_boundary_exports, {
81
+ getPackageBoundaryNoRestrictedImportPatterns: () => getPackageBoundaryNoRestrictedImportPatterns
82
+ });
83
+ module.exports = __toCommonJS(eslint_agnostic_core_boundary_exports);
84
+ function getPackageBoundaryNoRestrictedImportPatterns(params) {
85
+ return params.forbiddenPackageNames.map((forbiddenPackageName) => ({
86
+ group: [forbiddenPackageName, `${forbiddenPackageName}/*`, `${forbiddenPackageName}/**`],
87
+ message: `\`${params.packageName}\` must not import \`${forbiddenPackageName}\`: the dependency arrows between the workspace packages point the other way.`
88
+ }));
89
+ }
90
+ // Annotate the CommonJS export names for ESM import in node:
91
+ 0 && (module.exports = {
92
+ getPackageBoundaryNoRestrictedImportPatterns
93
+ });
94
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL2xpbnRlcnMvZXNsaW50LWFnbm9zdGljLWNvcmUtYm91bmRhcnkudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBgbm8tcmVzdHJpY3RlZC1pbXBvcnRzYCBwYXR0ZXJuIGVudHJpZXMgdGhhdCBlbmZvcmNlIHRoZSBkZXBlbmRlbmN5IGFycm93cyBiZXR3ZWVuIHRoZSBwYWNrYWdlcyBvZiBhIHdvcmtzcGFjZTpcbiAqIHdoaWNoIHBhY2thZ2VzIGEgcGFja2FnZSdzIGNvZGUgbWF5IGltcG9ydCwgYnkgbmFtaW5nIHRoZSBvbmVzIGl0IG1heSBub3QuXG4gKlxuICogRXhwb3J0ZWQgYXMgc3RhbmRhbG9uZSBidWlsZGVycyBzbyB0aGUgcGF0dGVybnMgY2FuIGJlIHVuaXQtdGVzdGVkIGluZGVwZW5kZW50bHkgb2YgdGhlIGxhcmd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Ucsb0JBQW9CLEtBQUs7QUFBQSxJQUN2RixTQUFTLEtBQUssT0FBTyxXQUFXLHdCQUF3QixvQkFBb0I7QUFBQSxFQUM5RSxFQUFFO0FBQ0o7IiwKICAibmFtZXMiOiBbXQp9Cg==
@@ -0,0 +1,49 @@
1
+ /// <reference path="../library-references.d.cts" />
2
+ /**
3
+ * @file
4
+ *
5
+ * `no-restricted-imports` pattern entries that enforce the dependency arrows between the packages of a workspace:
6
+ * which packages a package's code may import, by naming the ones it may not.
7
+ *
8
+ * Exported as standalone builders so the patterns can be unit-tested independently of the larger declarative
9
+ * config, and so the owning project can apply them scoped to each package's source files.
10
+ *
11
+ * Workspace `package.json` dependencies enforce the same boundary in the end, because an import of an undeclared
12
+ * package fails to resolve once the package is installed on its own. Inside the workspace every package is
13
+ * resolvable from every other, so without this rule a wrong arrow would surface only after publishing.
14
+ */
15
+ /**
16
+ * Parameters for {@link getPackageBoundaryNoRestrictedImportPatterns}.
17
+ */
18
+ export interface GetPackageBoundaryNoRestrictedImportPatternsParams {
19
+ /**
20
+ * The packages the package's code must not import, by package name.
21
+ */
22
+ readonly forbiddenPackageNames: readonly string[];
23
+ /**
24
+ * The name of the package the patterns apply to, named in the message.
25
+ */
26
+ readonly packageName: string;
27
+ }
28
+ /**
29
+ * A single `no-restricted-imports` pattern entry pairing a group of banned import specifiers with a
30
+ * human-readable message explaining why they are banned.
31
+ */
32
+ export interface NoRestrictedImportPatternEntry {
33
+ /**
34
+ * The glob group of import specifiers to ban.
35
+ */
36
+ group: string[];
37
+ /**
38
+ * Human-readable message shown when an import matches the group.
39
+ */
40
+ message: string;
41
+ }
42
+ /**
43
+ * Builds the `no-restricted-imports` pattern entries banning a package's code from importing the given packages,
44
+ * through their root or any subpath.
45
+ *
46
+ * @param params - The {@link GetPackageBoundaryNoRestrictedImportPatternsParams}.
47
+ * @returns One pattern entry per forbidden package; none when nothing is forbidden.
48
+ */
49
+ export declare function getPackageBoundaryNoRestrictedImportPatterns(params: GetPackageBoundaryNoRestrictedImportPatternsParams): NoRestrictedImportPatternEntry[];