@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,200 @@
1
+ /// <reference path="../index.d.cts" />
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' with { 'resolution-mode': 'import' };
20
+ import type { TestProjectConfiguration, TestProjectInlineConfiguration, ViteUserConfig } from 'vitest/config' with { 'resolution-mode': 'import' };
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;
@@ -0,0 +1,262 @@
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 keepName($unknown) {
37
+ return $unknown;
38
+ }
39
+
40
+ (function initCjs() {
41
+ const globalThisRecord = globalThis;
42
+ ensureDisposeSymbols();
43
+ globalThisRecord["__name"] ??= keepName;
44
+ globalThisRecord["__extractDefault"] ??= extractDefault;
45
+ ensureBrowserProcess();
46
+ function extractDefault(module) {
47
+ return module && module.__esModule && "default" in module ? module.default : module;
48
+ }
49
+ })();
50
+ })();
51
+ (function patchObsidianRequire() {
52
+ const originalRequire = require;
53
+ if (!originalRequire || originalRequire.__isPatched) {
54
+ return;
55
+ }
56
+
57
+ require = Object.assign(
58
+ (id) => requirePatched(id),
59
+ originalRequire,
60
+ {
61
+ __isPatched: true
62
+ }
63
+ );
64
+
65
+ function extractDefault(module) {
66
+ return module && module.__esModule && 'default' in module ? module.default : module;
67
+ }
68
+
69
+ const OBSIDIAN_BUILT_IN_MODULE_NAMES = new Set([
70
+ '@codemirror/autocomplete',
71
+ '@codemirror/collab',
72
+ '@codemirror/commands',
73
+ '@codemirror/language',
74
+ '@codemirror/lint',
75
+ '@codemirror/search',
76
+ '@codemirror/state',
77
+ '@codemirror/text',
78
+ '@codemirror/view',
79
+ '@lezer/common',
80
+ '@lezer/highlight',
81
+ '@lezer/lr',
82
+ 'obsidian']
83
+ );
84
+
85
+ const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = new Set([
86
+ '@codemirror/closebrackets',
87
+ '@codemirror/comment',
88
+ '@codemirror/fold',
89
+ '@codemirror/gutter',
90
+ '@codemirror/highlight',
91
+ '@codemirror/history',
92
+ '@codemirror/matchbrackets',
93
+ '@codemirror/panel',
94
+ '@codemirror/rangeset',
95
+ '@codemirror/rectangular-selection',
96
+ '@codemirror/stream-parser',
97
+ '@codemirror/tooltip']
98
+ );
99
+
100
+ function requirePatched(id) {
101
+ if (OBSIDIAN_BUILT_IN_MODULE_NAMES.has(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.has(id)) {
102
+ return originalRequire?.(id);
103
+ }
104
+
105
+ // eslint-disable-next-line @typescript-eslint/no-deprecated, obsidianmd/no-global-this -- Need access to app. Actively use globalThis.
106
+ if (globalThis.app.isMobile) {
107
+ if (id === 'process' || id === 'node:process') {
108
+ // eslint-disable-next-line no-console -- Valid usage.
109
+ console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
110
+
111
+ return process;
112
+ }
113
+ } else {
114
+ const module = originalRequire?.(id);
115
+ if (module) {
116
+ return extractDefault(module);
117
+ }
118
+ }
119
+
120
+ // eslint-disable-next-line no-console -- Valid usage.
121
+ console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
122
+ return {};
123
+ }
124
+ })();
125
+
126
+ "use strict";
127
+ var __defProp = Object.defineProperty;
128
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
129
+ var __getOwnPropNames = Object.getOwnPropertyNames;
130
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
131
+ var __export = (target, all) => {
132
+ for (var name in all)
133
+ __defProp(target, name, { get: all[name], enumerable: true });
134
+ };
135
+ var __copyProps = (to, from, except, desc) => {
136
+ if (from && typeof from === "object" || typeof from === "function") {
137
+ for (let key of __getOwnPropNames(from))
138
+ if (!__hasOwnProp.call(to, key) && key !== except)
139
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
140
+ }
141
+ return to;
142
+ };
143
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
144
+ var version_exports = {};
145
+ __export(version_exports, {
146
+ copyUpdatedManifest: () => copyUpdatedManifest,
147
+ parseVersionArguments: () => parseVersionArguments,
148
+ updateVersion: () => updateVersion
149
+ });
150
+ module.exports = __toCommonJS(version_exports);
151
+ var import_fs = require('@mnaoumov/typescript-dev-toolkit/fs');
152
+ var import_json = require('@mnaoumov/typescript-dev-toolkit/json');
153
+ var import_root = require('@mnaoumov/typescript-dev-toolkit/root');
154
+ var import_version = require('@mnaoumov/typescript-dev-toolkit/version');
155
+ var import_path = require('@mnaoumov/typescript-lib/path');
156
+ var import_type_guards = require('@mnaoumov/typescript-lib/type-guards');
157
+ var import_node_fs = require('node:fs');
158
+ var import_promises = require('node:fs/promises');
159
+ var import_node_util = require('node:util');
160
+ var import_demo_vault = require('./demo-vault.cjs');
161
+ var import_obsidian_plugin_repo_paths = require('./obsidian-plugin-repo-paths.cjs');
162
+ const DESKTOP_RELEASES_JSON_URL = "https://raw.githubusercontent.com/obsidianmd/obsidian-releases/master/desktop-releases.json";
163
+ async function copyUpdatedManifest() {
164
+ await (0, import_promises.cp)(
165
+ (0, import_root.resolvePathFromRootSafe)({ path: import_obsidian_plugin_repo_paths.ObsidianPluginRepoPaths.ManifestJson }),
166
+ (0, import_root.resolvePathFromRootSafe)({ path: (0, import_path.join)(import_obsidian_plugin_repo_paths.ObsidianPluginRepoPaths.DistBuild, import_obsidian_plugin_repo_paths.ObsidianPluginRepoPaths.ManifestJson) }),
167
+ { force: true }
168
+ );
169
+ }
170
+ function parseVersionArguments($arguments) {
171
+ const { positionals, values } = (0, import_node_util.parseArgs)({
172
+ allowPositionals: true,
173
+ // eslint-disable-next-line unicorn/name-replacements -- `args` is the option name Node's `parseArgs` reads.
174
+ args: $arguments,
175
+ options: {
176
+ ...import_version.VERSION_ARGUMENT_OPTIONS,
177
+ "min-app-version": { type: "string" },
178
+ "no-demo-vault": { type: "boolean" }
179
+ }
180
+ });
181
+ return {
182
+ options: {
183
+ ...(0, import_version.toUpdateVersionOptions)(values),
184
+ minAppVersion: values["min-app-version"],
185
+ shouldArchiveDemoVault: !(values["no-demo-vault"] ?? false)
186
+ },
187
+ versionUpdateType: positionals[0]
188
+ };
189
+ }
190
+ async function updateVersion(versionUpdateType, options = {}) {
191
+ const {
192
+ minAppVersion,
193
+ prepareGitHubRelease,
194
+ shouldArchiveDemoVault = true,
195
+ ...genericOptions
196
+ } = options;
197
+ await (0, import_version.updateVersion)(versionUpdateType, {
198
+ ...genericOptions,
199
+ getReleaseAssetPaths: getPluginReleaseAssetPaths,
200
+ async prepareGitHubRelease(newVersion) {
201
+ await prepareGitHubRelease?.(newVersion);
202
+ if (shouldArchiveDemoVault) {
203
+ await (0, import_demo_vault.archivePluginDemoVault)();
204
+ }
205
+ },
206
+ async updateVersionInExtraFiles(newVersion) {
207
+ await updateVersionInFilesForPlugin(newVersion, minAppVersion);
208
+ }
209
+ });
210
+ }
211
+ async function getLatestObsidianVersion() {
212
+ const response = await fetch(DESKTOP_RELEASES_JSON_URL);
213
+ const desktopReleasesJson = await response.json();
214
+ return (0, import_type_guards.ensureNonNullable)(desktopReleasesJson.latestVersion, "Could not find the latest desktop Obsidian version");
215
+ }
216
+ async function getPluginReleaseAssetPaths() {
217
+ const buildFolder = (0, import_root.resolvePathFromRootSafe)({ path: import_obsidian_plugin_repo_paths.ObsidianPluginRepoPaths.DistBuild });
218
+ const fileNames = await (0, import_fs.readdirPosix)(buildFolder);
219
+ return fileNames.map((fileName) => (0, import_path.join)(buildFolder, fileName));
220
+ }
221
+ async function updateVersionInFilesForPlugin(newVersion, minAppVersion) {
222
+ const manifestBetaJsonPath = (0, import_root.resolvePathFromRootSafe)({ path: import_obsidian_plugin_repo_paths.ObsidianPluginRepoPaths.ManifestBetaJson });
223
+ if ((0, import_version.isPreRelease)(newVersion)) {
224
+ await (0, import_promises.cp)(
225
+ (0, import_root.resolvePathFromRootSafe)({ path: import_obsidian_plugin_repo_paths.ObsidianPluginRepoPaths.ManifestJson }),
226
+ manifestBetaJsonPath,
227
+ { force: true }
228
+ );
229
+ await (0, import_json.editJson)({
230
+ editFunction: (manifest) => {
231
+ manifest.version = newVersion;
232
+ },
233
+ path: import_obsidian_plugin_repo_paths.ObsidianPluginRepoPaths.ManifestBetaJson
234
+ });
235
+ } else {
236
+ const resolvedMinAppVersion = minAppVersion ?? await getLatestObsidianVersion();
237
+ await (0, import_json.editJson)({
238
+ editFunction: (manifest) => {
239
+ manifest.minAppVersion = resolvedMinAppVersion;
240
+ manifest.version = newVersion;
241
+ },
242
+ path: import_obsidian_plugin_repo_paths.ObsidianPluginRepoPaths.ManifestJson
243
+ });
244
+ await (0, import_json.editJson)({
245
+ editFunction: (versions) => {
246
+ versions[newVersion] = resolvedMinAppVersion;
247
+ },
248
+ path: import_obsidian_plugin_repo_paths.ObsidianPluginRepoPaths.VersionsJson
249
+ });
250
+ if ((0, import_node_fs.existsSync)(manifestBetaJsonPath)) {
251
+ await (0, import_promises.rm)(manifestBetaJsonPath);
252
+ }
253
+ }
254
+ await copyUpdatedManifest();
255
+ }
256
+ // Annotate the CommonJS export names for ESM import in node:
257
+ 0 && (module.exports = {
258
+ copyUpdatedManifest,
259
+ parseVersionArguments,
260
+ updateVersion
261
+ });
262
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vc3JjL3ZlcnNpb24udHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBSZWxlYXNlcyBhbiBPYnNpZGlhbiBwbHVnaW46IHRoZSBnZW5lcmljIHJlbGVhc2UgZnJvbSBgQG1uYW91bW92L3R5cGVzY3JpcHQtZGV2LXRvb2xraXQvdmVyc2lvbmAsIHBsdXMgd2hhdCBvbmx5IGFcbiAqIHBsdWdpbiBoYXMgXHUyMDE0IGBt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Npb25HZW5lcmljIl0KfQo=
@@ -0,0 +1,92 @@
1
+ /// <reference path="./index.d.cts" />
2
+ /**
3
+ * @file
4
+ *
5
+ * Releases an Obsidian plugin: the generic release from `@mnaoumov/typescript-dev-toolkit/version`, plus what only a
6
+ * plugin has — `manifest.json` (and `manifest-beta.json` for a pre-release) and `versions.json` bumped with the
7
+ * plugin's `minAppVersion`, the updated manifest copied into `dist/build`, the demo vault archived as a release
8
+ * asset, and the files in `dist/build` attached to the GitHub release instead of an `npm pack` tarball.
9
+ */
10
+ import type { ParsedVersionArguments as GenericParsedVersionArguments, UpdateVersionOptions as GenericUpdateVersionOptions } from '@mnaoumov/typescript-dev-toolkit/version' with { 'resolution-mode': 'import' };
11
+ /**
12
+ * Type representing the structure of Obsidian's `desktop-releases.json` feed.
13
+ *
14
+ * This is the feed the desktop app itself updates from, so it is the only source that states a version
15
+ * desktop users can actually run.
16
+ */
17
+ export interface DesktopReleasesJson {
18
+ /**
19
+ * The latest Obsidian version available for desktop.
20
+ */
21
+ latestVersion: string;
22
+ }
23
+ /**
24
+ * Type representing the manifest file format for Obsidian plugins.
25
+ */
26
+ export interface Manifest {
27
+ /**
28
+ * A minimum Obsidian version required for the plugin.
29
+ */
30
+ minAppVersion: string;
31
+ /**
32
+ * A version of the plugin.
33
+ */
34
+ version: string;
35
+ }
36
+ /**
37
+ * The result of parsing the command-line arguments for a plugin release.
38
+ */
39
+ export interface ParsedVersionArguments extends GenericParsedVersionArguments {
40
+ /**
41
+ * The {@link UpdateVersionOptions} parsed from the flags.
42
+ */
43
+ readonly options: UpdateVersionOptions;
44
+ }
45
+ /**
46
+ * Options for {@link updateVersion}: the generic release options plus the plugin's own.
47
+ */
48
+ export interface UpdateVersionOptions extends GenericUpdateVersionOptions {
49
+ /**
50
+ * An explicit `minAppVersion` to write into the plugin's `manifest.json` and its new `versions.json`
51
+ * entry. When set, it is used verbatim and the latest Obsidian desktop version is not fetched at all.
52
+ *
53
+ * Set this when the plugin has a known minimum it actually requires, rather than tracking whatever
54
+ * Obsidian released most recently. Only applies to non-pre-release versions (a pre-release copies the
55
+ * existing `manifest.json` and never writes `minAppVersion`).
56
+ *
57
+ * @default the latest Obsidian desktop version
58
+ */
59
+ readonly minAppVersion?: string | undefined;
60
+ /**
61
+ * Whether to archive the plugin's demo vault (`demo-vault/` in the repo root) as a release artifact. Ignored
62
+ * when the repo has no `demo-vault/` folder.
63
+ *
64
+ * @default `true`
65
+ */
66
+ readonly shouldArchiveDemoVault?: boolean;
67
+ }
68
+ /**
69
+ * Copies the updated manifest file to the distribution build folder.
70
+ *
71
+ * @returns A {@link Promise} that resolves when the copy operation is complete.
72
+ */
73
+ export declare function copyUpdatedManifest(): Promise<void>;
74
+ /**
75
+ * Parses the command-line arguments for a plugin release: every flag the generic `parseVersionArguments`
76
+ * recognizes, plus two of the plugin's own:
77
+ * - `--min-app-version=<x.y.z>` — write this `minAppVersion` into the plugin's `manifest.json` and its new
78
+ * `versions.json` entry instead of tracking the latest Obsidian desktop version.
79
+ * - `--no-demo-vault` — skip archiving the plugin's demo vault (`demo-vault/`) as a release artifact.
80
+ *
81
+ * @param $arguments - The command-line arguments to parse (typically `process.argv.slice(2)`).
82
+ * @returns The {@link ParsedVersionArguments} containing the version update type and the options.
83
+ */
84
+ export declare function parseVersionArguments($arguments: string[]): ParsedVersionArguments;
85
+ /**
86
+ * Releases the plugin. See the `@file` overview for what it adds to the generic release.
87
+ *
88
+ * @param versionUpdateType - The type of version update to perform (major, minor, patch, premajor, preminor, prepatch, prerelease, or x.y.z[-suffix]).
89
+ * @param options - The {@link UpdateVersionOptions} controlling the release behavior.
90
+ * @returns A {@link Promise} that resolves when the release is complete.
91
+ */
92
+ export declare function updateVersion(versionUpdateType?: string, options?: UpdateVersionOptions): Promise<void>;