@mnaoumov/obsidian-dev-toolkit 0.0.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -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 +782 -0
  15. package/dist/demo-vault-helper/manifest.json +9 -0
  16. package/dist/integration-test-plugin/main.js +45388 -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 +335 -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 +253 -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 +226 -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 +192 -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 +375 -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 +247 -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 +184 -0
  31. package/dist/lib/cjs/bundlers/esbuild-impl/rename-css-plugin.d.cts +14 -0
  32. package/dist/lib/cjs/bundlers/esbuild.cjs +177 -0
  33. package/dist/lib/cjs/bundlers/esbuild.d.cts +11 -0
  34. package/dist/lib/cjs/bundlers/index.cjs +180 -0
  35. package/dist/lib/cjs/bundlers/index.d.cts +3 -0
  36. package/dist/lib/cjs/demo-vault-app-json.cjs +199 -0
  37. package/dist/lib/cjs/demo-vault-app-json.d.cts +93 -0
  38. package/dist/lib/cjs/demo-vault-buttons.cjs +580 -0
  39. package/dist/lib/cjs/demo-vault-buttons.d.cts +259 -0
  40. package/dist/lib/cjs/demo-vault-coverage.cjs +725 -0
  41. package/dist/lib/cjs/demo-vault-coverage.d.cts +533 -0
  42. package/dist/lib/cjs/demo-vault.cjs +309 -0
  43. package/dist/lib/cjs/demo-vault.d.cts +33 -0
  44. package/dist/lib/cjs/formatters/dprint.cjs +173 -0
  45. package/dist/lib/cjs/formatters/dprint.d.cts +15 -0
  46. package/dist/lib/cjs/formatters/index.cjs +177 -0
  47. package/dist/lib/cjs/formatters/index.d.cts +2 -0
  48. package/dist/lib/cjs/index.cjs +207 -0
  49. package/dist/lib/cjs/index.d.cts +16 -0
  50. package/dist/lib/cjs/integration-test-setup.cjs +142 -0
  51. package/dist/lib/cjs/integration-test-setup.d.cts +33 -0
  52. package/dist/lib/cjs/integration-test-vitest-global-setup.cjs +176 -0
  53. package/dist/lib/cjs/integration-test-vitest-global-setup.d.cts +39 -0
  54. package/dist/lib/cjs/jest-setup.cjs +147 -0
  55. package/dist/lib/cjs/jest-setup.d.cts +13 -0
  56. package/dist/lib/cjs/linters/eslint-config.cjs +365 -0
  57. package/dist/lib/cjs/linters/eslint-config.d.cts +25 -0
  58. package/dist/lib/cjs/linters/eslint-rules/index.cjs +201 -0
  59. package/dist/lib/cjs/linters/eslint-rules/index.d.cts +10 -0
  60. package/dist/lib/cjs/linters/eslint-rules/manifest-description.cjs +268 -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 +231 -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 +228 -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 +229 -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 +329 -0
  69. package/dist/lib/cjs/linters/eslint-rules/manifest-schema.d.cts +45 -0
  70. package/dist/lib/cjs/linters/eslint-rules/no-over-cap-wait-in-eval-in-obsidian.cjs +670 -0
  71. package/dist/lib/cjs/linters/eslint-rules/no-over-cap-wait-in-eval-in-obsidian.d.cts +10 -0
  72. package/dist/lib/cjs/linters/eslint-rules/no-untrusted-input-events.cjs +260 -0
  73. package/dist/lib/cjs/linters/eslint-rules/no-untrusted-input-events.d.cts +10 -0
  74. package/dist/lib/cjs/linters/eslint-rules/obsidian-dev-utils-plugin.cjs +186 -0
  75. package/dist/lib/cjs/linters/eslint-rules/obsidian-dev-utils-plugin.d.cts +13 -0
  76. package/dist/lib/cjs/linters/eslint-rules/require-component-suffix.cjs +291 -0
  77. package/dist/lib/cjs/linters/eslint-rules/require-component-suffix.d.cts +18 -0
  78. package/dist/lib/cjs/linters/eslint.cjs +173 -0
  79. package/dist/lib/cjs/linters/eslint.d.cts +15 -0
  80. package/dist/lib/cjs/linters/index.cjs +189 -0
  81. package/dist/lib/cjs/linters/index.d.cts +6 -0
  82. package/dist/lib/cjs/linters/markdownlint.cjs +173 -0
  83. package/dist/lib/cjs/linters/markdownlint.d.cts +15 -0
  84. package/dist/lib/cjs/linters/obsidianmd-rule-custom-message.cjs +189 -0
  85. package/dist/lib/cjs/linters/obsidianmd-rule-custom-message.d.cts +40 -0
  86. package/dist/lib/cjs/obsidian-plugin-repo-paths.cjs +229 -0
  87. package/dist/lib/cjs/obsidian-plugin-repo-paths.d.cts +253 -0
  88. package/dist/lib/cjs/setup.cjs +176 -0
  89. package/dist/lib/cjs/setup.d.cts +21 -0
  90. package/dist/lib/cjs/templates.cjs +185 -0
  91. package/dist/lib/cjs/templates.d.cts +13 -0
  92. package/dist/lib/cjs/test-runners/index.cjs +183 -0
  93. package/dist/lib/cjs/test-runners/index.d.cts +4 -0
  94. package/dist/lib/cjs/test-runners/integration-test-plugin.cjs +224 -0
  95. package/dist/lib/cjs/test-runners/integration-test-plugin.d.cts +44 -0
  96. package/dist/lib/cjs/test-runners/performance-eval-cap.cjs +170 -0
  97. package/dist/lib/cjs/test-runners/performance-eval-cap.d.cts +27 -0
  98. package/dist/lib/cjs/test-runners/stale-build-global-setup.cjs +230 -0
  99. package/dist/lib/cjs/test-runners/stale-build-global-setup.d.cts +86 -0
  100. package/dist/lib/cjs/test-runners/vitest-config.cjs +497 -0
  101. package/dist/lib/cjs/test-runners/vitest-config.d.cts +200 -0
  102. package/dist/lib/cjs/version.cjs +275 -0
  103. package/dist/lib/cjs/version.d.cts +92 -0
  104. package/dist/lib/cjs/vitest-setup.cjs +147 -0
  105. package/dist/lib/cjs/vitest-setup.d.cts +11 -0
  106. package/dist/lib/esm/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.d.mts +38 -0
  107. package/dist/lib/esm/bundlers/esbuild-impl/copy-to-obsidian-plugins-folder-plugin.mjs +226 -0
  108. package/dist/lib/esm/bundlers/esbuild-impl/dependency.d.mts +20 -0
  109. package/dist/lib/esm/bundlers/esbuild-impl/dependency.mjs +138 -0
  110. package/dist/lib/esm/bundlers/esbuild-impl/fix-source-maps-plugin.d.mts +34 -0
  111. package/dist/lib/esm/bundlers/esbuild-impl/fix-source-maps-plugin.mjs +116 -0
  112. package/dist/lib/esm/bundlers/esbuild-impl/index.d.mts +7 -0
  113. package/dist/lib/esm/bundlers/esbuild-impl/index.mjs +64 -0
  114. package/dist/lib/esm/bundlers/esbuild-impl/obsidian-plugin-builder.d.mts +98 -0
  115. package/dist/lib/esm/bundlers/esbuild-impl/obsidian-plugin-builder.mjs +255 -0
  116. package/dist/lib/esm/bundlers/esbuild-impl/preprocess-plugin.d.mts +30 -0
  117. package/dist/lib/esm/bundlers/esbuild-impl/preprocess-plugin.mjs +134 -0
  118. package/dist/lib/esm/bundlers/esbuild-impl/rename-css-plugin.d.mts +14 -0
  119. package/dist/lib/esm/bundlers/esbuild-impl/rename-css-plugin.mjs +71 -0
  120. package/dist/lib/esm/bundlers/esbuild.d.mts +11 -0
  121. package/dist/lib/esm/bundlers/esbuild.mjs +66 -0
  122. package/dist/lib/esm/bundlers/index.d.mts +3 -0
  123. package/dist/lib/esm/bundlers/index.mjs +56 -0
  124. package/dist/lib/esm/demo-vault-app-json.d.mts +93 -0
  125. package/dist/lib/esm/demo-vault-app-json.mjs +83 -0
  126. package/dist/lib/esm/demo-vault-buttons.d.mts +259 -0
  127. package/dist/lib/esm/demo-vault-buttons.mjs +460 -0
  128. package/dist/lib/esm/demo-vault-coverage.d.mts +533 -0
  129. package/dist/lib/esm/demo-vault-coverage.mjs +626 -0
  130. package/dist/lib/esm/demo-vault.d.mts +33 -0
  131. package/dist/lib/esm/demo-vault.mjs +205 -0
  132. package/dist/lib/esm/formatters/dprint.d.mts +15 -0
  133. package/dist/lib/esm/formatters/dprint.mjs +60 -0
  134. package/dist/lib/esm/formatters/index.d.mts +2 -0
  135. package/dist/lib/esm/formatters/index.mjs +54 -0
  136. package/dist/lib/esm/index.d.mts +16 -0
  137. package/dist/lib/esm/index.mjs +74 -0
  138. package/dist/lib/esm/integration-test-setup.d.mts +33 -0
  139. package/dist/lib/esm/integration-test-setup.mjs +52 -0
  140. package/dist/lib/esm/integration-test-vitest-global-setup.d.mts +39 -0
  141. package/dist/lib/esm/integration-test-vitest-global-setup.mjs +65 -0
  142. package/dist/lib/esm/jest-setup.d.mts +13 -0
  143. package/dist/lib/esm/jest-setup.mjs +61 -0
  144. package/dist/lib/esm/linters/eslint-config.d.mts +25 -0
  145. package/dist/lib/esm/linters/eslint-config.mjs +247 -0
  146. package/dist/lib/esm/linters/eslint-rules/index.d.mts +10 -0
  147. package/dist/lib/esm/linters/eslint-rules/index.mjs +70 -0
  148. package/dist/lib/esm/linters/eslint-rules/manifest-description.d.mts +54 -0
  149. package/dist/lib/esm/linters/eslint-rules/manifest-description.mjs +154 -0
  150. package/dist/lib/esm/linters/eslint-rules/manifest-helpers.d.mts +141 -0
  151. package/dist/lib/esm/linters/eslint-rules/manifest-helpers.mjs +98 -0
  152. package/dist/lib/esm/linters/eslint-rules/manifest-id.d.mts +32 -0
  153. package/dist/lib/esm/linters/eslint-rules/manifest-id.mjs +117 -0
  154. package/dist/lib/esm/linters/eslint-rules/manifest-name.d.mts +30 -0
  155. package/dist/lib/esm/linters/eslint-rules/manifest-name.mjs +118 -0
  156. package/dist/lib/esm/linters/eslint-rules/manifest-schema.d.mts +45 -0
  157. package/dist/lib/esm/linters/eslint-rules/manifest-schema.mjs +220 -0
  158. package/dist/lib/esm/linters/eslint-rules/no-over-cap-wait-in-eval-in-obsidian.d.mts +10 -0
  159. package/dist/lib/esm/linters/eslint-rules/no-over-cap-wait-in-eval-in-obsidian.mjs +559 -0
  160. package/dist/lib/esm/linters/eslint-rules/no-untrusted-input-events.d.mts +10 -0
  161. package/dist/lib/esm/linters/eslint-rules/no-untrusted-input-events.mjs +146 -0
  162. package/dist/lib/esm/linters/eslint-rules/obsidian-dev-utils-plugin.d.mts +13 -0
  163. package/dist/lib/esm/linters/eslint-rules/obsidian-dev-utils-plugin.mjs +73 -0
  164. package/dist/lib/esm/linters/eslint-rules/require-component-suffix.d.mts +18 -0
  165. package/dist/lib/esm/linters/eslint-rules/require-component-suffix.mjs +175 -0
  166. package/dist/lib/esm/linters/eslint.d.mts +15 -0
  167. package/dist/lib/esm/linters/eslint.mjs +60 -0
  168. package/dist/lib/esm/linters/index.d.mts +6 -0
  169. package/dist/lib/esm/linters/index.mjs +62 -0
  170. package/dist/lib/esm/linters/markdownlint.d.mts +15 -0
  171. package/dist/lib/esm/linters/markdownlint.mjs +60 -0
  172. package/dist/lib/esm/linters/obsidianmd-rule-custom-message.d.mts +40 -0
  173. package/dist/lib/esm/linters/obsidianmd-rule-custom-message.mjs +75 -0
  174. package/dist/lib/esm/obsidian-plugin-repo-paths.d.mts +253 -0
  175. package/dist/lib/esm/obsidian-plugin-repo-paths.mjs +116 -0
  176. package/dist/lib/esm/setup.d.mts +21 -0
  177. package/dist/lib/esm/setup.mjs +63 -0
  178. package/dist/lib/esm/templates.d.mts +13 -0
  179. package/dist/lib/esm/templates.mjs +65 -0
  180. package/dist/lib/esm/test-runners/index.d.mts +4 -0
  181. package/dist/lib/esm/test-runners/index.mjs +58 -0
  182. package/dist/lib/esm/test-runners/integration-test-plugin.d.mts +44 -0
  183. package/dist/lib/esm/test-runners/integration-test-plugin.mjs +102 -0
  184. package/dist/lib/esm/test-runners/performance-eval-cap.d.mts +27 -0
  185. package/dist/lib/esm/test-runners/performance-eval-cap.mjs +56 -0
  186. package/dist/lib/esm/test-runners/stale-build-global-setup.d.mts +86 -0
  187. package/dist/lib/esm/test-runners/stale-build-global-setup.mjs +123 -0
  188. package/dist/lib/esm/test-runners/vitest-config.d.mts +200 -0
  189. package/dist/lib/esm/test-runners/vitest-config.mjs +377 -0
  190. package/dist/lib/esm/version.d.mts +92 -0
  191. package/dist/lib/esm/version.mjs +168 -0
  192. package/dist/lib/esm/vitest-setup.d.mts +11 -0
  193. package/dist/lib/esm/vitest-setup.mjs +61 -0
  194. package/dist/templates/.markdownlint-cli2.mjs +4 -0
  195. package/dist/templates/.nano-staged.mjs +4 -0
  196. package/dist/templates/commitlint.config.ts +3 -0
  197. package/dist/templates/dprint.json +26 -0
  198. package/dist/templates/eslint.config.mts +3 -0
  199. package/dist/templates/scripts/build/build-clean.ts +4 -0
  200. package/dist/templates/scripts/build/build-compile-svelte.ts +4 -0
  201. package/dist/templates/scripts/build/build-compile-typescript.ts +4 -0
  202. package/dist/templates/scripts/build/build-compile.ts +4 -0
  203. package/dist/templates/scripts/build/build-templates.ts +4 -0
  204. package/dist/templates/scripts/bundlers/esbuild/build.ts +4 -0
  205. package/dist/templates/scripts/bundlers/esbuild/dev.ts +4 -0
  206. package/dist/templates/scripts/commitlint-config.ts +3 -0
  207. package/dist/templates/scripts/eslint-config.ts +10 -0
  208. package/dist/templates/scripts/formatters/dprint/format-check.ts +8 -0
  209. package/dist/templates/scripts/formatters/dprint/format.ts +8 -0
  210. package/dist/templates/scripts/gate/gate.ts +10 -0
  211. package/dist/templates/scripts/linters/cspell/spellcheck.ts +8 -0
  212. package/dist/templates/scripts/linters/eslint/lint-fix.ts +8 -0
  213. package/dist/templates/scripts/linters/eslint/lint.ts +8 -0
  214. package/dist/templates/scripts/linters/markdownlint/lint-md-fix.ts +8 -0
  215. package/dist/templates/scripts/linters/markdownlint/lint-md.ts +8 -0
  216. package/dist/templates/scripts/linters/over-exposure/find-overexposed-fix.ts +25 -0
  217. package/dist/templates/scripts/linters/over-exposure/find-overexposed.ts +15 -0
  218. package/dist/templates/scripts/markdownlint-cli2-config.ts +3 -0
  219. package/dist/templates/scripts/nano-staged-config.ts +3 -0
  220. package/dist/templates/scripts/test-runners/vitest/test-coverage.ts +4 -0
  221. package/dist/templates/scripts/test-runners/vitest/test-watch.ts +4 -0
  222. package/dist/templates/scripts/test-runners/vitest/test.ts +4 -0
  223. package/dist/templates/scripts/version/version.ts +10 -0
  224. package/dist/templates/scripts/vitest-config.ts +3 -0
  225. package/dist/templates/vitest.config.ts +3 -0
  226. package/formatters/dprint/package.json +6 -0
  227. package/formatters/index/package.json +6 -0
  228. package/formatters/package.json +6 -0
  229. package/linters/eslint/package.json +6 -0
  230. package/linters/eslint-config/package.json +6 -0
  231. package/linters/eslint-rules/index/package.json +6 -0
  232. package/linters/eslint-rules/manifest-description/package.json +6 -0
  233. package/linters/eslint-rules/manifest-helpers/package.json +6 -0
  234. package/linters/eslint-rules/manifest-id/package.json +6 -0
  235. package/linters/eslint-rules/manifest-name/package.json +6 -0
  236. package/linters/eslint-rules/manifest-schema/package.json +6 -0
  237. package/linters/eslint-rules/no-over-cap-wait-in-eval-in-obsidian/package.json +6 -0
  238. package/linters/eslint-rules/no-untrusted-input-events/package.json +6 -0
  239. package/linters/eslint-rules/obsidian-dev-utils-plugin/package.json +6 -0
  240. package/linters/eslint-rules/package.json +6 -0
  241. package/linters/eslint-rules/require-component-suffix/package.json +6 -0
  242. package/linters/index/package.json +6 -0
  243. package/linters/markdownlint/package.json +6 -0
  244. package/linters/obsidianmd-rule-custom-message/package.json +6 -0
  245. package/linters/package.json +6 -0
  246. package/package.json +241 -13
  247. package/test-runners/index/package.json +6 -0
  248. package/test-runners/integration-test-plugin/package.json +6 -0
  249. package/test-runners/package.json +6 -0
  250. package/test-runners/performance-eval-cap/package.json +6 -0
  251. package/test-runners/stale-build-global-setup/package.json +6 -0
  252. package/test-runners/vitest-config/package.json +6 -0
