@mnaoumov/obsidian-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 (293) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -1
  3. package/bundlers/esbuild/package.json +6 -0
  4. package/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin/package.json +6 -0
  5. package/bundlers/esbuild-impl/dependency/package.json +6 -0
  6. package/bundlers/esbuild-impl/fix-source-maps-plugin/package.json +6 -0
  7. package/bundlers/esbuild-impl/index/package.json +6 -0
  8. package/bundlers/esbuild-impl/obsidian-plugin-builder/package.json +6 -0
  9. package/bundlers/esbuild-impl/package.json +6 -0
  10. package/bundlers/esbuild-impl/preprocess-plugin/package.json +6 -0
  11. package/bundlers/esbuild-impl/rename-css-plugin/package.json +6 -0
  12. package/bundlers/index/package.json +6 -0
  13. package/bundlers/package.json +6 -0
  14. package/dist/demo-vault-helper/main.js +1264 -0
  15. package/dist/demo-vault-helper/manifest.json +9 -0
  16. package/dist/integration-test-plugin/main.js +54167 -0
  17. package/dist/integration-test-plugin/manifest.json +8 -0
  18. package/dist/lib/cjs/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.cjs +322 -0
  19. package/dist/lib/cjs/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.d.cts +38 -0
  20. package/dist/lib/cjs/bundlers/esbuild-impl/dependency.cjs +240 -0
  21. package/dist/lib/cjs/bundlers/esbuild-impl/dependency.d.cts +20 -0
  22. package/dist/lib/cjs/bundlers/esbuild-impl/fix-source-maps-plugin.cjs +213 -0
  23. package/dist/lib/cjs/bundlers/esbuild-impl/fix-source-maps-plugin.d.cts +34 -0
  24. package/dist/lib/cjs/bundlers/esbuild-impl/index.cjs +179 -0
  25. package/dist/lib/cjs/bundlers/esbuild-impl/index.d.cts +7 -0
  26. package/dist/lib/cjs/bundlers/esbuild-impl/obsidian-plugin-builder.cjs +362 -0
  27. package/dist/lib/cjs/bundlers/esbuild-impl/obsidian-plugin-builder.d.cts +98 -0
  28. package/dist/lib/cjs/bundlers/esbuild-impl/preprocess-plugin.cjs +234 -0
  29. package/dist/lib/cjs/bundlers/esbuild-impl/preprocess-plugin.d.cts +30 -0
  30. package/dist/lib/cjs/bundlers/esbuild-impl/rename-css-plugin.cjs +171 -0
  31. package/dist/lib/cjs/bundlers/esbuild-impl/rename-css-plugin.d.cts +14 -0
  32. package/dist/lib/cjs/bundlers/esbuild.cjs +164 -0
  33. package/dist/lib/cjs/bundlers/esbuild.d.cts +11 -0
  34. package/dist/lib/cjs/bundlers/index.cjs +167 -0
  35. package/dist/lib/cjs/bundlers/index.d.cts +3 -0
  36. package/dist/lib/cjs/demo-vault-app-json.cjs +186 -0
  37. package/dist/lib/cjs/demo-vault-app-json.d.cts +93 -0
  38. package/dist/lib/cjs/demo-vault-buttons.cjs +567 -0
  39. package/dist/lib/cjs/demo-vault-buttons.d.cts +259 -0
  40. package/dist/lib/cjs/demo-vault-coverage.cjs +713 -0
  41. package/dist/lib/cjs/demo-vault-coverage.d.cts +533 -0
  42. package/dist/lib/cjs/demo-vault.cjs +296 -0
  43. package/dist/lib/cjs/demo-vault.d.cts +33 -0
  44. package/dist/lib/cjs/formatters/dprint.cjs +160 -0
  45. package/dist/lib/cjs/formatters/dprint.d.cts +15 -0
  46. package/dist/lib/cjs/formatters/index.cjs +164 -0
  47. package/dist/lib/cjs/formatters/index.d.cts +2 -0
  48. package/dist/lib/cjs/index.cjs +194 -0
  49. package/dist/lib/cjs/index.d.cts +16 -0
  50. package/dist/lib/cjs/integration-test-setup.cjs +129 -0
  51. package/dist/lib/cjs/integration-test-setup.d.cts +33 -0
  52. package/dist/lib/cjs/integration-test-vitest-global-setup.cjs +163 -0
  53. package/dist/lib/cjs/integration-test-vitest-global-setup.d.cts +39 -0
  54. package/dist/lib/cjs/jest-setup.cjs +134 -0
  55. package/dist/lib/cjs/jest-setup.d.cts +13 -0
  56. package/dist/lib/cjs/linters/eslint-config.cjs +403 -0
  57. package/dist/lib/cjs/linters/eslint-config.d.cts +25 -0
  58. package/dist/lib/cjs/linters/eslint-rules/index.cjs +200 -0
  59. package/dist/lib/cjs/linters/eslint-rules/index.d.cts +14 -0
  60. package/dist/lib/cjs/linters/eslint-rules/manifest-description.cjs +255 -0
  61. package/dist/lib/cjs/linters/eslint-rules/manifest-description.d.cts +54 -0
  62. package/dist/lib/cjs/linters/eslint-rules/manifest-helpers.cjs +218 -0
  63. package/dist/lib/cjs/linters/eslint-rules/manifest-helpers.d.cts +141 -0
  64. package/dist/lib/cjs/linters/eslint-rules/manifest-id.cjs +215 -0
  65. package/dist/lib/cjs/linters/eslint-rules/manifest-id.d.cts +32 -0
  66. package/dist/lib/cjs/linters/eslint-rules/manifest-name.cjs +216 -0
  67. package/dist/lib/cjs/linters/eslint-rules/manifest-name.d.cts +30 -0
  68. package/dist/lib/cjs/linters/eslint-rules/manifest-schema.cjs +316 -0
  69. package/dist/lib/cjs/linters/eslint-rules/manifest-schema.d.cts +45 -0
  70. package/dist/lib/cjs/linters/eslint-rules/no-local-obsidian-internals.cjs +259 -0
  71. package/dist/lib/cjs/linters/eslint-rules/no-local-obsidian-internals.d.cts +10 -0
  72. package/dist/lib/cjs/linters/eslint-rules/no-over-cap-wait-in-eval-in-obsidian.cjs +657 -0
  73. package/dist/lib/cjs/linters/eslint-rules/no-over-cap-wait-in-eval-in-obsidian.d.cts +10 -0
  74. package/dist/lib/cjs/linters/eslint-rules/no-untrusted-input-events.cjs +247 -0
  75. package/dist/lib/cjs/linters/eslint-rules/no-untrusted-input-events.d.cts +10 -0
  76. package/dist/lib/cjs/linters/eslint-rules/obsidian-dev-utils-plugin.cjs +181 -0
  77. package/dist/lib/cjs/linters/eslint-rules/obsidian-dev-utils-plugin.d.cts +13 -0
  78. package/dist/lib/cjs/linters/eslint-rules/plugin-name-as-code-in-ui.cjs +263 -0
  79. package/dist/lib/cjs/linters/eslint-rules/plugin-name-as-code-in-ui.d.cts +30 -0
  80. package/dist/lib/cjs/linters/eslint-rules/plugin-name-as-code.cjs +215 -0
  81. package/dist/lib/cjs/linters/eslint-rules/plugin-name-as-code.d.cts +29 -0
  82. package/dist/lib/cjs/linters/eslint-rules/require-component-suffix.cjs +278 -0
  83. package/dist/lib/cjs/linters/eslint-rules/require-component-suffix.d.cts +18 -0
  84. package/dist/lib/cjs/linters/eslint-rules/require-plugin-api-contract-schemas.cjs +306 -0
  85. package/dist/lib/cjs/linters/eslint-rules/require-plugin-api-contract-schemas.d.cts +10 -0
  86. package/dist/lib/cjs/linters/eslint.cjs +160 -0
  87. package/dist/lib/cjs/linters/eslint.d.cts +15 -0
  88. package/dist/lib/cjs/linters/index.cjs +185 -0
  89. package/dist/lib/cjs/linters/index.d.cts +9 -0
  90. package/dist/lib/cjs/linters/markdownlint-cli2-config.cjs +171 -0
  91. package/dist/lib/cjs/linters/markdownlint-cli2-config.d.cts +12 -0
  92. package/dist/lib/cjs/linters/markdownlint-rules/index.cjs +164 -0
  93. package/dist/lib/cjs/linters/markdownlint-rules/index.d.cts +2 -0
  94. package/dist/lib/cjs/linters/markdownlint-rules/plugin-name-as-code.cjs +246 -0
  95. package/dist/lib/cjs/linters/markdownlint-rules/plugin-name-as-code.d.cts +32 -0
  96. package/dist/lib/cjs/linters/markdownlint.cjs +160 -0
  97. package/dist/lib/cjs/linters/markdownlint.d.cts +15 -0
  98. package/dist/lib/cjs/linters/obsidianmd-rule-custom-message.cjs +176 -0
  99. package/dist/lib/cjs/linters/obsidianmd-rule-custom-message.d.cts +40 -0
  100. package/dist/lib/cjs/linters/plugin-names.cjs +249 -0
  101. package/dist/lib/cjs/linters/plugin-names.d.cts +81 -0
  102. package/dist/lib/cjs/obsidian-plugin-repo-paths.cjs +216 -0
  103. package/dist/lib/cjs/obsidian-plugin-repo-paths.d.cts +253 -0
  104. package/dist/lib/cjs/setup.cjs +163 -0
  105. package/dist/lib/cjs/setup.d.cts +21 -0
  106. package/dist/lib/cjs/templates.cjs +172 -0
  107. package/dist/lib/cjs/templates.d.cts +13 -0
  108. package/dist/lib/cjs/test-runners/index.cjs +170 -0
  109. package/dist/lib/cjs/test-runners/index.d.cts +4 -0
  110. package/dist/lib/cjs/test-runners/integration-test-plugin.cjs +211 -0
  111. package/dist/lib/cjs/test-runners/integration-test-plugin.d.cts +44 -0
  112. package/dist/lib/cjs/test-runners/performance-eval-cap.cjs +157 -0
  113. package/dist/lib/cjs/test-runners/performance-eval-cap.d.cts +27 -0
  114. package/dist/lib/cjs/test-runners/stale-build-global-setup.cjs +217 -0
  115. package/dist/lib/cjs/test-runners/stale-build-global-setup.d.cts +86 -0
  116. package/dist/lib/cjs/test-runners/vitest-config.cjs +484 -0
  117. package/dist/lib/cjs/test-runners/vitest-config.d.cts +200 -0
  118. package/dist/lib/cjs/version.cjs +262 -0
  119. package/dist/lib/cjs/version.d.cts +92 -0
  120. package/dist/lib/cjs/vitest-setup.cjs +134 -0
  121. package/dist/lib/cjs/vitest-setup.d.cts +11 -0
  122. package/dist/lib/esm/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.d.mts +38 -0
  123. package/dist/lib/esm/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.mjs +218 -0
  124. package/dist/lib/esm/bundlers/esbuild-impl/dependency.d.mts +20 -0
  125. package/dist/lib/esm/bundlers/esbuild-impl/dependency.mjs +130 -0
  126. package/dist/lib/esm/bundlers/esbuild-impl/fix-source-maps-plugin.d.mts +34 -0
  127. package/dist/lib/esm/bundlers/esbuild-impl/fix-source-maps-plugin.mjs +108 -0
  128. package/dist/lib/esm/bundlers/esbuild-impl/index.d.mts +7 -0
  129. package/dist/lib/esm/bundlers/esbuild-impl/index.mjs +56 -0
  130. package/dist/lib/esm/bundlers/esbuild-impl/obsidian-plugin-builder.d.mts +98 -0
  131. package/dist/lib/esm/bundlers/esbuild-impl/obsidian-plugin-builder.mjs +247 -0
  132. package/dist/lib/esm/bundlers/esbuild-impl/preprocess-plugin.d.mts +30 -0
  133. package/dist/lib/esm/bundlers/esbuild-impl/preprocess-plugin.mjs +126 -0
  134. package/dist/lib/esm/bundlers/esbuild-impl/rename-css-plugin.d.mts +14 -0
  135. package/dist/lib/esm/bundlers/esbuild-impl/rename-css-plugin.mjs +63 -0
  136. package/dist/lib/esm/bundlers/esbuild.d.mts +11 -0
  137. package/dist/lib/esm/bundlers/esbuild.mjs +58 -0
  138. package/dist/lib/esm/bundlers/index.d.mts +3 -0
  139. package/dist/lib/esm/bundlers/index.mjs +48 -0
  140. package/dist/lib/esm/demo-vault-app-json.d.mts +93 -0
  141. package/dist/lib/esm/demo-vault-app-json.mjs +75 -0
  142. package/dist/lib/esm/demo-vault-buttons.d.mts +259 -0
  143. package/dist/lib/esm/demo-vault-buttons.mjs +452 -0
  144. package/dist/lib/esm/demo-vault-coverage.d.mts +533 -0
  145. package/dist/lib/esm/demo-vault-coverage.mjs +619 -0
  146. package/dist/lib/esm/demo-vault.d.mts +33 -0
  147. package/dist/lib/esm/demo-vault.mjs +197 -0
  148. package/dist/lib/esm/formatters/dprint.d.mts +15 -0
  149. package/dist/lib/esm/formatters/dprint.mjs +52 -0
  150. package/dist/lib/esm/formatters/index.d.mts +2 -0
  151. package/dist/lib/esm/formatters/index.mjs +46 -0
  152. package/dist/lib/esm/index.d.mts +16 -0
  153. package/dist/lib/esm/index.mjs +66 -0
  154. package/dist/lib/esm/integration-test-setup.d.mts +33 -0
  155. package/dist/lib/esm/integration-test-setup.mjs +44 -0
  156. package/dist/lib/esm/integration-test-vitest-global-setup.d.mts +39 -0
  157. package/dist/lib/esm/integration-test-vitest-global-setup.mjs +57 -0
  158. package/dist/lib/esm/jest-setup.d.mts +13 -0
  159. package/dist/lib/esm/jest-setup.mjs +53 -0
  160. package/dist/lib/esm/linters/eslint-config.d.mts +25 -0
  161. package/dist/lib/esm/linters/eslint-config.mjs +290 -0
  162. package/dist/lib/esm/linters/eslint-rules/index.d.mts +14 -0
  163. package/dist/lib/esm/linters/eslint-rules/index.mjs +70 -0
  164. package/dist/lib/esm/linters/eslint-rules/manifest-description.d.mts +54 -0
  165. package/dist/lib/esm/linters/eslint-rules/manifest-description.mjs +146 -0
  166. package/dist/lib/esm/linters/eslint-rules/manifest-helpers.d.mts +141 -0
  167. package/dist/lib/esm/linters/eslint-rules/manifest-helpers.mjs +90 -0
  168. package/dist/lib/esm/linters/eslint-rules/manifest-id.d.mts +32 -0
  169. package/dist/lib/esm/linters/eslint-rules/manifest-id.mjs +109 -0
  170. package/dist/lib/esm/linters/eslint-rules/manifest-name.d.mts +30 -0
  171. package/dist/lib/esm/linters/eslint-rules/manifest-name.mjs +110 -0
  172. package/dist/lib/esm/linters/eslint-rules/manifest-schema.d.mts +45 -0
  173. package/dist/lib/esm/linters/eslint-rules/manifest-schema.mjs +212 -0
  174. package/dist/lib/esm/linters/eslint-rules/no-local-obsidian-internals.d.mts +10 -0
  175. package/dist/lib/esm/linters/eslint-rules/no-local-obsidian-internals.mjs +150 -0
  176. package/dist/lib/esm/linters/eslint-rules/no-over-cap-wait-in-eval-in-obsidian.d.mts +10 -0
  177. package/dist/lib/esm/linters/eslint-rules/no-over-cap-wait-in-eval-in-obsidian.mjs +551 -0
  178. package/dist/lib/esm/linters/eslint-rules/no-untrusted-input-events.d.mts +10 -0
  179. package/dist/lib/esm/linters/eslint-rules/no-untrusted-input-events.mjs +138 -0
  180. package/dist/lib/esm/linters/eslint-rules/obsidian-dev-utils-plugin.d.mts +13 -0
  181. package/dist/lib/esm/linters/eslint-rules/obsidian-dev-utils-plugin.mjs +73 -0
  182. package/dist/lib/esm/linters/eslint-rules/plugin-name-as-code-in-ui.d.mts +30 -0
  183. package/dist/lib/esm/linters/eslint-rules/plugin-name-as-code-in-ui.mjs +157 -0
  184. package/dist/lib/esm/linters/eslint-rules/plugin-name-as-code.d.mts +29 -0
  185. package/dist/lib/esm/linters/eslint-rules/plugin-name-as-code.mjs +108 -0
  186. package/dist/lib/esm/linters/eslint-rules/require-component-suffix.d.mts +18 -0
  187. package/dist/lib/esm/linters/eslint-rules/require-component-suffix.mjs +167 -0
  188. package/dist/lib/esm/linters/eslint-rules/require-plugin-api-contract-schemas.d.mts +10 -0
  189. package/dist/lib/esm/linters/eslint-rules/require-plugin-api-contract-schemas.mjs +197 -0
  190. package/dist/lib/esm/linters/eslint.d.mts +15 -0
  191. package/dist/lib/esm/linters/eslint.mjs +52 -0
  192. package/dist/lib/esm/linters/index.d.mts +9 -0
  193. package/dist/lib/esm/linters/index.mjs +60 -0
  194. package/dist/lib/esm/linters/markdownlint-cli2-config.d.mts +12 -0
  195. package/dist/lib/esm/linters/markdownlint-cli2-config.mjs +66 -0
  196. package/dist/lib/esm/linters/markdownlint-rules/index.d.mts +2 -0
  197. package/dist/lib/esm/linters/markdownlint-rules/index.mjs +46 -0
  198. package/dist/lib/esm/linters/markdownlint-rules/plugin-name-as-code.d.mts +32 -0
  199. package/dist/lib/esm/linters/markdownlint-rules/plugin-name-as-code.mjs +130 -0
  200. package/dist/lib/esm/linters/markdownlint.d.mts +15 -0
  201. package/dist/lib/esm/linters/markdownlint.mjs +52 -0
  202. package/dist/lib/esm/linters/obsidianmd-rule-custom-message.d.mts +40 -0
  203. package/dist/lib/esm/linters/obsidianmd-rule-custom-message.mjs +67 -0
  204. package/dist/lib/esm/linters/plugin-names.d.mts +81 -0
  205. package/dist/lib/esm/linters/plugin-names.mjs +141 -0
  206. package/dist/lib/esm/obsidian-plugin-repo-paths.d.mts +253 -0
  207. package/dist/lib/esm/obsidian-plugin-repo-paths.mjs +108 -0
  208. package/dist/lib/esm/setup.d.mts +21 -0
  209. package/dist/lib/esm/setup.mjs +55 -0
  210. package/dist/lib/esm/templates.d.mts +13 -0
  211. package/dist/lib/esm/templates.mjs +57 -0
  212. package/dist/lib/esm/test-runners/index.d.mts +4 -0
  213. package/dist/lib/esm/test-runners/index.mjs +50 -0
  214. package/dist/lib/esm/test-runners/integration-test-plugin.d.mts +44 -0
  215. package/dist/lib/esm/test-runners/integration-test-plugin.mjs +94 -0
  216. package/dist/lib/esm/test-runners/performance-eval-cap.d.mts +27 -0
  217. package/dist/lib/esm/test-runners/performance-eval-cap.mjs +48 -0
  218. package/dist/lib/esm/test-runners/stale-build-global-setup.d.mts +86 -0
  219. package/dist/lib/esm/test-runners/stale-build-global-setup.mjs +115 -0
  220. package/dist/lib/esm/test-runners/vitest-config.d.mts +200 -0
  221. package/dist/lib/esm/test-runners/vitest-config.mjs +369 -0
  222. package/dist/lib/esm/version.d.mts +92 -0
  223. package/dist/lib/esm/version.mjs +160 -0
  224. package/dist/lib/esm/vitest-setup.d.mts +11 -0
  225. package/dist/lib/esm/vitest-setup.mjs +53 -0
  226. package/dist/templates/.markdownlint-cli2.mjs +4 -0
  227. package/dist/templates/.nano-staged.mjs +4 -0
  228. package/dist/templates/commitlint.config.ts +3 -0
  229. package/dist/templates/dprint.json +26 -0
  230. package/dist/templates/eslint.config.mts +3 -0
  231. package/dist/templates/scripts/build/build-clean.ts +4 -0
  232. package/dist/templates/scripts/build/build-compile-svelte.ts +4 -0
  233. package/dist/templates/scripts/build/build-compile-typescript.ts +4 -0
  234. package/dist/templates/scripts/build/build-compile.ts +4 -0
  235. package/dist/templates/scripts/build/build-templates.ts +4 -0
  236. package/dist/templates/scripts/bundlers/esbuild/build.ts +4 -0
  237. package/dist/templates/scripts/bundlers/esbuild/dev.ts +4 -0
  238. package/dist/templates/scripts/commitlint-config.ts +3 -0
  239. package/dist/templates/scripts/eslint-config.ts +10 -0
  240. package/dist/templates/scripts/formatters/dprint/format-check.ts +8 -0
  241. package/dist/templates/scripts/formatters/dprint/format.ts +8 -0
  242. package/dist/templates/scripts/gate/gate.ts +10 -0
  243. package/dist/templates/scripts/linters/cspell/spellcheck.ts +8 -0
  244. package/dist/templates/scripts/linters/eslint/lint-fix.ts +8 -0
  245. package/dist/templates/scripts/linters/eslint/lint.ts +8 -0
  246. package/dist/templates/scripts/linters/markdownlint/lint-md-fix.ts +8 -0
  247. package/dist/templates/scripts/linters/markdownlint/lint-md.ts +8 -0
  248. package/dist/templates/scripts/linters/over-exposure/find-overexposed-fix.ts +25 -0
  249. package/dist/templates/scripts/linters/over-exposure/find-overexposed.ts +15 -0
  250. package/dist/templates/scripts/markdownlint-cli2-config.ts +3 -0
  251. package/dist/templates/scripts/nano-staged-config.ts +3 -0
  252. package/dist/templates/scripts/test-runners/vitest/test-coverage.ts +4 -0
  253. package/dist/templates/scripts/test-runners/vitest/test-watch.ts +4 -0
  254. package/dist/templates/scripts/test-runners/vitest/test.ts +4 -0
  255. package/dist/templates/scripts/version/version.ts +10 -0
  256. package/dist/templates/scripts/vitest-config.ts +3 -0
  257. package/dist/templates/vitest.config.ts +3 -0
  258. package/formatters/dprint/package.json +6 -0
  259. package/formatters/index/package.json +6 -0
  260. package/formatters/package.json +6 -0
  261. package/linters/eslint/package.json +6 -0
  262. package/linters/eslint-config/package.json +6 -0
  263. package/linters/eslint-rules/index/package.json +6 -0
  264. package/linters/eslint-rules/manifest-description/package.json +6 -0
  265. package/linters/eslint-rules/manifest-helpers/package.json +6 -0
  266. package/linters/eslint-rules/manifest-id/package.json +6 -0
  267. package/linters/eslint-rules/manifest-name/package.json +6 -0
  268. package/linters/eslint-rules/manifest-schema/package.json +6 -0
  269. package/linters/eslint-rules/no-local-obsidian-internals/package.json +6 -0
  270. package/linters/eslint-rules/no-over-cap-wait-in-eval-in-obsidian/package.json +6 -0
  271. package/linters/eslint-rules/no-untrusted-input-events/package.json +6 -0
  272. package/linters/eslint-rules/obsidian-dev-utils-plugin/package.json +6 -0
  273. package/linters/eslint-rules/package.json +6 -0
  274. package/linters/eslint-rules/plugin-name-as-code/package.json +6 -0
  275. package/linters/eslint-rules/plugin-name-as-code-in-ui/package.json +6 -0
  276. package/linters/eslint-rules/require-component-suffix/package.json +6 -0
  277. package/linters/eslint-rules/require-plugin-api-contract-schemas/package.json +6 -0
  278. package/linters/index/package.json +6 -0
  279. package/linters/markdownlint/package.json +6 -0
  280. package/linters/markdownlint-cli2-config/package.json +6 -0
  281. package/linters/markdownlint-rules/index/package.json +6 -0
  282. package/linters/markdownlint-rules/package.json +6 -0
  283. package/linters/markdownlint-rules/plugin-name-as-code/package.json +6 -0
  284. package/linters/obsidianmd-rule-custom-message/package.json +6 -0
  285. package/linters/package.json +6 -0
  286. package/linters/plugin-names/package.json +6 -0
  287. package/package.json +302 -13
  288. package/test-runners/index/package.json +6 -0
  289. package/test-runners/integration-test-plugin/package.json +6 -0
  290. package/test-runners/package.json +6 -0
  291. package/test-runners/performance-eval-cap/package.json +6 -0
  292. package/test-runners/stale-build-global-setup/package.json +6 -0
  293. package/test-runners/vitest-config/package.json +6 -0
