@mnaoumov/typescript-dev-toolkit 0.0.0 → 1.0.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 (330) 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 +475 -0
  61. package/dist/lib/cjs/library-build.d.cts +97 -0
  62. package/dist/lib/cjs/linters/cspell-content.cjs +124 -0
  63. package/dist/lib/cjs/linters/cspell-content.d.cts +46 -0
  64. package/dist/lib/cjs/linters/cspell.cjs +103 -0
  65. package/dist/lib/cjs/linters/cspell.d.cts +36 -0
  66. package/dist/lib/cjs/linters/eslint-agnostic-core-boundary.cjs +94 -0
  67. package/dist/lib/cjs/linters/eslint-agnostic-core-boundary.d.cts +49 -0
  68. package/dist/lib/cjs/linters/eslint-config.cjs +1068 -0
  69. package/dist/lib/cjs/linters/eslint-config.d.cts +123 -0
  70. package/dist/lib/cjs/linters/eslint-no-restricted-syntax.cjs +130 -0
  71. package/dist/lib/cjs/linters/eslint-no-restricted-syntax.d.cts +27 -0
  72. package/dist/lib/cjs/linters/eslint-rules/in-house-plugin.cjs +116 -0
  73. package/dist/lib/cjs/linters/eslint-rules/in-house-plugin.d.cts +26 -0
  74. package/dist/lib/cjs/linters/eslint-rules/index.cjs +132 -0
  75. package/dist/lib/cjs/linters/eslint-rules/index.d.cts +13 -0
  76. package/dist/lib/cjs/linters/eslint-rules/no-async-callback-to-unsafe-return.cjs +175 -0
  77. package/dist/lib/cjs/linters/eslint-rules/no-async-callback-to-unsafe-return.d.cts +10 -0
  78. package/dist/lib/cjs/linters/eslint-rules/no-unresolved-jsdoc-link.cjs +290 -0
  79. package/dist/lib/cjs/linters/eslint-rules/no-unresolved-jsdoc-link.d.cts +10 -0
  80. package/dist/lib/cjs/linters/eslint-rules/no-unused-params-members.cjs +265 -0
  81. package/dist/lib/cjs/linters/eslint-rules/no-unused-params-members.d.cts +41 -0
  82. package/dist/lib/cjs/linters/eslint-rules/no-used-underscore-variables.cjs +134 -0
  83. package/dist/lib/cjs/linters/eslint-rules/no-used-underscore-variables.d.cts +20 -0
  84. package/dist/lib/cjs/linters/eslint-rules/params-options-name-match.cjs +217 -0
  85. package/dist/lib/cjs/linters/eslint-rules/params-options-name-match.d.cts +36 -0
  86. package/dist/lib/cjs/linters/eslint-rules/prefer-noop-async.cjs +126 -0
  87. package/dist/lib/cjs/linters/eslint-rules/prefer-noop-async.d.cts +10 -0
  88. package/dist/lib/cjs/linters/eslint-rules/readonly-params-options-result-members.cjs +125 -0
  89. package/dist/lib/cjs/linters/eslint-rules/readonly-params-options-result-members.d.cts +20 -0
  90. package/dist/lib/cjs/linters/eslint-rules/require-method-template.cjs +181 -0
  91. package/dist/lib/cjs/linters/eslint-rules/require-method-template.d.cts +14 -0
  92. package/dist/lib/cjs/linters/eslint-rules/require-super-call.cjs +217 -0
  93. package/dist/lib/cjs/linters/eslint-rules/require-super-call.d.cts +10 -0
  94. package/dist/lib/cjs/linters/eslint-rules/rule-tester-helper.cjs +92 -0
  95. package/dist/lib/cjs/linters/eslint-rules/rule-tester-helper.d.cts +18 -0
  96. package/dist/lib/cjs/linters/eslint-rules/ts-estree-node.cjs +92 -0
  97. package/dist/lib/cjs/linters/eslint-rules/ts-estree-node.d.cts +23 -0
  98. package/dist/lib/cjs/linters/eslint-types/@types/@eslint-community__eslint-plugin-eslint-comments__configs.d.cts +20 -0
  99. package/dist/lib/cjs/linters/eslint-types/@types/eslint-plugin-verify-tsdoc.d.cts +17 -0
  100. package/dist/lib/cjs/linters/eslint.cjs +122 -0
  101. package/dist/lib/cjs/linters/eslint.d.cts +35 -0
  102. package/dist/lib/cjs/linters/index.cjs +138 -0
  103. package/dist/lib/cjs/linters/index.d.cts +15 -0
  104. package/dist/lib/cjs/linters/lint-ignores.cjs +91 -0
  105. package/dist/lib/cjs/linters/lint-ignores.d.cts +30 -0
  106. package/dist/lib/cjs/linters/markdownlint-cli2-config.cjs +169 -0
  107. package/dist/lib/cjs/linters/markdownlint-cli2-config.d.cts +11 -0
  108. package/dist/lib/cjs/linters/markdownlint-content.cjs +120 -0
  109. package/dist/lib/cjs/linters/markdownlint-content.d.cts +47 -0
  110. package/dist/lib/cjs/linters/markdownlint-ignores.cjs +95 -0
  111. package/dist/lib/cjs/linters/markdownlint-ignores.d.cts +35 -0
  112. package/dist/lib/cjs/linters/markdownlint-rules/index.cjs +99 -0
  113. package/dist/lib/cjs/linters/markdownlint-rules/index.d.cts +2 -0
  114. package/dist/lib/cjs/linters/markdownlint-rules/no-soft-break-in-paragraph.cjs +152 -0
  115. package/dist/lib/cjs/linters/markdownlint-rules/no-soft-break-in-paragraph.d.cts +35 -0
  116. package/dist/lib/cjs/linters/markdownlint-types/@types/markdownlint-cli2-config-schema.d.cts +1344 -0
  117. package/dist/lib/cjs/linters/markdownlint-types/@types/markdownlint-cli2.d.cts +67 -0
  118. package/dist/lib/cjs/linters/markdownlint.cjs +151 -0
  119. package/dist/lib/cjs/linters/markdownlint.d.cts +32 -0
  120. package/dist/lib/cjs/linters/over-exposure.cjs +685 -0
  121. package/dist/lib/cjs/linters/over-exposure.d.cts +357 -0
  122. package/dist/lib/cjs/nano-staged-config.cjs +148 -0
  123. package/dist/lib/cjs/nano-staged-config.d.cts +54 -0
  124. package/dist/lib/cjs/npm-publish.cjs +93 -0
  125. package/dist/lib/cjs/npm-publish.d.cts +19 -0
  126. package/dist/lib/cjs/npm-run.cjs +120 -0
  127. package/dist/lib/cjs/npm-run.d.cts +34 -0
  128. package/dist/lib/cjs/npm.cjs +200 -0
  129. package/dist/lib/cjs/npm.d.cts +168 -0
  130. package/dist/lib/cjs/package-lock-integrity.cjs +134 -0
  131. package/dist/lib/cjs/package-lock-integrity.d.cts +38 -0
  132. package/dist/lib/cjs/package-manager.cjs +291 -0
  133. package/dist/lib/cjs/package-manager.d.cts +93 -0
  134. package/dist/lib/cjs/released-issues.cjs +178 -0
  135. package/dist/lib/cjs/released-issues.d.cts +79 -0
  136. package/dist/lib/cjs/repo-paths.cjs +167 -0
  137. package/dist/lib/cjs/repo-paths.d.cts +318 -0
  138. package/dist/lib/cjs/root.cjs +150 -0
  139. package/dist/lib/cjs/root.d.cts +107 -0
  140. package/dist/lib/cjs/test-runners/index.cjs +102 -0
  141. package/dist/lib/cjs/test-runners/index.d.cts +3 -0
  142. package/dist/lib/cjs/test-runners/vitest-config.cjs +126 -0
  143. package/dist/lib/cjs/test-runners/vitest-config.d.cts +90 -0
  144. package/dist/lib/cjs/test-runners/vitest.cjs +115 -0
  145. package/dist/lib/cjs/test-runners/vitest.d.cts +52 -0
  146. package/dist/lib/cjs/validate-declarations.cjs +120 -0
  147. package/dist/lib/cjs/validate-declarations.d.cts +37 -0
  148. package/dist/lib/cjs/version.cjs +758 -0
  149. package/dist/lib/cjs/version.d.cts +418 -0
  150. package/dist/lib/esm/build.d.mts +59 -0
  151. package/dist/lib/esm/build.mjs +165 -0
  152. package/dist/lib/esm/bundlers/esbuild-impl/change-extension-plugin.d.mts +25 -0
  153. package/dist/lib/esm/bundlers/esbuild-impl/change-extension-plugin.mjs +101 -0
  154. package/dist/lib/esm/bundlers/esbuild-impl/custom-esbuild-options-plugin.d.mts +14 -0
  155. package/dist/lib/esm/bundlers/esbuild-impl/custom-esbuild-options-plugin.mjs +59 -0
  156. package/dist/lib/esm/bundlers/esbuild-impl/fix-esm-plugin.d.mts +13 -0
  157. package/dist/lib/esm/bundlers/esbuild-impl/fix-esm-plugin.mjs +69 -0
  158. package/dist/lib/esm/bundlers/esbuild-impl/index.d.mts +6 -0
  159. package/dist/lib/esm/bundlers/esbuild-impl/index.mjs +60 -0
  160. package/dist/lib/esm/bundlers/esbuild-impl/preprocess-plugin.d.mts +143 -0
  161. package/dist/lib/esm/bundlers/esbuild-impl/preprocess-plugin.mjs +176 -0
  162. package/dist/lib/esm/bundlers/esbuild-impl/svelte-wrapper-plugin.d.mts +14 -0
  163. package/dist/lib/esm/bundlers/esbuild-impl/svelte-wrapper-plugin.mjs +82 -0
  164. package/dist/lib/esm/bundlers/index.d.mts +2 -0
  165. package/dist/lib/esm/bundlers/index.mjs +52 -0
  166. package/dist/lib/esm/check-project-types.d.mts +92 -0
  167. package/dist/lib/esm/check-project-types.mjs +123 -0
  168. package/dist/lib/esm/cli-utils.d.mts +123 -0
  169. package/dist/lib/esm/cli-utils.mjs +225 -0
  170. package/dist/lib/esm/code-generator.d.mts +14 -0
  171. package/dist/lib/esm/code-generator.mjs +59 -0
  172. package/dist/lib/esm/commitlint-config.d.mts +14 -0
  173. package/dist/lib/esm/commitlint-config.mjs +79 -0
  174. package/dist/lib/esm/commitlint-forbidden-patterns.d.mts +37 -0
  175. package/dist/lib/esm/commitlint-forbidden-patterns.mjs +75 -0
  176. package/dist/lib/esm/commitlint-spellcheck-header.d.mts +40 -0
  177. package/dist/lib/esm/commitlint-spellcheck-header.mjs +87 -0
  178. package/dist/lib/esm/env-toggle.d.mts +42 -0
  179. package/dist/lib/esm/env-toggle.mjs +84 -0
  180. package/dist/lib/esm/exec.d.mts +162 -0
  181. package/dist/lib/esm/exec.mjs +410 -0
  182. package/dist/lib/esm/forbidden-patterns.d.mts +57 -0
  183. package/dist/lib/esm/forbidden-patterns.mjs +108 -0
  184. package/dist/lib/esm/formatters/dprint.d.mts +33 -0
  185. package/dist/lib/esm/formatters/dprint.mjs +75 -0
  186. package/dist/lib/esm/formatters/index.d.mts +2 -0
  187. package/dist/lib/esm/formatters/index.mjs +52 -0
  188. package/dist/lib/esm/fs.d.mts +80 -0
  189. package/dist/lib/esm/fs.mjs +89 -0
  190. package/dist/lib/esm/gate.d.mts +93 -0
  191. package/dist/lib/esm/gate.mjs +106 -0
  192. package/dist/lib/esm/git.d.mts +37 -0
  193. package/dist/lib/esm/git.mjs +72 -0
  194. package/dist/lib/esm/index.d.mts +35 -0
  195. package/dist/lib/esm/index.mjs +110 -0
  196. package/dist/lib/esm/json.d.mts +102 -0
  197. package/dist/lib/esm/json.mjs +106 -0
  198. package/dist/lib/esm/library-build.d.mts +97 -0
  199. package/dist/lib/esm/library-build.mjs +435 -0
  200. package/dist/lib/esm/linters/cspell-content.d.mts +46 -0
  201. package/dist/lib/esm/linters/cspell-content.mjs +87 -0
  202. package/dist/lib/esm/linters/cspell.d.mts +36 -0
  203. package/dist/lib/esm/linters/cspell.mjs +69 -0
  204. package/dist/lib/esm/linters/eslint-agnostic-core-boundary.d.mts +49 -0
  205. package/dist/lib/esm/linters/eslint-agnostic-core-boundary.mjs +57 -0
  206. package/dist/lib/esm/linters/eslint-config.d.mts +123 -0
  207. package/dist/lib/esm/linters/eslint-config.mjs +1022 -0
  208. package/dist/lib/esm/linters/eslint-no-restricted-syntax.d.mts +27 -0
  209. package/dist/lib/esm/linters/eslint-no-restricted-syntax.mjs +93 -0
  210. package/dist/lib/esm/linters/eslint-rules/in-house-plugin.d.mts +26 -0
  211. package/dist/lib/esm/linters/eslint-rules/in-house-plugin.mjs +77 -0
  212. package/dist/lib/esm/linters/eslint-rules/index.d.mts +13 -0
  213. package/dist/lib/esm/linters/eslint-rules/index.mjs +74 -0
  214. package/dist/lib/esm/linters/eslint-rules/no-async-callback-to-unsafe-return.d.mts +10 -0
  215. package/dist/lib/esm/linters/eslint-rules/no-async-callback-to-unsafe-return.mjs +144 -0
  216. package/dist/lib/esm/linters/eslint-rules/no-unresolved-jsdoc-link.d.mts +10 -0
  217. package/dist/lib/esm/linters/eslint-rules/no-unresolved-jsdoc-link.mjs +277 -0
  218. package/dist/lib/esm/linters/eslint-rules/no-unused-params-members.d.mts +41 -0
  219. package/dist/lib/esm/linters/eslint-rules/no-unused-params-members.mjs +227 -0
  220. package/dist/lib/esm/linters/eslint-rules/no-used-underscore-variables.d.mts +20 -0
  221. package/dist/lib/esm/linters/eslint-rules/no-used-underscore-variables.mjs +96 -0
  222. package/dist/lib/esm/linters/eslint-rules/params-options-name-match.d.mts +36 -0
  223. package/dist/lib/esm/linters/eslint-rules/params-options-name-match.mjs +179 -0
  224. package/dist/lib/esm/linters/eslint-rules/prefer-noop-async.d.mts +10 -0
  225. package/dist/lib/esm/linters/eslint-rules/prefer-noop-async.mjs +88 -0
  226. package/dist/lib/esm/linters/eslint-rules/readonly-params-options-result-members.d.mts +20 -0
  227. package/dist/lib/esm/linters/eslint-rules/readonly-params-options-result-members.mjs +87 -0
  228. package/dist/lib/esm/linters/eslint-rules/require-method-template.d.mts +14 -0
  229. package/dist/lib/esm/linters/eslint-rules/require-method-template.mjs +142 -0
  230. package/dist/lib/esm/linters/eslint-rules/require-super-call.d.mts +10 -0
  231. package/dist/lib/esm/linters/eslint-rules/require-super-call.mjs +183 -0
  232. package/dist/lib/esm/linters/eslint-rules/rule-tester-helper.d.mts +18 -0
  233. package/dist/lib/esm/linters/eslint-rules/rule-tester-helper.mjs +55 -0
  234. package/dist/lib/esm/linters/eslint-rules/ts-estree-node.d.mts +23 -0
  235. package/dist/lib/esm/linters/eslint-rules/ts-estree-node.mjs +55 -0
  236. package/dist/lib/esm/linters/eslint-types/@types/@eslint-community__eslint-plugin-eslint-comments__configs.d.mts +20 -0
  237. package/dist/lib/esm/linters/eslint-types/@types/eslint-plugin-verify-tsdoc.d.mts +17 -0
  238. package/dist/lib/esm/linters/eslint.d.mts +35 -0
  239. package/dist/lib/esm/linters/eslint.mjs +88 -0
  240. package/dist/lib/esm/linters/index.d.mts +15 -0
  241. package/dist/lib/esm/linters/index.mjs +78 -0
  242. package/dist/lib/esm/linters/lint-ignores.d.mts +30 -0
  243. package/dist/lib/esm/linters/lint-ignores.mjs +54 -0
  244. package/dist/lib/esm/linters/markdownlint-cli2-config.d.mts +11 -0
  245. package/dist/lib/esm/linters/markdownlint-cli2-config.mjs +122 -0
  246. package/dist/lib/esm/linters/markdownlint-content.d.mts +47 -0
  247. package/dist/lib/esm/linters/markdownlint-content.mjs +83 -0
  248. package/dist/lib/esm/linters/markdownlint-ignores.d.mts +35 -0
  249. package/dist/lib/esm/linters/markdownlint-ignores.mjs +57 -0
  250. package/dist/lib/esm/linters/markdownlint-rules/index.d.mts +2 -0
  251. package/dist/lib/esm/linters/markdownlint-rules/index.mjs +52 -0
  252. package/dist/lib/esm/linters/markdownlint-rules/no-soft-break-in-paragraph.d.mts +35 -0
  253. package/dist/lib/esm/linters/markdownlint-rules/no-soft-break-in-paragraph.mjs +114 -0
  254. package/dist/lib/esm/linters/markdownlint-types/@types/markdownlint-cli2-config-schema.d.mts +1344 -0
  255. package/dist/lib/esm/linters/markdownlint-types/@types/markdownlint-cli2.d.mts +67 -0
  256. package/dist/lib/esm/linters/markdownlint.d.mts +32 -0
  257. package/dist/lib/esm/linters/markdownlint.mjs +124 -0
  258. package/dist/lib/esm/linters/over-exposure.d.mts +357 -0
  259. package/dist/lib/esm/linters/over-exposure.mjs +672 -0
  260. package/dist/lib/esm/nano-staged-config.d.mts +54 -0
  261. package/dist/lib/esm/nano-staged-config.mjs +103 -0
  262. package/dist/lib/esm/npm-publish.d.mts +19 -0
  263. package/dist/lib/esm/npm-publish.mjs +56 -0
  264. package/dist/lib/esm/npm-run.d.mts +34 -0
  265. package/dist/lib/esm/npm-run.mjs +81 -0
  266. package/dist/lib/esm/npm.d.mts +168 -0
  267. package/dist/lib/esm/npm.mjs +155 -0
  268. package/dist/lib/esm/package-lock-integrity.d.mts +38 -0
  269. package/dist/lib/esm/package-lock-integrity.mjs +99 -0
  270. package/dist/lib/esm/package-manager.d.mts +93 -0
  271. package/dist/lib/esm/package-manager.mjs +245 -0
  272. package/dist/lib/esm/released-issues.d.mts +79 -0
  273. package/dist/lib/esm/released-issues.mjs +143 -0
  274. package/dist/lib/esm/repo-paths.d.mts +318 -0
  275. package/dist/lib/esm/repo-paths.mjs +130 -0
  276. package/dist/lib/esm/root.d.mts +107 -0
  277. package/dist/lib/esm/root.mjs +115 -0
  278. package/dist/lib/esm/test-runners/index.d.mts +3 -0
  279. package/dist/lib/esm/test-runners/index.mjs +54 -0
  280. package/dist/lib/esm/test-runners/vitest-config.d.mts +90 -0
  281. package/dist/lib/esm/test-runners/vitest-config.mjs +86 -0
  282. package/dist/lib/esm/test-runners/vitest.d.mts +52 -0
  283. package/dist/lib/esm/test-runners/vitest.mjs +76 -0
  284. package/dist/lib/esm/validate-declarations.d.mts +37 -0
  285. package/dist/lib/esm/validate-declarations.mjs +87 -0
  286. package/dist/lib/esm/version.d.mts +418 -0
  287. package/dist/lib/esm/version.mjs +723 -0
  288. package/formatters/dprint/package.json +6 -0
  289. package/formatters/index/package.json +6 -0
  290. package/formatters/package.json +6 -0
  291. package/linters/cspell/package.json +6 -0
  292. package/linters/cspell-content/package.json +6 -0
  293. package/linters/eslint/package.json +6 -0
  294. package/linters/eslint-agnostic-core-boundary/package.json +6 -0
  295. package/linters/eslint-config/package.json +6 -0
  296. package/linters/eslint-no-restricted-syntax/package.json +6 -0
  297. package/linters/eslint-rules/in-house-plugin/package.json +6 -0
  298. package/linters/eslint-rules/index/package.json +6 -0
  299. package/linters/eslint-rules/no-async-callback-to-unsafe-return/package.json +6 -0
  300. package/linters/eslint-rules/no-unresolved-jsdoc-link/package.json +6 -0
  301. package/linters/eslint-rules/no-unused-params-members/package.json +6 -0
  302. package/linters/eslint-rules/no-used-underscore-variables/package.json +6 -0
  303. package/linters/eslint-rules/package.json +6 -0
  304. package/linters/eslint-rules/params-options-name-match/package.json +6 -0
  305. package/linters/eslint-rules/prefer-noop-async/package.json +6 -0
  306. package/linters/eslint-rules/readonly-params-options-result-members/package.json +6 -0
  307. package/linters/eslint-rules/require-method-template/package.json +6 -0
  308. package/linters/eslint-rules/require-super-call/package.json +6 -0
  309. package/linters/eslint-rules/rule-tester-helper/package.json +6 -0
  310. package/linters/eslint-rules/ts-estree-node/package.json +6 -0
  311. package/linters/eslint-types/@types/@eslint-community__eslint-plugin-eslint-comments__configs/package.json +4 -0
  312. package/linters/eslint-types/@types/eslint-plugin-verify-tsdoc/package.json +4 -0
  313. package/linters/index/package.json +6 -0
  314. package/linters/lint-ignores/package.json +6 -0
  315. package/linters/markdownlint/package.json +6 -0
  316. package/linters/markdownlint-cli2-config/package.json +6 -0
  317. package/linters/markdownlint-content/package.json +6 -0
  318. package/linters/markdownlint-ignores/package.json +6 -0
  319. package/linters/markdownlint-rules/index/package.json +6 -0
  320. package/linters/markdownlint-rules/no-soft-break-in-paragraph/package.json +6 -0
  321. package/linters/markdownlint-rules/package.json +6 -0
  322. package/linters/markdownlint-types/@types/markdownlint-cli2/package.json +4 -0
  323. package/linters/markdownlint-types/@types/markdownlint-cli2-config-schema/package.json +4 -0
  324. package/linters/over-exposure/package.json +6 -0
  325. package/linters/package.json +6 -0
  326. package/package.json +329 -13
  327. package/test-runners/index/package.json +6 -0
  328. package/test-runners/package.json +6 -0
  329. package/test-runners/vitest/package.json +6 -0
  330. package/test-runners/vitest-config/package.json +6 -0