@@ -0,0 +1,259 @@
1
+ /// <reference path="./index.d.cts" />
2
+ /**
3
+ * @file
4
+ *
5
+ * A vitest suite that opens every note of a plugin's in-repo `demo-vault/`, clicks each `code-button`
6
+ * in it against a real Obsidian, and fails on any button that errors or never reports a result.
7
+ *
8
+ * A demo vault's buttons are the one part of it no other gate can check. `lint:md` reads the markdown,
9
+ * the coverage suite ({@link ./demo-vault-coverage.ts | `registerDemoVaultCoverageSuite`}) checks the
10
+ * authoring conventions, and neither executes anything — a button whose `require('/demoSetup.ts')` path
11
+ * is wrong, or that calls an API that has since changed shape, fails at click time and nowhere else.
12
+ *
13
+ * The companion half — seeding the temp vault with the demo-vault tree, its `.obsidian` config, and the
14
+ * CodeScript Toolkit binary that turns ```` ```code-button ```` fences into buttons — is
15
+ * `buildDemoVaultPopulate` in `obsidian-integration-testing`; hand its result to the project's
16
+ * `globalSetup` and name CodeScript Toolkit in `enableCommunityPlugins`.
17
+ */
18
+ /**
19
+ * CodeScript Toolkit's manifest id. It is still the plugin's original `fix-require-modules` id, which
20
+ * no longer matches its name — the id is published, so it cannot be changed.
21
+ */
22
+ export declare const CODE_SCRIPT_TOOLKIT_PLUGIN_ID = "fix-require-modules";
23
+ /**
24
+ * The waiting budgets a single button click is allowed.
25
+ *
26
+ * Both are spent inside ONE transport call, so it is their SUM that
27
+ * {@link assertClickBudgetsFitTransportCap} bounds.
28
+ */
29
+ export interface ClickButtonTimeouts {
30
+ /**
31
+ * How long to wait for the clicked button to report a result.
32
+ */
33
+ readonly buttonResultTimeoutInMilliseconds: number;
34
+ /**
35
+ * How long to wait for the button itself to mount.
36
+ */
37
+ readonly settleTimeoutInMilliseconds: number;
38
+ }
39
+ /**
40
+ * The outcome of clicking one button.
41
+ */
42
+ export interface DemoVaultButtonResult {
43
+ /**
44
+ * The button's caption, as rendered.
45
+ */
46
+ readonly caption: string;
47
+ /**
48
+ * The result line CodeScript Toolkit printed under the button, truncated.
49
+ */
50
+ readonly output: string;
51
+ /**
52
+ * Whether the button reported success, reported an error, or never reported at all.
53
+ */
54
+ readonly status: 'error' | 'ok' | 'timeout' | 'unknown';
55
+ }
56
+ /**
57
+ * One demo-vault note and how many buttons its source declares.
58
+ */
59
+ export interface DemoVaultNote {
60
+ /**
61
+ * How many buttons the note's source renders, as counted by {@link countRenderedButtons}.
62
+ */
63
+ readonly buttonCount: number;
64
+ /**
65
+ * The captions of those buttons, in source order, as read by {@link listRenderedButtonCaptions}.
66
+ */
67
+ readonly captions: readonly string[];
68
+ /**
69
+ * The note's file name, relative to the demo vault root.
70
+ */
71
+ readonly name: string;
72
+ }
73
+ /**
74
+ * A button that is EXPECTED not to report success, so the suite does not fail on it.
75
+ */
76
+ export interface ExpectedNonOkButton {
77
+ /**
78
+ * A substring of the button's rendered caption.
79
+ */
80
+ readonly captionIncludes: string;
81
+ /**
82
+ * The note holding the button, relative to the demo vault root.
83
+ */
84
+ readonly note: string;
85
+ /**
86
+ * The status the button is expected to end in. Any other status still fails, so an error demo that
87
+ * starts timing out instead is reported rather than waved through.
88
+ */
89
+ readonly status: Exclude<DemoVaultButtonResult['status'], 'ok'>;
90
+ }
91
+ /**
92
+ * The options for {@link registerDemoVaultButtonSuite}.
93
+ */
94
+ export interface RegisterDemoVaultButtonSuiteOptions {
95
+ /**
96
+ * How long, in milliseconds, to wait for a clicked button to report a result.
97
+ *
98
+ * Bounded by the same sum as {@link RegisterDemoVaultButtonSuiteOptions.settleTimeoutInMilliseconds},
99
+ * and refused by the same throw at registration.
100
+ *
101
+ * @default `10000`
102
+ */
103
+ readonly buttonResultTimeoutInMilliseconds?: number;
104
+ /**
105
+ * Folders to skip whole, matched against both the folder name and its path relative to the demo vault
106
+ * root — for a group whose notes cannot run unattended, such as ones that first install a third-party
107
+ * plugin from the community store.
108
+ *
109
+ * @default `[]`
110
+ */
111
+ readonly excludedFolders?: readonly string[];
112
+ /**
113
+ * Note file names (relative to the demo vault root) to skip.
114
+ *
115
+ * @default `['README.md']`
116
+ */
117
+ readonly excludedNotes?: readonly string[];
118
+ /**
119
+ * Buttons that legitimately do not report success: an error demo, or a button that turns system
120
+ * messages off and so never prints the result line the suite classifies.
121
+ *
122
+ * @default `[]`
123
+ */
124
+ readonly expectedNonOkButtons?: readonly ExpectedNonOkButton[];
125
+ /**
126
+ * The repository root holding `demo-vault/`.
127
+ *
128
+ * @default the resolved repo root, falling back to `process.cwd()`.
129
+ */
130
+ readonly rootFolder?: string;
131
+ /**
132
+ * How long, in milliseconds, to wait for a note's preview and its buttons to mount.
133
+ *
134
+ * Together with `buttonResultTimeoutInMilliseconds` this must stay under the transport's ~30 s script
135
+ * timeout: one button click spends both inside a SINGLE evaluation, so a sum at or over the cap cannot
136
+ * be honoured and turns a real timeout into a bare `script timeout` naming only the transport.
137
+ * {@link registerDemoVaultButtonSuite} throws on such a pair rather than registering it.
138
+ *
139
+ * @default `12000`
140
+ */
141
+ readonly settleTimeoutInMilliseconds?: number;
142
+ /**
143
+ * Whether to dismiss any open modal while waiting for a clicked button's result, and again once it is
144
+ * classified.
145
+ *
146
+ * A button that `await`s an `alert` / `confirm` / `prompt` cannot report a result until somebody closes
147
+ * the dialog, so without this it ends as `timeout` — and the dialog it left open then sits over every
148
+ * later button in the run. Off by default, so no suite changes behavior unasked.
149
+ *
150
+ * @default `false`
151
+ */
152
+ readonly shouldDismissModals?: boolean;
153
+ }
154
+ /**
155
+ * Refuses a settle/result budget pair that a single transport call could never honour.
156
+ *
157
+ * `clickButton` waits for the button to mount and then for its result INSIDE ONE `evalInObsidian`
158
+ * closure, so the transport's script timeout bounds their sum rather than either one alone — and
159
+ * `RegisterDemoVaultButtonSuiteOptions` lets a consumer raise each independently, with nothing summing
160
+ * them. Raising `settleTimeoutInMilliseconds` to 20 000 for one slow note is an ordinary thing to do and
161
+ * silently puts the pair at the cap.
162
+ *
163
+ * Throwing here, at suite registration, is the whole value: the failure it replaces is a
164
+ * `WebDriverError: script timeout` raised mid-run against whichever button happened to be slowest,
165
+ * naming the transport and neither budget.
166
+ *
167
+ * @param timeouts - The {@link ClickButtonTimeouts} to bound.
168
+ */
169
+ export declare function assertClickBudgetsFitTransportCap(timeouts: ClickButtonTimeouts): void;
170
+ /**
171
+ * Counts the buttons a note's source will actually render.
172
+ *
173
+ * Three kinds of ` ```code-button ` fence render no clickable button, and a vault that DOCUMENTS code
174
+ * buttons is full of the first two:
175
+ *
176
+ * - A fence nested inside a longer or different fence (a ```` ````markdown ```` or `~~~` block) is a
177
+ * markdown SAMPLE shown to the reader; the renderer never sees it as a block.
178
+ * - An `isRaw: true` fence renders its output directly and no button element at all.
179
+ * - A fence whose info string carries anything after `code-button` uses the legacy argument syntax, which
180
+ * renders an error banner asking to update the config rather than the button.
181
+ *
182
+ * Counting any of them makes the suite's shortfall assertion unsatisfiable — it demands more buttons
183
+ * than the note can ever render — and an assertion that cannot pass gates nothing.
184
+ *
185
+ * The scan follows CommonMark's fence rules: a fence closes only on a run of the SAME character at least
186
+ * as long as the opener, with no info string, and one left open runs to the end of the document, where it
187
+ * still renders.
188
+ *
189
+ * @param source - The note's markdown.
190
+ * @returns How many buttons it renders.
191
+ */
192
+ export declare function countRenderedButtons(source: string): number;
193
+ /**
194
+ * Finds the captions declared by more than one button.
195
+ *
196
+ * The suite addresses a button by its caption — it collects the captions that mounted and clicks the
197
+ * button carrying each one — so two buttons sharing a caption collapse into one: the second is never
198
+ * clicked, and the note reads as declaring a button that never rendered.
199
+ *
200
+ * @param captions - A note's button captions.
201
+ * @returns Each caption occurring more than once, listed once, in order of first repeat.
202
+ */
203
+ export declare function findDuplicateCaptions(captions: readonly string[]): string[];
204
+ /**
205
+ * Builds the assertion message for a note's failing buttons.
206
+ *
207
+ * The captured output is included because a button's failure is a runtime one — the stack CodeScript
208
+ * Toolkit prints under it is the only diagnosis there is.
209
+ *
210
+ * @param noteName - The note the buttons belong to.
211
+ * @param failures - The failing buttons.
212
+ * @returns The message.
213
+ */
214
+ export declare function formatFailures(noteName: string, failures: readonly DemoVaultButtonResult[]): string;
215
+ /**
216
+ * Lists the captions of the buttons a note's source will actually render, in source order.
217
+ *
218
+ * Which fences render a button is decided exactly as {@link countRenderedButtons} describes. A caption is
219
+ * read from the fence's own config block; a fence naming none takes CodeScript Toolkit's default,
220
+ * `(no caption)`, which is what its button then shows.
221
+ *
222
+ * @param source - The note's markdown.
223
+ * @returns The captions, one per rendered button.
224
+ */
225
+ export declare function listRenderedButtonCaptions(source: string): string[];
226
+ /**
227
+ * Picks the buttons that failed and were not expected to.
228
+ *
229
+ * @param noteName - The note the results belong to, relative to the demo vault root.
230
+ * @param results - Every button's result in that note.
231
+ * @param expectedNonOkButtons - The buttons allowed to end in a given non-`ok` status.
232
+ * @returns The results that are not `ok` and match no {@link ExpectedNonOkButton}.
233
+ */
234
+ export declare function selectUnexpectedFailures(noteName: string, results: readonly DemoVaultButtonResult[], expectedNonOkButtons: readonly ExpectedNonOkButton[]): DemoVaultButtonResult[];
235
+ /**
236
+ * Lists the demo vault's notes that declare at least one `code-button`, walking group folders too.
237
+ *
238
+ * A vault big enough to need grouping puts its walkthroughs in numbered folders — and a root-only walk
239
+ * finds NONE of them, which is worse than it sounds: a vault whose notes are all grouped reports zero
240
+ * notes, and one that is partly grouped silently gates only the ungrouped part. Fixture and asset
241
+ * folders are still skipped, so what is walked is walkthroughs and nothing else.
242
+ *
243
+ * @param demoVaultPath - The demo vault root.
244
+ * @param excludedNotes - Note names to skip, matched against both the file name and the path relative
245
+ * to the vault root.
246
+ * @param excludedFolders - Folders to skip whole, matched the same way.
247
+ * @returns The notes, sorted by path.
248
+ */
249
+ export declare function listNotesWithButtons(demoVaultPath: string, excludedNotes: ReadonlySet<string>, excludedFolders?: ReadonlySet<string>): DemoVaultNote[];
250
+ /**
251
+ * Registers a vitest suite that clicks every `code-button` in the repo's demo vault.
252
+ *
253
+ * One `it` per note, and one `evalInObsidian` per button: a single closure runs as one CDP
254
+ * `Runtime.evaluate`, which the harness caps at 30 s, so a note with a dozen buttons would otherwise
255
+ * time out as a whole rather than reporting which button failed.
256
+ *
257
+ * @param options - The {@link RegisterDemoVaultButtonSuiteOptions}.
258
+ */
259
+ export declare function registerDemoVaultButtonSuite(options?: RegisterDemoVaultButtonSuiteOptions): void;