@@ -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
+ const existingProcess = globalThis.process;
22
+ if (!existingProcess) {
23
+ globalThis.process = browserProcess;
24
+ return;
25
+ }
26
+ if (existingProcess.versions?.node) {
27
+ return;
28
+ }
29
+ const existingProcessRecord = existingProcess;
30
+ for (const [key, value] of Object.entries(browserProcess)) {
31
+ existingProcessRecord[key] ??= value;
32
+ }
33
+ existingProcessRecord["browser"] = true;
34
+ }
35
+
36
+ (function initEsm() {
37
+ ensureDisposeSymbols();
38
+ ensureBrowserProcess();
39
+ })();
40
+ })();
41
+
42
+ import { getRootFolder } from "@mnaoumov/typescript-dev-toolkit/root";
43
+ import {
44
+ getFolderName,
45
+ join
46
+ } from "@mnaoumov/typescript-lib/path";
47
+ import { readFileSync } from "node:fs";
48
+ import { registerLibResolver } from "obsidian-integration-testing";
49
+ import { ObsidianPluginRepoPaths } from "../obsidian-plugin-repo-paths.mjs";
50
+ const OBSIDIAN_DEV_UTILS_INTEGRATION_TEST_PLUGIN_ID = "obsidian-dev-utils-integration-test";
51
+ function getIntegrationTestPluginPopulate() {
52
+ const packageFolder = getRootFolder(getFolderName(import.meta.url));
53
+ if (!packageFolder) {
54
+ throw new Error("Could not resolve the obsidian-dev-utils package folder to seed the integration-test harness plugin.");
55
+ }
56
+ const pluginSourceFolder = join(packageFolder, ObsidianPluginRepoPaths.DistIntegrationTestPlugin);
57
+ const pluginVaultFolder = join(
58
+ ObsidianPluginRepoPaths.DotObsidian,
59
+ ObsidianPluginRepoPaths.Plugins,
60
+ OBSIDIAN_DEV_UTILS_INTEGRATION_TEST_PLUGIN_ID
61
+ );
62
+ const populate = {};
63
+ for (const fileName of [ObsidianPluginRepoPaths.MainJs, ObsidianPluginRepoPaths.ManifestJson]) {
64
+ const sourcePath = join(pluginSourceFolder, fileName);
65
+ let content;
66
+ try {
67
+ content = readFileSync(sourcePath);
68
+ } catch (error) {
69
+ throw new Error(
70
+ `Could not read ${sourcePath}. The integration-test harness plugin is missing from the installed obsidian-dev-utils package \u2014 run \`npm run build\` in obsidian-dev-utils, or reinstall it.`,
71
+ { cause: error }
72
+ );
73
+ }
74
+ populate[join(pluginVaultFolder, fileName)] = content;
75
+ }
76
+ return populate;
77
+ }
78
+ function registerIntegrationTestLibResolver() {
79
+ registerLibResolver(() => {
80
+ const obsidianDevUtilsModule = window.__obsidianDevUtilsModule;
81
+ if (!obsidianDevUtilsModule) {
82
+ throw new Error(
83
+ "The obsidian-dev-utils module is not exposed on `window`. Is the obsidian-dev-utils integration-test harness plugin installed and enabled in the test vault? See `obsidian-dev-utils/integration-test-vitest-global-setup`."
84
+ );
85
+ }
86
+ return obsidianDevUtilsModule.__merged;
87
+ });
88
+ }
89
+ export {
90
+ OBSIDIAN_DEV_UTILS_INTEGRATION_TEST_PLUGIN_ID,
91
+ getIntegrationTestPluginPopulate,
92
+ registerIntegrationTestLibResolver
93
+ };
94
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL3Rlc3QtcnVubmVycy9pbnRlZ3JhdGlvbi10ZXN0LXBsdWdpbi50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIFdpcmVzIHRoZSBzaGlwcGVkIGludGVncmF0aW9uLXRlc3QgaGFybmVzcyBwbHVnaW4gaW50byBhIGNvbnN1bWVyIHBsdWdpbidzIGludGVncmF0aW9uIHRlc3RzLCBzbyBldmVyeVxuICogbGlicmFyeSBoZWxwZXIgaXMgcmVhY2hhYmxlIGFzIGBsaWIuPGhlbHBlcj5gIGluc2lkZSBhbiBgZXZhbEluT2JzaWRpYW5gIGNsb3N1cmUuXG4gKlxuICogVHdvIGhhbHZlcywgYW5kIGJvdGggbXVzdCBiZSB3aXJlZCBvciBgbGliLjxoZWxwZXI+YCBmYWlsczpcbiAqXG4gKiAtIHtAbGluayBnZXRJbnRlZ3JhdGlvblRlc3RQbHVnaW5Qb3B1bGF0ZX0gcHV0cyB0aGUgaGFybmVzcyBwbHVnaW4ncyBiaW5hcmllcyBpbiB0aGUgdGVzdCB2YXVsdC4gVGhlXG4gKiAgIGhhcm5lc3MgcGx1Z2luIGlzIHdoYXQgcHVibGlzaGVzIHRoZSBsaWJyYXJ5IG9uIGB3aW5kb3cuX19vYnNpZGlhbkRldlV0aWxzTW9kdWxlYDsgaW4gdGhpcyByZXBvJ3Mgb3duXG4gKiAgIHN1aXRlIGl0IElTIHRoZSBwbHVnaW4tdW5kZXItdGVzdCwgYnV0IGluIGEgY29uc3VtZXIncyBzdWl0ZSB0aGUgcGx1Z2luLXVuZGVyLXRlc3QgaXMgdGhlIGNvbnN1bWVyJ3Mgb3duXG4gKiAg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QkFBb0I7QUFBQSxJQUN4Qix3QkFBd0I7QUFBQSxJQUN4Qix3QkFBd0I7QUFBQSxJQUN4QjtBQUFBLEVBQ0Y7QUFFQSxRQUFNLFdBQXVDLENBQUM7QUFFOUMsYUFBVyxZQUFZLENBQUMsd0JBQXdCLFFBQVEsd0JBQXdCLFlBQVksR0FBRztBQUM3RixVQUFNLGFBQWEsS0FBSyxvQkFBb0IsUUFBUTtBQUNwRCxRQUFJO0FBQ0osUUFBSTtBQUNGLGdCQUFVLGFBQWEsVUFBVTtBQUFBLElBQ25DLFNBQVMsT0FBZ0I7QUFDdkIsWUFBTSxJQUFJO0FBQUEsUUFDUixrQkFBa0IsVUFBVTtBQUFBLFFBRTVCLEVBQUUsT0FBTyxNQUFNO0FBQUEsTUFDakI7QUFBQSxJQUNGO0FBQ0EsYUFBUyxLQUFLLG1CQUFtQixRQUFRLENBQUMsSUFBSTtBQUFBLEVBQ2hEO0FBRUEsU0FBTztBQUNUO0FBVU8sU0FBUyxxQ0FBMkM7QUFDekQsc0JBQW9CLE1BQWM7QUFDaEMsVUFBTSx5QkFBMEIsT0FBaUQ7QUFDakYsUUFBSSxDQUFDLHdCQUF3QjtBQUMzQixZQUFNLElBQUk7QUFBQSxRQUNSO0FBQUEsTUFHRjtBQUFBLElBQ0Y7QUFDQSxXQUFPLHVCQUF1QjtBQUFBLEVBQ2hDLENBQUM7QUFDSDsiLAogICJuYW1lcyI6IFtdCn0K
@@ -0,0 +1,27 @@
1
+ /// <reference path="../index.d.mts" />
2
+ /**
3
+ * @file
4
+ *
5
+ * The per-eval cap of the `integration-tests:desktop-performance` project, and the file suffix that
6
+ * project collects.
7
+ *
8
+ * Both live here, rather than in `vitest-config.ts`, because the `no-over-cap-wait-in-eval-in-obsidian`
9
+ * ESLint rule reads them too, and the shared ESLint config loads that rule in every consuming repo:
10
+ * importing `vitest-config.ts` from the rule would load `vitest/config` at lint time for nothing.
11
+ */
12
+ /**
13
+ * The per-eval cap the `integration-tests:desktop-performance` project gives its CDP transport, in
14
+ * milliseconds.
15
+ *
16
+ * Every other project keeps the transport's own `DEFAULT_EVAL_CAP_IN_MILLISECONDS` (30 000), and a repo
17
+ * that raises its desktop cap above that is setting a BACKSTOP, not a budget a closure may spend. The
18
+ * performance project is the one exception, and a deliberate one: its whole measurement is one long
19
+ * in-page `Runtime.evaluate` over a vault of tens of thousands of notes, and its files run on no other
20
+ * project. A cross-platform suite gains nothing from any desktop raise, because Appium caps it at
21
+ * 30 000 whatever the desktop project says.
22
+ */
23
+ export declare const PERFORMANCE_EVAL_CAP_IN_MILLISECONDS = 600000;
24
+ /**
25
+ * The file-name suffix of a suite the `integration-tests:desktop-performance` project collects.
26
+ */
27
+ export declare const DESKTOP_PERFORMANCE_TEST_FILE_SUFFIX = ".desktop-performance.integration.test.ts";
@@ -0,0 +1,48 @@
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
+ const existingProcess = globalThis.process;
22
+ if (!existingProcess) {
23
+ globalThis.process = browserProcess;
24
+ return;
25
+ }
26
+ if (existingProcess.versions?.node) {
27
+ return;
28
+ }
29
+ const existingProcessRecord = existingProcess;
30
+ for (const [key, value] of Object.entries(browserProcess)) {
31
+ existingProcessRecord[key] ??= value;
32
+ }
33
+ existingProcessRecord["browser"] = true;
34
+ }
35
+
36
+ (function initEsm() {
37
+ ensureDisposeSymbols();
38
+ ensureBrowserProcess();
39
+ })();
40
+ })();
41
+
42
+ const PERFORMANCE_EVAL_CAP_IN_MILLISECONDS = 6e5;
43
+ const DESKTOP_PERFORMANCE_TEST_FILE_SUFFIX = ".desktop-performance.integration.test.ts";
44
+ export {
45
+ DESKTOP_PERFORMANCE_TEST_FILE_SUFFIX,
46
+ PERFORMANCE_EVAL_CAP_IN_MILLISECONDS
47
+ };
48
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL3Rlc3QtcnVubmVycy9wZXJmb3JtYW5jZS1ldmFsLWNhcC50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIFRoZSBwZXItZXZhbCBjYXAgb2YgdGhlIGBpbnRlZ3JhdGlvbi10ZXN0czpkZXNrdG9wLXBlcmZvcm1hbmNlYCBwcm9qZWN0LCBhbmQgdGhlIGZpbGUgc3VmZml4IHRoYXRcbiAqIHByb2plY3QgY29sbGVjdHMuXG4gKlxuICogQm90aCBsaXZlIGhlcmUsIHJhdGhlciB0aGFuIGluIGB2aXRlc3QtY29uZmlnLnRzYCwgYmVjYXVzZSB0aGUgYG5vLW92ZXItY2FwLXdhaXQtaW4tZXZhbC1pbi1vYnNpZGlhbmBcbiAqIEVTTGludCBydWxlIHJlYWRzIHRoZW0gdG9vLCBhbmQgdGhlIHNoYXJlZCBFU0xpbnQgY29uZmlnIGxvYWRzIHRoYXQgcnVsZSBpbiBldmVyeSBjb25zdW1pbmcgcmVwbzpcbiAqIGltcG9ydGluZyBgdml0ZXN0LWNvbmZpZy50c2AgZnJvbSB0aGUgcnVsZSB3b3VsZCBsb2FkIGB2aXRlc3QvY29uZmlnYCBhdCBsaW50IHRpbWUgZm9yIG5vdGhpbmcuXG4gKi9cblxuLyoqXG4gKiBUaGUgcGVyLWV2YWwgY2FwIHRoZSBgaW50ZWdyYXRpb24tdGVzdHM6ZGVza3RvcC1wZXJmb3JtYW5jZWAgcHJvamVjdCBnaXZlcyBpdHMgQ0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NLVE9QX1BFUkZPUk1BTkNFX1RFU1RfRklMRV9TVUZGSVggPSAnLmRlc2t0b3AtcGVyZm9ybWFuY2UuaW50ZWdyYXRpb24udGVzdC50cyc7XG4iXSwKICAibWFwcGluZ3MiOiAiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQXNCTyxNQUFNLHVDQUF1QztBQUs3QyxNQUFNLHVDQUF1QzsiLAogICJuYW1lcyI6IFtdCn0K
@@ -0,0 +1,86 @@
1
+ /// <reference path="../index.d.mts" />
2
+ /**
3
+ * @file
4
+ *
5
+ * Vitest global setup that refuses to start an integration project whose plugin build is stale.
6
+ *
7
+ * The integration harness enables the plugin from its BUILD, `dist/build/main.js`, and a plugin's
8
+ * `test:integration*` scripts call vitest directly, so nothing on that path builds first. A session that
9
+ * edits `src/` and then runs one integration project tests the last build, however old it is, and the
10
+ * suite reports the old code as a behavior difference, not as a stale artifact. One such run cost a CDP
11
+ * probe into Obsidian's own link resolution, a wrong cache-race theory, and a harness change that was
12
+ * made and then reverted before anyone noticed that the build was three days old. `npm run gate` avoided
13
+ * the problem only because it happens to build before it runs `test:integration`.
14
+ *
15
+ * The setup refuses to start rather than building. A build inside a global setup would run once per
16
+ * project in a multi-project aggregate, and it would slow down a deliberate re-run of an unchanged build.
17
+ * A refusal is cheap, and it says what to run.
18
+ *
19
+ * Test files are not build inputs. Editing an integration case and re-running it is exactly the loop that
20
+ * must not force a rebuild, so `*.test.ts` files and `src/test-helpers/` are ignored. A dependency bump
21
+ * is not detected either: only files in the repo are compared, not `node_modules`.
22
+ */
23
+ import type { TestProject } from 'vitest/node';
24
+ /**
25
+ * Parameters for {@link findStaleBuild}.
26
+ */
27
+ export interface FindStaleBuildParams {
28
+ /**
29
+ * The root folder of the plugin repo.
30
+ */
31
+ readonly rootFolder: string;
32
+ }
33
+ /**
34
+ * The build does not exist at all.
35
+ */
36
+ export interface MissingBuild {
37
+ /**
38
+ * The discriminant.
39
+ */
40
+ readonly kind: 'missing';
41
+ }
42
+ /**
43
+ * The build exists but is older than one of its inputs.
44
+ */
45
+ export interface OutdatedBuild {
46
+ /**
47
+ * The modification time of `dist/build/main.js`.
48
+ */
49
+ readonly buildModifiedAt: Date;
50
+ /**
51
+ * The discriminant.
52
+ */
53
+ readonly kind: 'outdated';
54
+ /**
55
+ * The modification time of {@link OutdatedBuild.newestInputPath}.
56
+ */
57
+ readonly newestInputModifiedAt: Date;
58
+ /**
59
+ * The newest build input, relative to the root folder.
60
+ */
61
+ readonly newestInputPath: string;
62
+ }
63
+ /**
64
+ * Why the build cannot be tested, as returned by {@link findStaleBuild}.
65
+ */
66
+ export type StaleBuild = MissingBuild | OutdatedBuild;
67
+ /**
68
+ * Checks whether `dist/build/main.js` is missing, or older than one of the files it is built from.
69
+ *
70
+ * @param params - The parameters.
71
+ * @returns `null` when the build is current; otherwise a description of the problem.
72
+ */
73
+ export declare function findStaleBuild(params: FindStaleBuildParams): null | StaleBuild;
74
+ /**
75
+ * Formats a {@link StaleBuild} as the message the setup throws.
76
+ *
77
+ * @param staleBuild - The stale build.
78
+ * @returns The message.
79
+ */
80
+ export declare function formatStaleBuildMessage(staleBuild: StaleBuild): string;
81
+ /**
82
+ * Vitest global setup: throws when the plugin build is missing or stale.
83
+ *
84
+ * @param project - The Vitest test project.
85
+ */
86
+ export declare function setup(project: TestProject): void;
@@ -0,0 +1,115 @@
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
+ const existingProcess = globalThis.process;
22
+ if (!existingProcess) {
23
+ globalThis.process = browserProcess;
24
+ return;
25
+ }
26
+ if (existingProcess.versions?.node) {
27
+ return;
28
+ }
29
+ const existingProcessRecord = existingProcess;
30
+ for (const [key, value] of Object.entries(browserProcess)) {
31
+ existingProcessRecord[key] ??= value;
32
+ }
33
+ existingProcessRecord["browser"] = true;
34
+ }
35
+
36
+ (function initEsm() {
37
+ ensureDisposeSymbols();
38
+ ensureBrowserProcess();
39
+ })();
40
+ })();
41
+
42
+ import { toPosixPath } from "@mnaoumov/typescript-lib/path";
43
+ import {
44
+ existsSync,
45
+ readdirSync,
46
+ statSync
47
+ } from "node:fs";
48
+ import {
49
+ join,
50
+ relative,
51
+ sep
52
+ } from "node:path";
53
+ import { ObsidianPluginRepoPaths } from "../obsidian-plugin-repo-paths.mjs";
54
+ const BUILD_PATH = `${ObsidianPluginRepoPaths.DistBuild}/${ObsidianPluginRepoPaths.MainJs}`;
55
+ const ROOT_BUILD_INPUTS = [ObsidianPluginRepoPaths.ManifestJson, ObsidianPluginRepoPaths.StylesCss];
56
+ const TEST_FILE_SUFFIX = ObsidianPluginRepoPaths.AnyTestTs.slice(1);
57
+ function findStaleBuild(params) {
58
+ const buildPath = join(params.rootFolder, BUILD_PATH);
59
+ if (!existsSync(buildPath)) {
60
+ return { kind: "missing" };
61
+ }
62
+ const buildModifiedAt = statSync(buildPath).mtime;
63
+ let newestInputPath = null;
64
+ let newestInputModifiedAt = buildModifiedAt;
65
+ for (const inputPath of getBuildInputPaths(params.rootFolder)) {
66
+ const modifiedAt = statSync(inputPath).mtime;
67
+ if (modifiedAt <= newestInputModifiedAt) {
68
+ continue;
69
+ }
70
+ newestInputPath = inputPath;
71
+ newestInputModifiedAt = modifiedAt;
72
+ }
73
+ if (newestInputPath === null) {
74
+ return null;
75
+ }
76
+ return {
77
+ buildModifiedAt,
78
+ kind: "outdated",
79
+ newestInputModifiedAt,
80
+ newestInputPath: toPosixPath(relative(params.rootFolder, newestInputPath))
81
+ };
82
+ }
83
+ function formatStaleBuildMessage(staleBuild) {
84
+ return staleBuild.kind === "missing" ? `${BUILD_PATH} does not exist, so there is no plugin for the integration tests to load. Run \`npm run build\` first.` : `${BUILD_PATH} is older than ${staleBuild.newestInputPath} (built ${staleBuild.buildModifiedAt.toISOString()}, changed ${staleBuild.newestInputModifiedAt.toISOString()}), so the integration tests would run the previous build instead of the current source. Run \`npm run build\` first.`;
85
+ }
86
+ function setup(project) {
87
+ const staleBuild = findStaleBuild({ rootFolder: project.config.root });
88
+ if (staleBuild !== null) {
89
+ throw new Error(formatStaleBuildMessage(staleBuild));
90
+ }
91
+ }
92
+ function getBuildInputPaths(rootFolder) {
93
+ const paths = ROOT_BUILD_INPUTS.map((rootInput) => join(rootFolder, rootInput)).filter((path) => existsSync(path));
94
+ const srcFolder = join(rootFolder, ObsidianPluginRepoPaths.Src);
95
+ if (!existsSync(srcFolder)) {
96
+ return paths;
97
+ }
98
+ const testHelpersFolderPrefix = join(rootFolder, ObsidianPluginRepoPaths.Mocks) + sep;
99
+ for (const entry of readdirSync(srcFolder, { recursive: true, withFileTypes: true })) {
100
+ if (!entry.isFile() || entry.name.endsWith(TEST_FILE_SUFFIX)) {
101
+ continue;
102
+ }
103
+ const path = join(entry.parentPath, entry.name);
104
+ if (!path.startsWith(testHelpersFolderPrefix)) {
105
+ paths.push(path);
106
+ }
107
+ }
108
+ return paths;
109
+ }
110
+ export {
111
+ findStaleBuild,
112
+ formatStaleBuildMessage,
113
+ setup
114
+ };
115
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL3Rlc3QtcnVubmVycy9zdGFsZS1idWlsZC1nbG9iYWwtc2V0dXAudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBWaXRlc3QgZ2xvYmFsIHNldHVwIHRoYX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DOUQsTUFBSSxDQUFDLFdBQVcsU0FBUyxHQUFHO0FBQzFCLFdBQU87QUFBQSxFQUNUO0FBRUEsUUFBTSwwQkFBMEIsS0FBSyxZQUFZLHdCQUF3QixLQUFLLElBQUk7QUFDbEYsYUFBVyxTQUFTLFlBQVksV0FBVyxFQUFFLFdBQVcsTUFBTSxlQUFlLEtBQUssQ0FBQyxHQUFHO0FBQ3BGLFFBQUksQ0FBQyxNQUFNLE9BQU8sS0FBSyxNQUFNLEtBQUssU0FBUyxnQkFBZ0IsR0FBRztBQUM1RDtBQUFBLElBQ0Y7QUFFQSxVQUFNLE9BQU8sS0FBSyxNQUFNLFlBQVksTUFBTSxJQUFJO0FBQzlDLFFBQUksQ0FBQyxLQUFLLFdBQVcsdUJBQXVCLEdBQUc7QUFDN0MsWUFBTSxLQUFLLElBQUk7QUFBQSxJQUNqQjtBQUFBLEVBQ0Y7QUFFQSxTQUFPO0FBQ1Q7IiwKICAibmFtZXMiOiBbXQp9Cg==
@@ -0,0 +1,200 @@
1
+ /// <reference path="../index.d.mts" />
2
+ /**
3
+ * @file
4
+ *
5
+ * Shared vitest configuration for Obsidian plugins.
6
+ *
7
+ * Every plugin in the workspace declares the same five vitest projects — `unit-tests` plus the
8
+ * `integration-tests:{no-app,desktop,desktop-performance,android}` family — with the same timeouts,
9
+ * `setupFiles`, and `globalSetup` wiring. Maintaining that per repo means a convention change costs one
10
+ * near-identical edit per plugin, and any repo that is missed drifts silently. This module owns that
11
+ * configuration once, so a plugin's `scripts/vitest-config.ts` collapses to a single call.
12
+ *
13
+ * The seam mirrors {@link https://www.npmjs.com/package/obsidian-dev-utils | the ESLint one}
14
+ * (`defineEslintConfigs`): the factory builds a context holding the standard projects, the caller edits
15
+ * it in place through {@link DefineObsidianPluginVitestConfigOptions.editContext}, and appends any
16
+ * project the base does not know about through
17
+ * {@link DefineObsidianPluginVitestConfigOptions.customProjects}.
18
+ */
19
+ import type { VitestReporter } from '@mnaoumov/typescript-dev-toolkit/test-runners/vitest-config';
20
+ import type { TestProjectConfiguration, TestProjectInlineConfiguration, ViteUserConfig } from 'vitest/config';
21
+ import { DEFAULT_VITEST_REPORTERS } from '@mnaoumov/typescript-dev-toolkit/test-runners/vitest-config';
22
+ /**
23
+ * The `test` section of a single vitest project entry.
24
+ */
25
+ export type ObsidianPluginVitestProjectConfig = NonNullable<TestProjectInlineConfiguration['test']>;
26
+ /**
27
+ * One entry of a vitest `reporters` list: the name of a built-in reporter or a reporter instance. The same shape as
28
+ * the library configuration's {@link VitestReporter}.
29
+ */
30
+ export type ObsidianPluginVitestReporter = VitestReporter;
31
+ export { DEFAULT_VITEST_REPORTERS };
32
+ /**
33
+ * The per-test budget of the regular integration projects, in milliseconds.
34
+ *
35
+ * Exported because a repo that assembles its vitest projects by hand instead of through
36
+ * {@link defineObsidianPluginVitestConfig} still needs the same relationship to the per-eval cap, and
37
+ * restating the number there is how the two drift apart.
38
+ */
39
+ export declare const INTEGRATION_TEST_TIMEOUT_IN_MILLISECONDS: number;
40
+ /**
41
+ * The options for defining a plugin's vitest configuration.
42
+ */
43
+ export interface DefineObsidianPluginVitestConfigOptions {
44
+ /**
45
+ * A function that builds projects the base configuration does not know about, such as a plugin's own
46
+ * `integration-tests:demo-vault` project. The returned projects are appended after the standard five.
47
+ *
48
+ * @param context - The vitest configuration context.
49
+ * @returns The extra projects.
50
+ */
51
+ readonly customProjects?: (context: ObsidianPluginVitestConfigContext) => TestProjectConfiguration[];
52
+ /**
53
+ * A function that edits the vitest configuration context before it is assembled into a configuration.
54
+ *
55
+ * @param context - The vitest configuration context.
56
+ */
57
+ readonly editContext?: (context: ObsidianPluginVitestConfigContext) => void;
58
+ }
59
+ /**
60
+ * The context for defining a plugin's vitest configuration.
61
+ *
62
+ * Every member is live: the arrays and objects it exposes are the very ones the assembled configuration
63
+ * is built from, so editing them in place through
64
+ * {@link DefineObsidianPluginVitestConfigOptions.editContext} is what customizes the result.
65
+ */
66
+ export declare class ObsidianPluginVitestConfigContext {
67
+ /**
68
+ * The `integration-tests:android` project, running the mobile-only and cross-platform suites against an
69
+ * Android emulator through Appium.
70
+ */
71
+ readonly android: ObsidianPluginVitestProjectConfig;
72
+ /**
73
+ * The per-test budget of the Android integration project, in milliseconds. Booting an emulator and
74
+ * driving it over Appium is slower than the desktop path, hence its own constant.
75
+ *
76
+ * @default `60000`
77
+ */
78
+ readonly androidTimeoutInMilliseconds = 60000;
79
+ /**
80
+ * The per-test budget of the regular integration projects, in milliseconds.
81
+ *
82
+ * It deliberately CLEARS the transports' per-eval cap rather than matching it, so that a closure which
83
+ * outruns the cap fails with the harness's `EvalCapExceededError` — naming the cap and the remedy —
84
+ * instead of with vitest's anonymous timeout. Lowering it to the cap restores that blind spot.
85
+ *
86
+ * @default `45000`
87
+ */
88
+ readonly bigTimeoutInMilliseconds: number;
89
+ /**
90
+ * The coverage `exclude` globs. Push onto it to drop more files from the coverage report.
91
+ *
92
+ * Declaration files are excluded by default because the coverage `include` below is `src/**\/*.ts`,
93
+ * which a `.d.ts` matches. A declaration file emits no runtime code, so it reports 0% and no test can
94
+ * ever raise it — a plugin that grows one under `src/` silently loses its 100% gate, and the usual
95
+ * remedy of an inline `v8 ignore` comment does not apply to a type-only file.
96
+ */
97
+ readonly coverageExclude: string[];
98
+ /**
99
+ * The `integration-tests:desktop` project, running the desktop-only and cross-platform suites against a
100
+ * real desktop Obsidian over CDP.
101
+ */
102
+ readonly desktop: ObsidianPluginVitestProjectConfig;
103
+ /**
104
+ * The `integration-tests:desktop-performance` project, running the at-scale suites. It is declared for
105
+ * every plugin even when there is no such suite yet — `passWithNoTests` makes an empty project free,
106
+ * and the matching `test:integration:desktop:performance` script exists in every plugin built on this library.
107
+ *
108
+ * A plugin's `test:integration` aggregate leaves this project out on purpose, and it stays out even on a
109
+ * machine with a desktop Obsidian set up. The reason is the fixture rather than the cost: a perf suite
110
+ * needs its own generated, populated vault, sized through env vars, and the aggregate's small temporary
111
+ * vault is the wrong one. The 600 s below is a timeout, not a duration — measured end to end, most perf
112
+ * suites finish in seconds, and only one that generates tens of thousands of notes takes minutes.
113
+ *
114
+ * Its CDP transport's per-eval cap is raised to 600 s as well (the budget clears it by the usual
115
+ * margin), because a perf suite's whole measurement is typically ONE long in-page evaluation, which the
116
+ * transport's 30 s default killed as a bare `CDP command timed out … Runtime.evaluate` naming neither the
117
+ * wait nor the assertion. Three plugins had each hand-written this raise in their own `editContext`
118
+ * before it moved here. Unlike a raised desktop cap, which is a backstop rather than a budget a closure
119
+ * may spend, this one IS a budget: `no-over-cap-wait-in-eval-in-obsidian` reads it for these files and
120
+ * for no other.
121
+ *
122
+ * No routine command runs them, but something does: a weekly sweep runs every plugin's
123
+ * `test:integration:desktop:performance`, which is also how to reach them by hand. Adding them to that
124
+ * aggregate is drift, not a gap to close.
125
+ */
126
+ readonly desktopPerformance: ObsidianPluginVitestProjectConfig;
127
+ /**
128
+ * The unit test files that redefine `window`, `document`, `location` or `top`, which the `unit-tests`
129
+ * project's VM pool cannot run.
130
+ *
131
+ * Under `pool: 'vmThreads'` those four are non-configurable properties of the VM global, so
132
+ * `vi.stubGlobal('window', …)` or `Object.defineProperty(window, 'location', …)` throws
133
+ * `Cannot redefine property`. That is JS semantics, not a bug to route around. Every other global stays
134
+ * configurable and stubs normally.
135
+ *
136
+ * Push a file here and it leaves `unit-tests` for a sibling `unit-tests:global-stubs` project that is
137
+ * identical except for the pool, which is the default one. A plugin's `test` and `test:coverage` scripts
138
+ * name `unit-tests`, which also selects every `unit-tests:*` project, so the sibling runs and is covered
139
+ * without a script change. It is emitted only when this list is non-empty.
140
+ *
141
+ * To keep a whole suite on the default pool instead, set `unitTests.pool` to `'forks'` and say why.
142
+ */
143
+ readonly globalStubTestFiles: string[];
144
+ /**
145
+ * The multiplier applied to a project's test budget to get its hook budget. A hook typically populates
146
+ * and opens a vault, so it needs several times what a single test does.
147
+ *
148
+ * @default `4`
149
+ */
150
+ readonly hookTimeoutMultiplier = 4;
151
+ /**
152
+ * The `integration-tests:no-app` project, running the suites that need no Obsidian instance at all.
153
+ */
154
+ readonly noApp: ObsidianPluginVitestProjectConfig;
155
+ /**
156
+ * The per-eval cap the performance integration project gives its CDP transport, in milliseconds.
157
+ *
158
+ * @default `600000`
159
+ */
160
+ readonly performanceEvalCapInMilliseconds = 600000;
161
+ /**
162
+ * The per-test budget of the performance integration project, in milliseconds. A performance vault is
163
+ * pre-populated with tens of thousands of notes before Obsidian opens, so both its setup and its tests
164
+ * need far more time than the regular integration projects.
165
+ *
166
+ * Like the regular budget, it CLEARS the project's per-eval cap
167
+ * ({@link ObsidianPluginVitestConfigContext.performanceEvalCapInMilliseconds}) rather than matching it,
168
+ * so an evaluation that outruns the cap reports itself instead of dying as vitest's anonymous timeout.
169
+ *
170
+ * @default `615000`
171
+ */
172
+ readonly performanceTimeoutInMilliseconds: number;
173
+ /**
174
+ * The reporters the run prints through.
175
+ *
176
+ * Pinned rather than left to vitest, which resolves an unset `reporters` differently for a developer
177
+ * and for an AI coding session — see {@link DEFAULT_VITEST_REPORTERS} for the whole of why, and for
178
+ * what it deliberately leaves to vitest 5 itself.
179
+ *
180
+ * Push onto it to add a reporter beside the pinned one.
181
+ *
182
+ * @default {@link DEFAULT_VITEST_REPORTERS}
183
+ */
184
+ readonly reporters: ObsidianPluginVitestReporter[];
185
+ /**
186
+ * The `unit-tests` project, running the mocked-Obsidian suites in `jsdom`.
187
+ */
188
+ readonly unitTests: ObsidianPluginVitestProjectConfig;
189
+ /**
190
+ * Creates a new context seeded with the standard projects.
191
+ */
192
+ constructor();
193
+ }
194
+ /**
195
+ * Defines the vitest configuration for an Obsidian plugin.
196
+ *
197
+ * @param options - The options for defining the configuration.
198
+ * @returns The vitest configuration.
199
+ */
200
+ export declare function defineObsidianPluginVitestConfig(options?: DefineObsidianPluginVitestConfigOptions): ViteUserConfig;