@@ -0,0 +1,357 @@
1
+ /// <reference path="../index.d.cts" />
2
+ /**
3
+ * @file
4
+ *
5
+ * Over-exposure analyzer.
6
+ *
7
+ * Finds declarations exposed more broadly than their references require, so the exposure can be
8
+ * tightened:
9
+ *
10
+ * - `export`ed symbols referenced only within their own file — the `export` can be dropped.
11
+ * - `public` class members referenced only inside their own class — they can be `private`.
12
+ * - `public` class members referenced only inside their own class and its subclasses — they can be
13
+ * `protected`.
14
+ * - `protected` class members referenced only inside their own class — they can be `private`.
15
+ *
16
+ * The analysis is whole-program and type-aware: it uses the TypeScript language service's
17
+ * find-all-references to locate every use of each declaration, then classifies the tightest
18
+ * exposure that still covers all references. Because `findReferences` does not link a string-literal
19
+ * argument back to a member declaration when the parameter is a conditional/mapped key type (e.g.
20
+ * `bind(component, 'someSetting')` where the key is typed `ConditionalKeys<Settings, …>`), member
21
+ * analysis additionally treats a string literal whose text equals the member name as a reference —
22
+ * but only when its contextual type is a string-literal type (or union of them) all of whose members
23
+ * are keys of the declaring class, so incidental same-named strings (`console.log('name')`) are not
24
+ * miscounted. Members invoked by the framework via registration
25
+ * rather than by visible references (Obsidian lifecycle hooks, settings-tab `display`, etc.) are
26
+ * excluded via {@link LIFECYCLE_ALLOWLIST}, as are `override` and `static` members whose exposure is
27
+ * constrained by a base declaration. ECMAScript hard-private members (`#name`) are also excluded —
28
+ * they are already maximally private and cannot carry a visibility modifier. A declaration carrying
29
+ * a TSDoc (`/** … *\/`) documentation comment is likewise excluded — whether a top-level `export` or
30
+ * a class member, documenting it is a deliberate signal that it is part of the intended public API,
31
+ * regardless of where it currently happens to be referenced.
32
+ *
33
+ * A member referenced only from test files is reported with {@link OverExposureFinding.isForcedByTestOnly}
34
+ * set, surfacing members widened purely for testability — the canonical case for extracting logic
35
+ * into an independently testable component instead.
36
+ *
37
+ * Beyond reporting, passing `shouldFix` to {@link findOverExposure} / {@link analyzeOverExposure}
38
+ * rewrites the source in place: dropping the `export` keyword, or replacing/inserting a `private`
39
+ * or `protected` modifier. Each finding then carries {@link OverExposureFinding.wasFixed} /
40
+ * {@link OverExposureFinding.skipReason}. Changes that cannot be safely automated — those forced
41
+ * only by test references, decorated members, or an `export` shared with a still-exported sibling —
42
+ * are reported as skipped and left untouched.
43
+ *
44
+ * Additionally passing `shouldForce` (only meaningful together with `shouldFix`) tightens the
45
+ * declarations held wide purely by test references too — the production half of the canonical
46
+ * test-only migration: the member becomes `private` / the `export` is dropped, leaving only the
47
+ * test to switch to a cast-based access. Decorated members and exports shared with a still-exported
48
+ * sibling stay skipped even under `shouldForce`, because no edit can be applied safely.
49
+ */
50
+ import type { CompilerOptions, LanguageService, LanguageServiceHost } from 'typescript' with { 'resolution-mode': 'import' };
51
+ /**
52
+ * Parameters for {@link analyzeOverExposure}.
53
+ */
54
+ export interface AnalyzeOverExposureParams {
55
+ /**
56
+ The language service to query for references and types.
57
+ */
58
+ readonly languageService: LanguageService;
59
+ /**
60
+ * Optional callback invoked once per analyzed source file, before that file is processed. The
61
+ * whole-program reference analysis is slow, so this lets callers report live progress instead of
62
+ * appearing to hang.
63
+ */
64
+ readonly onProgress?: (progress: OverExposureProgress) => void;
65
+ /**
66
+ * When `true`, each fixable finding is tightened in place via {@link writeFile} (which must then
67
+ * be provided), and the returned findings carry {@link OverExposureFinding.wasFixed} /
68
+ * {@link OverExposureFinding.skipReason}. When `false` or omitted, the analysis only reports.
69
+ *
70
+ * @default `false`
71
+ */
72
+ readonly shouldFix?: boolean | undefined;
73
+ /**
74
+ * When `true` (only meaningful together with {@link shouldFix}), declarations held wide purely by
75
+ * test references are tightened too, instead of being skipped with a `test-only`
76
+ * {@link OverExposureFinding.skipReason}. Decorated members and exports shared with a
77
+ * still-exported sibling stay skipped regardless, because no edit can be applied safely.
78
+ *
79
+ * @default `false`
80
+ */
81
+ readonly shouldForce?: boolean | undefined;
82
+ /**
83
+ * Absolute (canonical) path of the project's `src` folder. Only declarations in non-test files
84
+ * under this folder are analyzed; declarations elsewhere (test files, dependencies) are ignored
85
+ * but still counted as reference sites.
86
+ */
87
+ readonly srcFolder: string;
88
+ /**
89
+ * Writes the tightened contents of a changed file back to disk. Required when {@link shouldFix}
90
+ * is `true`; ignored otherwise.
91
+ *
92
+ * @param path - Absolute path of the file to write (original casing, as stored in the program).
93
+ * @param content - The full new file contents.
94
+ */
95
+ readonly writeFile?: (path: string, content: string) => void;
96
+ }
97
+ /**
98
+ * Parameters for {@link createLanguageServiceHost}.
99
+ */
100
+ export interface CreateLanguageServiceHostParams {
101
+ /**
102
+ The compiler options.
103
+ */
104
+ readonly compilerOptions: CompilerOptions;
105
+ /**
106
+ The files to include in the program.
107
+ */
108
+ readonly fileNames: readonly string[];
109
+ /**
110
+ The file-system operations used to read sources.
111
+ */
112
+ readonly fileSystem: OverExposureFileSystem;
113
+ }
114
+ /**
115
+ * Parameters for {@link createProjectLanguageService}.
116
+ */
117
+ export interface CreateProjectLanguageServiceParams {
118
+ /**
119
+ Absolute path to the project's `tsconfig.json`.
120
+ */
121
+ readonly tsConfigPath: string;
122
+ }
123
+ /**
124
+ * The exposure level a declaration currently has.
125
+ */
126
+ export type CurrentExposure = 'export' | 'protected' | 'public';
127
+ /**
128
+ * Parameters for {@link findOverExposure}.
129
+ */
130
+ export interface FindOverExposureParams {
131
+ /**
132
+ * Optional callback invoked once per analyzed source file, for live progress reporting. Forwarded
133
+ * to {@link analyzeOverExposure}.
134
+ */
135
+ readonly onProgress?: (progress: OverExposureProgress) => void;
136
+ /**
137
+ Absolute path to the project root (the folder containing `tsconfig.json` and `src`).
138
+ */
139
+ readonly projectFolder: string;
140
+ /**
141
+ * When `true`, fixable findings are tightened in place on disk (the `export` keyword is dropped,
142
+ * or a `private` / `protected` modifier is inserted/replaced). When `false` or omitted, the
143
+ * project is only analyzed.
144
+ *
145
+ * @default `false`
146
+ */
147
+ readonly shouldFix?: boolean | undefined;
148
+ /**
149
+ * When `true` (only meaningful together with {@link shouldFix}), declarations held wide purely by
150
+ * test references are tightened too, instead of being skipped. Decorated members and exports
151
+ * shared with a still-exported sibling stay skipped regardless. Forwarded to
152
+ * {@link analyzeOverExposure}.
153
+ *
154
+ * @default `false`
155
+ */
156
+ readonly shouldForce?: boolean | undefined;
157
+ }
158
+ /**
159
+ * Options for {@link formatOverExposureFindings}.
160
+ */
161
+ export interface FormatOverExposureFindingsOptions {
162
+ /**
163
+ * When set, file paths in the report are rendered relative to this folder (typically the current
164
+ * working directory) instead of as absolute paths. Paths outside the folder stay absolute.
165
+ */
166
+ readonly baseFolder?: string;
167
+ }
168
+ /**
169
+ * The subset of file-system operations the language-service host needs. Injecting this (rather than
170
+ * always using `typescript`'s `sys`) lets tests drive the analyzer against in-memory sources with no
171
+ * real file-system access.
172
+ */
173
+ export interface OverExposureFileSystem {
174
+ /**
175
+ * Checks whether a directory exists.
176
+ *
177
+ * @param path - Directory path.
178
+ * @returns `true` when the directory exists.
179
+ */
180
+ directoryExists: (path: string) => boolean;
181
+ /**
182
+ * Checks whether a file exists.
183
+ *
184
+ * @param path - File path.
185
+ * @returns `true` when the file exists.
186
+ */
187
+ fileExists: (path: string) => boolean;
188
+ /**
189
+ * Resolves the directory that relative paths are resolved against.
190
+ *
191
+ * @returns The current working directory.
192
+ */
193
+ getCurrentDirectory: () => string;
194
+ /**
195
+ * Lists the immediate subdirectories of a directory.
196
+ *
197
+ * @param path - Directory path.
198
+ * @returns The immediate subdirectory names.
199
+ */
200
+ getDirectories: (path: string) => string[];
201
+ /**
202
+ * Lists the files under a directory, filtered by extension and include/exclude patterns.
203
+ *
204
+ * @param path - Root directory.
205
+ * @param extensions - Extensions to include.
206
+ * @param exclude - Patterns to exclude.
207
+ * @param include - Patterns to include.
208
+ * @param depth - Maximum recursion depth.
209
+ * @returns The matching file paths.
210
+ */
211
+ readDirectory: (path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number) => string[];
212
+ /**
213
+ * Reads a file as text.
214
+ *
215
+ * @param path - File path.
216
+ * @returns The file contents, or `undefined` when absent.
217
+ */
218
+ readFile: (path: string) => string | undefined;
219
+ }
220
+ /**
221
+ * A single over-exposed declaration.
222
+ */
223
+ export interface OverExposureFinding {
224
+ /**
225
+ 1-based column of the declaration's name.
226
+ */
227
+ readonly column: number;
228
+ /**
229
+ The current exposure level.
230
+ */
231
+ readonly currentExposure: CurrentExposure;
232
+ /**
233
+ Absolute path of the file declaring the symbol.
234
+ */
235
+ readonly filePath: string;
236
+ /**
237
+ `true` when the declaration has no references at all (besides itself).
238
+ */
239
+ readonly hasNoReferences: boolean;
240
+ /**
241
+ * `true` when the declaration would qualify for a tighter exposure if not for references coming
242
+ * exclusively from test files — i.e. it is exposed purely for testability.
243
+ */
244
+ readonly isForcedByTestOnly: boolean;
245
+ /**
246
+ `true` for a class member, `false` for a top-level export.
247
+ */
248
+ readonly isMember: boolean;
249
+ /**
250
+ 1-based line of the declaration's name.
251
+ */
252
+ readonly line: number;
253
+ /**
254
+ The declared name.
255
+ */
256
+ readonly name: string;
257
+ /**
258
+ * In a fix run, why this finding was left untouched instead of tightened; `null` when it was
259
+ * fixed or when the analysis only reported (`shouldFix` off).
260
+ */
261
+ readonly skipReason: null | OverExposureSkipReason;
262
+ /**
263
+ The exposure the declaration could be tightened to.
264
+ */
265
+ readonly suggestedExposure: SuggestedExposure;
266
+ /**
267
+ `true` when a fix run tightened this declaration in place. Always `false` in a report run.
268
+ */
269
+ readonly wasFixed: boolean;
270
+ }
271
+ /**
272
+ * Progress reported while analyzing a project, one event per analyzed source file.
273
+ */
274
+ export interface OverExposureProgress {
275
+ /**
276
+ Number of source files fully analyzed before the current one (0-based).
277
+ */
278
+ readonly analyzedFileCount: number;
279
+ /**
280
+ Absolute (canonical) path of the source file about to be analyzed.
281
+ */
282
+ readonly currentFilePath: string;
283
+ /**
284
+ Total number of source files that will be analyzed.
285
+ */
286
+ readonly totalFileCount: number;
287
+ }
288
+ /**
289
+ * Why a fix run left a finding untouched:
290
+ *
291
+ * - `decorated` — the member carries a decorator, so the modifier insertion point is ambiguous.
292
+ * - `shared-export` — the `export` keyword is shared with a still-exported sibling declarator.
293
+ * - `test-only` — the declaration is exposed purely for tests, so tightening would break the test.
294
+ */
295
+ export type OverExposureSkipReason = 'decorated' | 'shared-export' | 'test-only';
296
+ /**
297
+ * The (tighter) exposure level a declaration could be reduced to.
298
+ */
299
+ export type SuggestedExposure = 'file-local' | 'private' | 'protected';
300
+ /**
301
+ * Lifecycle and framework members invoked by Obsidian or a base class via registration rather than
302
+ * by references the language service can see. Tightening these would break the framework contract,
303
+ * so they are never reported.
304
+ */
305
+ export declare const LIFECYCLE_ALLOWLIST: ReadonlySet<string>;
306
+ /**
307
+ * Analyzes a project (already loaded into a language service) for over-exposed declarations, and —
308
+ * when {@link AnalyzeOverExposureParams.shouldFix} is set — tightens every fixable finding in place
309
+ * via {@link AnalyzeOverExposureParams.writeFile}. Findings that cannot be safely automated (exposed
310
+ * only for tests, decorated, or sharing an `export` keyword with a still-exported sibling) carry a
311
+ * {@link OverExposureFinding.skipReason} and are left untouched — unless
312
+ * {@link AnalyzeOverExposureParams.shouldForce} is set, which additionally tightens the test-only
313
+ * findings (decorated and shared-export ones still stay skipped).
314
+ *
315
+ * @param params - The {@link AnalyzeOverExposureParams}.
316
+ * @returns The over-exposed declarations, in discovery order.
317
+ */
318
+ export declare function analyzeOverExposure(params: AnalyzeOverExposureParams): OverExposureFinding[];
319
+ /**
320
+ * Builds a {@link LanguageServiceHost} backed by an explicit file list and file system.
321
+ *
322
+ * @param params - The {@link CreateLanguageServiceHostParams}.
323
+ * @returns The language-service host.
324
+ */
325
+ export declare function createLanguageServiceHost(params: CreateLanguageServiceHostParams): LanguageServiceHost;
326
+ /**
327
+ * Builds a language service over every file in a project's `tsconfig.json`.
328
+ *
329
+ * @param params - The {@link CreateProjectLanguageServiceParams}.
330
+ * @returns A language service ready for {@link analyzeOverExposure}.
331
+ */
332
+ export declare function createProjectLanguageService(params: CreateProjectLanguageServiceParams): LanguageService;
333
+ /**
334
+ * Finds over-exposed declarations in a project on disk. When
335
+ * {@link FindOverExposureParams.shouldFix} is set, each fixable finding is also tightened in place
336
+ * (rewriting the affected source files via `typescript`'s `sys.writeFile`).
337
+ *
338
+ * @param params - The {@link FindOverExposureParams}.
339
+ * @returns The over-exposed declarations.
340
+ */
341
+ export declare function findOverExposure(params: FindOverExposureParams): OverExposureFinding[];
342
+ /**
343
+ * Formats over-exposure findings as a human-readable report, using the grouped layout of ESLint's
344
+ * `stylish` formatter. Findings are grouped by file and sorted by line: each file is rendered as a
345
+ * `path` header line, followed by one indented ` line:column change -- reason` row per finding (the
346
+ * `line:column` is right-padded so the rows align within a file). Terminals such as VS Code render
347
+ * each indented `line:column` as a clickable link — resolved against the file header above it — that
348
+ * jumps straight to the declaration. File groups are separated by a blank line. In a fix run (findings
349
+ * carrying {@link OverExposureFinding.wasFixed} / {@link OverExposureFinding.skipReason}) each change
350
+ * row is suffixed with `[fixed]` or `[skipped: …]`, and the trailing summary appends the fixed/skipped
351
+ * counts.
352
+ *
353
+ * @param findings - The findings to format.
354
+ * @param options - The {@link FormatOverExposureFindingsOptions}.
355
+ * @returns The report text. Empty-finding input yields a single "no findings" line.
356
+ */
357
+ export declare function formatOverExposureFindings(findings: readonly OverExposureFinding[], options?: FormatOverExposureFindingsOptions): string;
@@ -0,0 +1,148 @@
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 __create = Object.create;
63
+ var __defProp = Object.defineProperty;
64
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
65
+ var __getOwnPropNames = Object.getOwnPropertyNames;
66
+ var __getProtoOf = Object.getPrototypeOf;
67
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
68
+ var __export = (target, all) => {
69
+ for (var name in all)
70
+ __defProp(target, name, { get: all[name], enumerable: true });
71
+ };
72
+ var __copyProps = (to, from, except, desc) => {
73
+ if (from && typeof from === "object" || typeof from === "function") {
74
+ for (let key of __getOwnPropNames(from))
75
+ if (!__hasOwnProp.call(to, key) && key !== except)
76
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
77
+ }
78
+ return to;
79
+ };
80
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
81
+ // If the importer is in node compatibility mode or this is not an ESM
82
+ // file that has been converted to a CommonJS file using a Babel-
83
+ // compatible transform (i.e. "__esModule" has not been set), then set
84
+ // "default" to the CommonJS "module.exports" for node compatibility.
85
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
86
+ mod
87
+ ));
88
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
89
+ var nano_staged_config_exports = {};
90
+ __export(nano_staged_config_exports, {
91
+ getNanoStagedConfig: () => getNanoStagedConfig,
92
+ obsidianDevUtilsConfig: () => obsidianDevUtilsConfig
93
+ });
94
+ module.exports = __toCommonJS(nano_staged_config_exports);
95
+ var import_node_process = __toESM(__extractDefault(require('node:process')), 1);
96
+ var import_env_toggle = require('./env-toggle.cjs');
97
+ var import_package_manager = require('./package-manager.cjs');
98
+ const PACKAGE_MANAGER_RUN_COMMAND = (0, import_package_manager.getPackageManagerRunCommand)().join(" ");
99
+ const SPELLCHECK_COMMAND = `${PACKAGE_MANAGER_RUN_COMMAND} spellcheck --`;
100
+ const WRITER_TASKS = {
101
+ "*.{ts,tsx,mts}": [
102
+ `${PACKAGE_MANAGER_RUN_COMMAND} lint:fix --`,
103
+ `${PACKAGE_MANAGER_RUN_COMMAND} format --`
104
+ ],
105
+ "*.md": [
106
+ `${PACKAGE_MANAGER_RUN_COMMAND} lint:md:fix --`
107
+ ]
108
+ };
109
+ const obsidianDevUtilsConfig = partitionSpellcheck(WRITER_TASKS);
110
+ const NANO_STAGED_ENV_VARIABLE = "NANO_STAGED";
111
+ function getNanoStagedConfig(options) {
112
+ (0, import_env_toggle.loadEnvFileIfExists)();
113
+ if ((0, import_env_toggle.isEnvVariableOff)(NANO_STAGED_ENV_VARIABLE)) {
114
+ import_node_process.default.stdout.write(`nano-staged: skipped (${NANO_STAGED_ENV_VARIABLE} is off).
115
+ `);
116
+ import_node_process.default.exit(0);
117
+ }
118
+ const additionalWriterTasks = options?.additionalWriterTasks ?? {};
119
+ if (Object.keys(additionalWriterTasks).length === 0) {
120
+ return obsidianDevUtilsConfig;
121
+ }
122
+ const duplicatePattern = Object.keys(additionalWriterTasks).find((pattern) => Object.hasOwn(WRITER_TASKS, pattern));
123
+ if (duplicatePattern !== void 0) {
124
+ throw new Error(`nano-staged writer pattern '${duplicatePattern}' is already a shared writer pattern.`);
125
+ }
126
+ return partitionSpellcheck({ ...WRITER_TASKS, ...additionalWriterTasks });
127
+ }
128
+ function partitionSpellcheck(writerTasks) {
129
+ const patterns = Object.keys(writerTasks);
130
+ const patternWithSlash = patterns.find((pattern) => pattern.includes("/"));
131
+ if (patternWithSlash !== void 0) {
132
+ throw new Error(`nano-staged writer pattern '${patternWithSlash}' contains '/', which the spellcheck partition cannot express.`);
133
+ }
134
+ const complementPattern = `!(${patterns.map((pattern) => `${pattern}!(?)`).join("|")})*`;
135
+ const config = {
136
+ [complementPattern]: [SPELLCHECK_COMMAND]
137
+ };
138
+ for (const [pattern, commands] of Object.entries(writerTasks)) {
139
+ config[pattern] = [...commands, SPELLCHECK_COMMAND];
140
+ }
141
+ return config;
142
+ }
143
+ // Annotate the CommonJS export names for ESM import in node:
144
+ 0 && (module.exports = {
145
+ getNanoStagedConfig,
146
+ obsidianDevUtilsConfig
147
+ });
148
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vc3JjL25hbm8tc3RhZ2VkLWNvbmZpZy50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIFNoYXJlZCBu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UFNLCtCQUErQixnQkFBZ0IsdUNBQXVDO0FBQUEsRUFDeEc7QUFFQSxTQUFPLG9CQUFvQixFQUFFLEdBQUcsY0FBYyxHQUFHLHNCQUFzQixDQUFDO0FBQzFFO0FBd0JBLFNBQVMsb0JBQW9CLGFBQW9GO0FBQy9HLFFBQU0sV0FBVyxPQUFPLEtBQUssV0FBVztBQUN4QyxRQUFNLG1CQUFtQixTQUFTLEtBQUssQ0FBQyxZQUFZLFFBQVEsU0FBUyxHQUFHLENBQUM7QUFDekUsTUFBSSxxQkFBcUIsUUFBVztBQUNsQyxVQUFNLElBQUksTUFBTSwrQkFBK0IsZ0JBQWdCLGdFQUFnRTtBQUFBLEVBQ2pJO0FBRUEsUUFBTSxvQkFBb0IsS0FBSyxTQUFTLElBQUksQ0FBQyxZQUFZLEdBQUcsT0FBTyxNQUFNLEVBQUUsS0FBSyxHQUFHLENBQUM7QUFDcEYsUUFBTSxTQUFtQztBQUFBLElBQ3ZDLENBQUMsaUJBQWlCLEdBQUcsQ0FBQyxrQkFBa0I7QUFBQSxFQUMxQztBQUVBLGFBQVcsQ0FBQyxTQUFTLFFBQVEsS0FBSyxPQUFPLFFBQVEsV0FBVyxHQUFHO0FBQzdELFdBQU8sT0FBTyxJQUFJLENBQUMsR0FBRyxVQUFVLGtCQUFrQjtBQUFBLEVBQ3BEO0FBRUEsU0FBTztBQUNUOyIsCiAgIm5hbWVzIjogWyJwcm9jZXNzIl0KfQo=
@@ -0,0 +1,54 @@
1
+ /// <reference path="./index.d.cts" />
2
+ /**
3
+ * @file
4
+ *
5
+ * Shared nano-staged configuration for pre-commit hooks.
6
+ */
7
+ /**
8
+ * Options for {@link getNanoStagedConfig}.
9
+ */
10
+ export interface GetNanoStagedConfigOptions {
11
+ /**
12
+ * Repo-specific file-rewriting tasks, keyed by the nano-staged pattern that claims their files.
13
+ *
14
+ * Each gets spellcheck appended and its files removed from the spellcheck-only key, exactly like the shared
15
+ * writers. A pattern must not contain `/`, and must not repeat a shared writer pattern.
16
+ */
17
+ readonly additionalWriterTasks?: Readonly<Record<string, readonly string[]>>;
18
+ }
19
+ /**
20
+ * Nano-staged configuration that runs file-based lint, format, and spellcheck on staged files.
21
+ *
22
+ * Only includes tools that can operate on individual files. Whole-project checks
23
+ * (TypeScript compilation, unit tests) are left to CI.
24
+ *
25
+ * Commands run through the package manager that owns the tree — `npm run ... --`, `bun run ... --`, and
26
+ * so on — so nano-staged file paths are forwarded as CLI arguments.
27
+ *
28
+ * Spellcheck is partitioned across the keys rather than given a catch-all `'*'` key (see
29
+ * `partitionSpellcheck`). A repo adding a file-rewriting task of its own passes it to
30
+ * {@link getNanoStagedConfig} as `additionalWriterTasks` rather than spreading this object and adding a key,
31
+ * which would reintroduce the overlap for that key's files.
32
+ */
33
+ export declare const obsidianDevUtilsConfig: Record<string, string[]>;
34
+ /**
35
+ * Resolves the nano-staged configuration to use, honoring a per-developer opt-out.
36
+ *
37
+ * Loads a gitignored `.env` if present, then — when `NANO_STAGED` is set to an off value (`0`, `false`,
38
+ * `off`, or `no`) — prints a notice and exits the process successfully so the pre-commit checks are
39
+ * skipped. This mirrors husky's own `HUSKY=0` switch, but scoped to the nano-staged step (so the
40
+ * commit-msg hook still runs). Otherwise it returns {@link obsidianDevUtilsConfig}, or — when
41
+ * `additionalWriterTasks` are given — the same configuration re-partitioned with those writers added.
42
+ *
43
+ * `NANO_STAGED` is not an npm script, so it carries its own switch rather than the script-name-derived one
44
+ * every npm script gets — but both share the same notion of an off value, via {@link isEnvVariableOff}.
45
+ *
46
+ * This is a function rather than module-level code so importing the package barrel never triggers the
47
+ * `.env` read or the process exit; call it from the thin `scripts/nano-staged-config.ts` entry. Resolving the
48
+ * package manager is the one thing that does run at module scope, and it does neither of those two
49
+ * things — it only probes for a lockfile.
50
+ *
51
+ * @param options - The optional options.
52
+ * @returns The nano-staged task configuration. Does not return when the opt-out is active.
53
+ */
54
+ export declare function getNanoStagedConfig(options?: GetNanoStagedConfigOptions): Record<string, string[]>;
@@ -0,0 +1,93 @@
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 npm_publish_exports = {};
80
+ __export(npm_publish_exports, {
81
+ publish: () => publish
82
+ });
83
+ module.exports = __toCommonJS(npm_publish_exports);
84
+ var import_root = require('./root.cjs');
85
+ async function publish(isBeta) {
86
+ const tag = isBeta ? "beta" : "latest";
87
+ await (0, import_root.execFromRoot)(["npm", "publish", "--tag", tag]);
88
+ }
89
+ // Annotate the CommonJS export names for ESM import in node:
90
+ 0 && (module.exports = {
91
+ publish
92
+ });
93
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vc3JjL25wbS1wdWJsaXNoLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogQ29udGFpbnMgdXRpbGl0eSBmdW5jdGlvbnMgZm9yIE5QTSBwdWJsaXNoLlxuICovXG5cbmltcG9ydCB7IGV4ZWNGcm9tUm9vdCB9IGZyb20gJy4vcm9vdC50cyc7XG5cbi8qKlxuICogUHVibGlzaCB0byBOUE0uXG4gKlxuICogQXV0aGVudGljYXRpb24gaXMgaW50ZW50aW9uYWxseSBub3QgaGFuZGxlZCBoZXJlLiBUaGUgcHVibGlzaCBpcyBleHBlY3RlZCB0byBydW4gZnJvbSBhIENJIGpvYlxuICogY29uZmlndXJlZCBhcyBhIHtAbGluayBodHRwczovL2RvY3MubnBtanMuY29tL3RydXN0ZWQtcHVibGlzaGVycyB8IHRydXN0ZWQgcHVibGlzaGVyfSBvbiBucG1qcy5jb20sXG4gKiB3aG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