@mnaoumov/create-obsidian-plugin 0.0.0-stage → 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 (470) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +341 -2
  3. package/dist/main.js +4184 -0
  4. package/package.json +78 -4
  5. package/src/main.ts +650 -0
  6. package/templates/default/.depcheckrc.json.ejs +19 -0
  7. package/templates/default/.editorconfig.ejs +11 -0
  8. package/templates/default/.env.ejs +1 -0
  9. package/templates/default/.env@vault_has-vault-false.ejs +2 -0
  10. package/templates/default/.env@vault_has-vault-true.ejs +1 -0
  11. package/templates/default/.gitattributes.ejs +7 -0
  12. package/templates/default/.github/FUNDING.yml.ejs +3 -0
  13. package/templates/default/.github/ISSUE_TEMPLATE/bug_report.yml.ejs +71 -0
  14. package/templates/default/.github/ISSUE_TEMPLATE/config.yml.ejs +1 -0
  15. package/templates/default/.github/ISSUE_TEMPLATE/feature_request.yml.ejs +61 -0
  16. package/templates/default/.github/workflows/attest-release-assets.yml.ejs +24 -0
  17. package/templates/default/.github/workflows/ci.yml.ejs +20 -0
  18. package/templates/default/.github/workflows/ci.yml@steps_biome-linter.ejs +1 -0
  19. package/templates/default/.github/workflows/ci.yml@steps_cspell.ejs +1 -0
  20. package/templates/default/.github/workflows/ci.yml@steps_dprint.ejs +1 -0
  21. package/templates/default/.github/workflows/ci.yml@steps_eslint.ejs +1 -0
  22. package/templates/default/.github/workflows/ci.yml@steps_jest.ejs +1 -0
  23. package/templates/default/.github/workflows/ci.yml@steps_markdownlint.ejs +1 -0
  24. package/templates/default/.github/workflows/ci.yml@steps_prettier.ejs +1 -0
  25. package/templates/default/.github/workflows/ci.yml@steps_vitest.ejs +1 -0
  26. package/templates/default/.github/workflows/release.yml.ejs +27 -0
  27. package/templates/default/.github/workflows/update-license-year.yml.ejs +38 -0
  28. package/templates/default/.gitignore_common.ejs +27 -0
  29. package/templates/default/.gitignore_scss.ejs +1 -0
  30. package/templates/default/.gitignore_tailwind.ejs +3 -0
  31. package/templates/default/.husky/commit-msg.ejs +1 -0
  32. package/templates/default/.husky/pre-commit.ejs +1 -0
  33. package/templates/default/.markdownlint-cli2.mjs.ejs +4 -0
  34. package/templates/default/.nano-staged.mjs.ejs +5 -0
  35. package/templates/default/.npmrc.ejs +1 -0
  36. package/templates/default/.parcelrc.ejs +9 -0
  37. package/templates/default/.parcelrc@transformers_svelte.ejs +1 -0
  38. package/templates/default/.prettierignore.ejs +10 -0
  39. package/templates/default/.typesafe-i18n.json.ejs +5 -0
  40. package/templates/default/CONTRIBUTING.md.ejs +49 -0
  41. package/templates/default/CONTRIBUTING.md@demo-vault_dev-utils.ejs +15 -0
  42. package/templates/default/CONTRIBUTING.md@scripts_biome-formatter.ejs +1 -0
  43. package/templates/default/CONTRIBUTING.md@scripts_biome-linter.ejs +1 -0
  44. package/templates/default/CONTRIBUTING.md@scripts_conventional-commits.ejs +1 -0
  45. package/templates/default/CONTRIBUTING.md@scripts_cspell.ejs +1 -0
  46. package/templates/default/CONTRIBUTING.md@scripts_dev-utils.ejs +1 -0
  47. package/templates/default/CONTRIBUTING.md@scripts_dprint.ejs +1 -0
  48. package/templates/default/CONTRIBUTING.md@scripts_eslint.ejs +1 -0
  49. package/templates/default/CONTRIBUTING.md@scripts_jest.ejs +1 -0
  50. package/templates/default/CONTRIBUTING.md@scripts_markdownlint.ejs +1 -0
  51. package/templates/default/CONTRIBUTING.md@scripts_prettier.ejs +1 -0
  52. package/templates/default/CONTRIBUTING.md@scripts_vitest.ejs +1 -0
  53. package/templates/default/LICENSE.ejs +21 -0
  54. package/templates/default/README.md.ejs +28 -0
  55. package/templates/default/README.md@demo-vault_dev-utils.ejs +12 -0
  56. package/templates/default/README.md@preset_dev-utils.ejs +12 -0
  57. package/templates/default/README.md@support_has-funding.ejs +8 -0
  58. package/templates/default/babel.config.json.ejs +8 -0
  59. package/templates/default/babel.config.mjs.ejs +5 -0
  60. package/templates/default/biome.jsonc.ejs +47 -0
  61. package/templates/default/commitlint.config.ts.ejs +1 -0
  62. package/templates/default/cspell.json.ejs +67 -0
  63. package/templates/default/demo-vault/.gitignore.ejs +15 -0
  64. package/templates/default/demo-vault/.obsidian/app.json.ejs +4 -0
  65. package/templates/default/demo-vault/.obsidian/community-plugins.json.ejs +4 -0
  66. package/templates/default/demo-vault/00 Start.md.ejs +32 -0
  67. package/templates/default/demo-vault/00 Start.md@features_wasm.ejs +1 -0
  68. package/templates/default/demo-vault/01 Sample commands.md.ejs +38 -0
  69. package/templates/default/demo-vault/01 Sample commands.md@commands_wasm.ejs +4 -0
  70. package/templates/default/demo-vault/02 Settings.md.ejs +40 -0
  71. package/templates/default/demo-vault/03 WebAssembly.md.ejs +34 -0
  72. package/templates/default/demo-vault/Materials/01 Sample commands/Scratch note.md.ejs +5 -0
  73. package/templates/default/demo-vault/README.md.ejs +10 -0
  74. package/templates/default/demo-vault/_assets/CodeScriptToolkit/demoSetup.ts.ejs +88 -0
  75. package/templates/default/demo-vault/_assets/CodeScriptToolkit/demoSetup.ts@commands_wasm.ejs +10 -0
  76. package/templates/default/demo-vault/_assets/CodeScriptToolkit/startup.ts.ejs +17 -0
  77. package/templates/default/dprint.json_dev-utils.ejs +10 -0
  78. package/templates/default/dprint.json_standalone.ejs +26 -0
  79. package/templates/default/e2e/sample.spec.ts_obsidian-test.ejs +16 -0
  80. package/templates/default/e2e/sample.spec.ts_obsidian-test@lint-no-void-disable_dev-utils.ejs +3 -0
  81. package/templates/default/e2e/sample.spec.ts_obsidian-test@lint-no-void-enable_dev-utils.ejs +1 -0
  82. package/templates/default/e2e/sample.spec.ts_obsidian-test@unofficial_with-unofficial.ejs +13 -0
  83. package/templates/default/e2e/sample.spec.ts_wdio-obsidian.ejs +7 -0
  84. package/templates/default/e2e/sample.spec.ts_wdio-obsidian@unofficial_with-unofficial.ejs +15 -0
  85. package/templates/default/eslint.config.mts_dev-utils.ejs +1 -0
  86. package/templates/default/eslint.config.mts_standalone.ejs +119 -0
  87. package/templates/default/eslint.config.mts_standalone@extra-files_has-e2e.ejs +2 -0
  88. package/templates/default/jest.config.ts.ejs +57 -0
  89. package/templates/default/jest.config.ts@lint-root-dir_dev-utils.ejs +1 -0
  90. package/templates/default/jest.config.ts@ts-jest-tsconfig_solid.ejs +8 -0
  91. package/templates/default/linkinator.config.json.ejs +11 -0
  92. package/templates/default/manifest.json.ejs +11 -0
  93. package/templates/default/manifest.json@funding_has-funding.ejs +1 -0
  94. package/templates/default/manifest.json@platform_desktop-and-mobile.ejs +1 -0
  95. package/templates/default/manifest.json@platform_desktop-only.ejs +1 -0
  96. package/templates/default/package.json.ejs +32 -0
  97. package/templates/default/package.json@targets_parcel.ejs +36 -0
  98. package/templates/default/parcel-namer-obsidian.cjs.ejs +26 -0
  99. package/templates/default/parcel-resolver-obsidian.cjs.ejs +37 -0
  100. package/templates/default/parcel-transformer-inline-imports.cjs.ejs +39 -0
  101. package/templates/default/parcel-transformer-svelte.cjs.ejs +67 -0
  102. package/templates/default/pinned-versions.json.ejs +1 -0
  103. package/templates/default/pnpm-workspace.yaml.ejs +19 -0
  104. package/templates/default/postcss.config.cjs.ejs +12 -0
  105. package/templates/default/prettier.config.mjs.ejs +5 -0
  106. package/templates/default/rollup.config.mjs.ejs +7 -0
  107. package/templates/default/scripts/babel.config.ts_rollup.ejs +16 -0
  108. package/templates/default/scripts/babel.config.ts_rollup@babel-plugin_preact.ejs +1 -0
  109. package/templates/default/scripts/babel.config.ts_rollup@babel-preset_react.ejs +1 -0
  110. package/templates/default/scripts/babel.config.ts_rollup@babel-preset_solid.ejs +1 -0
  111. package/templates/default/scripts/build-clean.ts.ejs +4 -0
  112. package/templates/default/scripts/build-compile.ts.ejs +4 -0
  113. package/templates/default/scripts/build-styles.ts.ejs +12 -0
  114. package/templates/default/scripts/build.ts.ejs +6 -0
  115. package/templates/default/scripts/build.ts@bundler_cli-bundler.ejs +63 -0
  116. package/templates/default/scripts/build.ts@bundler_cli-bundler@compile_svelte.ejs +4 -0
  117. package/templates/default/scripts/build.ts@bundler_cli-bundler@fs-import_hot-reload-plugin.ejs +2 -0
  118. package/templates/default/scripts/build.ts@bundler_cli-bundler@hot-reload_hot-reload-plugin.ejs +3 -0
  119. package/templates/default/scripts/build.ts@bundler_cli-bundler@import_tailwind.ejs +2 -0
  120. package/templates/default/scripts/build.ts@bundler_cli-bundler@lint-build-styles_dev-utils.ejs +1 -0
  121. package/templates/default/scripts/build.ts@bundler_cli-bundler@reload_obsidian-cli.ejs +5 -0
  122. package/templates/default/scripts/build.ts@bundler_cli-bundler@run_parcel.ejs +1 -0
  123. package/templates/default/scripts/build.ts@bundler_cli-bundler@run_rollup.ejs +1 -0
  124. package/templates/default/scripts/build.ts@bundler_cli-bundler@run_vite.ejs +1 -0
  125. package/templates/default/scripts/build.ts@bundler_cli-bundler@run_webpack.ejs +1 -0
  126. package/templates/default/scripts/build.ts@bundler_esbuild.ejs +3 -0
  127. package/templates/default/scripts/build.ts@bundler_esbuild@compile_svelte.ejs +4 -0
  128. package/templates/default/scripts/build.ts@bundler_esbuild@dev-utils-pre-build_tailwind.ejs +2 -0
  129. package/templates/default/scripts/build.ts@bundler_esbuild@fs-import_hot-reload-plugin.ejs +2 -0
  130. package/templates/default/scripts/build.ts@bundler_esbuild@hot-reload_hot-reload-plugin.ejs +4 -0
  131. package/templates/default/scripts/build.ts@bundler_esbuild@import_postcss.ejs +1 -0
  132. package/templates/default/scripts/build.ts@bundler_esbuild@import_scss.ejs +1 -0
  133. package/templates/default/scripts/build.ts@bundler_esbuild@import_solid.ejs +1 -0
  134. package/templates/default/scripts/build.ts@bundler_esbuild@import_svelte.ejs +10 -0
  135. package/templates/default/scripts/build.ts@bundler_esbuild@import_tailwind.ejs +1 -0
  136. package/templates/default/scripts/build.ts@bundler_esbuild@import_vue.ejs +1 -0
  137. package/templates/default/scripts/build.ts@bundler_esbuild@lint-build-styles_dev-utils.ejs +1 -0
  138. package/templates/default/scripts/build.ts@bundler_esbuild@options_preact.ejs +2 -0
  139. package/templates/default/scripts/build.ts@bundler_esbuild@options_react.ejs +1 -0
  140. package/templates/default/scripts/build.ts@bundler_esbuild@options_wasm.ejs +5 -0
  141. package/templates/default/scripts/build.ts@bundler_esbuild@plugin_postcss.ejs +1 -0
  142. package/templates/default/scripts/build.ts@bundler_esbuild@plugin_scss.ejs +1 -0
  143. package/templates/default/scripts/build.ts@bundler_esbuild@plugin_solid.ejs +1 -0
  144. package/templates/default/scripts/build.ts@bundler_esbuild@plugin_svelte.ejs +5 -0
  145. package/templates/default/scripts/build.ts@bundler_esbuild@plugin_vue.ejs +1 -0
  146. package/templates/default/scripts/build.ts@bundler_esbuild@preset_dev-utils.ejs +7 -0
  147. package/templates/default/scripts/build.ts@bundler_esbuild@preset_standalone.ejs +138 -0
  148. package/templates/default/scripts/build.ts@bundler_esbuild@reload_obsidian-cli.ejs +6 -0
  149. package/templates/default/scripts/commit.ts_dev-utils.ejs +3 -0
  150. package/templates/default/scripts/commit.ts_standalone.ejs +3 -0
  151. package/templates/default/scripts/commitlint-config.ts.ejs +5 -0
  152. package/templates/default/scripts/demo-vault-global-setup.ts.ejs +43 -0
  153. package/templates/default/scripts/dev.ts.ejs +6 -0
  154. package/templates/default/scripts/dev.ts@bundler_cli-bundler.ejs +8 -0
  155. package/templates/default/scripts/dev.ts@bundler_esbuild.ejs +3 -0
  156. package/templates/default/scripts/dev.ts@bundler_esbuild@dev-utils-pre-build_tailwind.ejs +2 -0
  157. package/templates/default/scripts/dev.ts@bundler_esbuild@lint-build-styles_dev-utils.ejs +1 -0
  158. package/templates/default/scripts/dev.ts@bundler_esbuild@preset_dev-utils.ejs +7 -0
  159. package/templates/default/scripts/dev.ts@bundler_esbuild@preset_standalone.ejs +3 -0
  160. package/templates/default/scripts/esbuild-plugins.ts.ejs +20 -0
  161. package/templates/default/scripts/esbuild-plugins.ts@dev-utils-import_vue.ejs +2 -0
  162. package/templates/default/scripts/esbuild-plugins.ts@dev-utils-plugin_vue.ejs +1 -0
  163. package/templates/default/scripts/esbuild-plugins.ts@dev-utils-plugin_wasm.ejs +13 -0
  164. package/templates/default/scripts/eslint-config.ts.ejs +113 -0
  165. package/templates/default/scripts/eslint-config.ts@extra-files_has-e2e.ejs +7 -0
  166. package/templates/default/scripts/find-overexposed-fix.ts.ejs +26 -0
  167. package/templates/default/scripts/find-overexposed.ts.ejs +15 -0
  168. package/templates/default/scripts/format-check.ts.ejs +4 -0
  169. package/templates/default/scripts/format-check.ts@tool_biome-formatter.ejs +8 -0
  170. package/templates/default/scripts/format-check.ts@tool_dprint.ejs +3 -0
  171. package/templates/default/scripts/format-check.ts@tool_dprint@preset_dev-utils.ejs +7 -0
  172. package/templates/default/scripts/format-check.ts@tool_dprint@preset_standalone.ejs +8 -0
  173. package/templates/default/scripts/format-check.ts@tool_prettier.ejs +8 -0
  174. package/templates/default/scripts/format.ts.ejs +4 -0
  175. package/templates/default/scripts/format.ts@tool_biome-formatter.ejs +8 -0
  176. package/templates/default/scripts/format.ts@tool_dprint.ejs +3 -0
  177. package/templates/default/scripts/format.ts@tool_dprint@preset_dev-utils.ejs +7 -0
  178. package/templates/default/scripts/format.ts@tool_dprint@preset_standalone.ejs +8 -0
  179. package/templates/default/scripts/format.ts@tool_prettier.ejs +8 -0
  180. package/templates/default/scripts/framework-component-stub.ts.ejs +46 -0
  181. package/templates/default/scripts/gate.ts.ejs +10 -0
  182. package/templates/default/scripts/lint-fix.ts.ejs +6 -0
  183. package/templates/default/scripts/lint-fix.ts@tool_biome-linter.ejs +8 -0
  184. package/templates/default/scripts/lint-fix.ts@tool_eslint.ejs +3 -0
  185. package/templates/default/scripts/lint-fix.ts@tool_eslint@preset_dev-utils.ejs +7 -0
  186. package/templates/default/scripts/lint-fix.ts@tool_eslint@preset_standalone.ejs +8 -0
  187. package/templates/default/scripts/lint-md-fix.ts_dev-utils.ejs +7 -0
  188. package/templates/default/scripts/lint-md-fix.ts_standalone.ejs +37 -0
  189. package/templates/default/scripts/lint-md.ts_dev-utils.ejs +7 -0
  190. package/templates/default/scripts/lint-md.ts_standalone.ejs +37 -0
  191. package/templates/default/scripts/lint.ts.ejs +6 -0
  192. package/templates/default/scripts/lint.ts@tool_biome-linter.ejs +8 -0
  193. package/templates/default/scripts/lint.ts@tool_eslint.ejs +3 -0
  194. package/templates/default/scripts/lint.ts@tool_eslint@preset_dev-utils.ejs +7 -0
  195. package/templates/default/scripts/lint.ts@tool_eslint@preset_standalone.ejs +8 -0
  196. package/templates/default/scripts/markdownlint-cli2-config.ts_dev-utils.ejs +14 -0
  197. package/templates/default/scripts/markdownlint-cli2-config.ts_standalone.ejs +36 -0
  198. package/templates/default/scripts/nano-staged-config.ts.ejs +9 -0
  199. package/templates/default/scripts/postcss.config.ts.ejs +1 -0
  200. package/templates/default/scripts/postcss.config.ts@plugins_postcss.ejs +7 -0
  201. package/templates/default/scripts/prepare.ts_dev-utils.ejs +3 -0
  202. package/templates/default/scripts/prepare.ts_standalone.ejs +3 -0
  203. package/templates/default/scripts/prettier.config.ts.ejs +12 -0
  204. package/templates/default/scripts/rollup.config.ts.ejs +129 -0
  205. package/templates/default/scripts/rollup.config.ts@import_rollup-babel.ejs +5 -0
  206. package/templates/default/scripts/rollup.config.ts@import_rollup-json.ejs +1 -0
  207. package/templates/default/scripts/rollup.config.ts@import_rollup-postcss.ejs +4 -0
  208. package/templates/default/scripts/rollup.config.ts@import_scss.ejs +1 -0
  209. package/templates/default/scripts/rollup.config.ts@import_svelte.ejs +2 -0
  210. package/templates/default/scripts/rollup.config.ts@import_vue.ejs +1 -0
  211. package/templates/default/scripts/rollup.config.ts@import_wasm.ejs +1 -0
  212. package/templates/default/scripts/rollup.config.ts@lint-out-dir_dev-utils.ejs +1 -0
  213. package/templates/default/scripts/rollup.config.ts@post-plugin_preact.ejs +4 -0
  214. package/templates/default/scripts/rollup.config.ts@post-plugin_react.ejs +5 -0
  215. package/templates/default/scripts/rollup.config.ts@post-plugin_rollup-json.ejs +1 -0
  216. package/templates/default/scripts/rollup.config.ts@post-plugin_rollup-postcss.ejs +4 -0
  217. package/templates/default/scripts/rollup.config.ts@post-plugin_scss.ejs +4 -0
  218. package/templates/default/scripts/rollup.config.ts@post-plugin_solid.ejs +4 -0
  219. package/templates/default/scripts/rollup.config.ts@post-plugin_wasm.ejs +4 -0
  220. package/templates/default/scripts/rollup.config.ts@pre-plugin_svelte.ejs +4 -0
  221. package/templates/default/scripts/rollup.config.ts@pre-plugin_vue.ejs +13 -0
  222. package/templates/default/scripts/rollup.config.ts@unwrap_rollup-babel.ejs +1 -0
  223. package/templates/default/scripts/rollup.config.ts@unwrap_rollup-json.ejs +1 -0
  224. package/templates/default/scripts/rollup.config.ts@unwrap_rollup-postcss.ejs +1 -0
  225. package/templates/default/scripts/rollup.config.ts@unwrap_scss.ejs +1 -0
  226. package/templates/default/scripts/rollup.config.ts@unwrap_svelte.ejs +1 -0
  227. package/templates/default/scripts/rollup.config.ts@unwrap_vue.ejs +1 -0
  228. package/templates/default/scripts/rollup.config.ts@unwrap_wasm.ejs +1 -0
  229. package/templates/default/scripts/spellcheck.ts_dev-utils.ejs +7 -0
  230. package/templates/default/scripts/spellcheck.ts_standalone.ejs +8 -0
  231. package/templates/default/scripts/stylesheet-stub.ts.ejs +17 -0
  232. package/templates/default/scripts/test-coverage.ts.ejs +8 -0
  233. package/templates/default/scripts/test-e2e.ts.ejs +1 -0
  234. package/templates/default/scripts/test-e2e.ts@tool_obsidian-test.ejs +8 -0
  235. package/templates/default/scripts/test-e2e.ts@tool_wdio-obsidian.ejs +8 -0
  236. package/templates/default/scripts/test-integration-android.ts.ejs +8 -0
  237. package/templates/default/scripts/test-integration-demo-vault.ts.ejs +8 -0
  238. package/templates/default/scripts/test-integration-desktop-performance.ts.ejs +8 -0
  239. package/templates/default/scripts/test-integration-desktop.ts.ejs +8 -0
  240. package/templates/default/scripts/test-integration-no-app.ts.ejs +8 -0
  241. package/templates/default/scripts/test-integration.ts.ejs +22 -0
  242. package/templates/default/scripts/test-watch.ts_dev-utils.ejs +1 -0
  243. package/templates/default/scripts/test-watch.ts_dev-utils@tool_jest.ejs +13 -0
  244. package/templates/default/scripts/test-watch.ts_dev-utils@tool_vitest.ejs +8 -0
  245. package/templates/default/scripts/test-watch.ts_standalone.ejs +1 -0
  246. package/templates/default/scripts/test-watch.ts_standalone@tool_jest.ejs +13 -0
  247. package/templates/default/scripts/test-watch.ts_standalone@tool_vitest.ejs +8 -0
  248. package/templates/default/scripts/test.ts_dev-utils.ejs +1 -0
  249. package/templates/default/scripts/test.ts_dev-utils@tool_jest.ejs +13 -0
  250. package/templates/default/scripts/test.ts_dev-utils@tool_vitest.ejs +8 -0
  251. package/templates/default/scripts/test.ts_standalone.ejs +1 -0
  252. package/templates/default/scripts/test.ts_standalone@tool_jest.ejs +13 -0
  253. package/templates/default/scripts/test.ts_standalone@tool_vitest.ejs +8 -0
  254. package/templates/default/scripts/version.ts_dev-utils.ejs +10 -0
  255. package/templates/default/scripts/version.ts_standalone.ejs +317 -0
  256. package/templates/default/scripts/vite.config.ts.ejs +76 -0
  257. package/templates/default/scripts/vite.config.ts@import_preact.ejs +1 -0
  258. package/templates/default/scripts/vite.config.ts@import_react.ejs +1 -0
  259. package/templates/default/scripts/vite.config.ts@import_solid.ejs +1 -0
  260. package/templates/default/scripts/vite.config.ts@import_svelte.ejs +1 -0
  261. package/templates/default/scripts/vite.config.ts@import_vue.ejs +1 -0
  262. package/templates/default/scripts/vite.config.ts@lint-empty-out-dir_dev-utils.ejs +1 -0
  263. package/templates/default/scripts/vite.config.ts@lint-out-dir_dev-utils.ejs +1 -0
  264. package/templates/default/scripts/vite.config.ts@plugin_preact.ejs +1 -0
  265. package/templates/default/scripts/vite.config.ts@plugin_react.ejs +1 -0
  266. package/templates/default/scripts/vite.config.ts@plugin_solid.ejs +1 -0
  267. package/templates/default/scripts/vite.config.ts@plugin_svelte.ejs +1 -0
  268. package/templates/default/scripts/vite.config.ts@plugin_vue.ejs +1 -0
  269. package/templates/default/scripts/vitest-config.ts.ejs +75 -0
  270. package/templates/default/scripts/vitest-config.ts@post-config_solid.ejs +67 -0
  271. package/templates/default/scripts/wasm-module-stub.ts.ejs +21 -0
  272. package/templates/default/scripts/webpack.config.ts.ejs +124 -0
  273. package/templates/default/scripts/webpack.config.ts@import_svelte.ejs +1 -0
  274. package/templates/default/scripts/webpack.config.ts@import_vue.ejs +1 -0
  275. package/templates/default/scripts/webpack.config.ts@import_webpack-css-extract.ejs +4 -0
  276. package/templates/default/scripts/webpack.config.ts@lint-webpack-default_dev-utils.ejs +1 -0
  277. package/templates/default/scripts/webpack.config.ts@plugin_vue.ejs +1 -0
  278. package/templates/default/scripts/webpack.config.ts@plugin_webpack-css-extract.ejs +4 -0
  279. package/templates/default/scripts/webpack.config.ts@rule_css-modules.ejs +7 -0
  280. package/templates/default/scripts/webpack.config.ts@rule_css.ejs +4 -0
  281. package/templates/default/scripts/webpack.config.ts@rule_postcss.ejs +4 -0
  282. package/templates/default/scripts/webpack.config.ts@rule_scss.ejs +4 -0
  283. package/templates/default/scripts/webpack.config.ts@rule_solid.ejs +17 -0
  284. package/templates/default/scripts/webpack.config.ts@rule_svelte.ejs +7 -0
  285. package/templates/default/scripts/webpack.config.ts@rule_tailwind.ejs +4 -0
  286. package/templates/default/scripts/webpack.config.ts@rule_vue.ejs +4 -0
  287. package/templates/default/scripts/webpack.config.ts@rule_wasm.ejs +8 -0
  288. package/templates/default/scripts/webpack.config.ts@ts-loader-compiler-options_vue.ejs +5 -0
  289. package/templates/default/scripts/webpack.config.ts@ts-loader-options_vue.ejs +5 -0
  290. package/templates/default/src/demo-vault-buttons.demo-vault.integration.test.ts.ejs +12 -0
  291. package/templates/default/src/demo-vault.no-app.integration.test.ts.ejs +18 -0
  292. package/templates/default/src/editor-extensions/sample-state-field.ts_dev-utils.ejs +56 -0
  293. package/templates/default/src/editor-extensions/sample-state-field.ts_standalone.ejs +60 -0
  294. package/templates/default/src/editor-extensions/sample-view-plugin.ts.ejs +66 -0
  295. package/templates/default/src/editor-extensions/sample-widget.ts.ejs +22 -0
  296. package/templates/default/src/editor-suggests/sample-editor-suggest.ts.ejs +42 -0
  297. package/templates/default/src/i18n/en/index.ts.ejs +10 -0
  298. package/templates/default/src/i18n/index.ts_i18next.ejs +21 -0
  299. package/templates/default/src/i18n/index.ts_typesafe-i18n.ejs +14 -0
  300. package/templates/default/src/i18n/locales/en.json.ejs +3 -0
  301. package/templates/default/src/lit-elements/sample-lit-element.ts.ejs +54 -0
  302. package/templates/default/src/main.test.ts.ejs +11 -0
  303. package/templates/default/src/main.test.ts@test-imports_vitest.ejs +6 -0
  304. package/templates/default/src/main.ts.ejs +4 -0
  305. package/templates/default/src/main.ts@import_css-modules.ejs +1 -0
  306. package/templates/default/src/main.ts@import_css.ejs +1 -0
  307. package/templates/default/src/main.ts@import_postcss.ejs +1 -0
  308. package/templates/default/src/main.ts@import_scss.ejs +1 -0
  309. package/templates/default/src/main.ts@import_tailwind.ejs +1 -0
  310. package/templates/default/src/modals/sample-form-modal.ts.ejs +35 -0
  311. package/templates/default/src/modals/sample-suggest-modal.ts.ejs +37 -0
  312. package/templates/default/src/plugin-settings-component.test.ts_demo.ejs +49 -0
  313. package/templates/default/src/plugin-settings-component.test.ts_demo@test-imports_vitest.ejs +5 -0
  314. package/templates/default/src/plugin-settings-component.test.ts_enhanced.ejs +41 -0
  315. package/templates/default/src/plugin-settings-component.test.ts_enhanced@test-imports_vitest.ejs +5 -0
  316. package/templates/default/src/plugin-settings-component.ts_demo.ejs +87 -0
  317. package/templates/default/src/plugin-settings-component.ts_enhanced.ejs +27 -0
  318. package/templates/default/src/plugin-settings-tab.ts_demo.ejs +286 -0
  319. package/templates/default/src/plugin-settings-tab.ts_enhanced.ejs +26 -0
  320. package/templates/default/src/plugin-settings.test.ts_demo.ejs +14 -0
  321. package/templates/default/src/plugin-settings.test.ts_demo@test-imports_vitest.ejs +6 -0
  322. package/templates/default/src/plugin-settings.ts_demo.ejs +64 -0
  323. package/templates/default/src/plugin-settings.ts_enhanced.ejs +3 -0
  324. package/templates/default/src/plugin.test.ts_jest.ejs +9 -0
  325. package/templates/default/src/plugin.test.ts_vitest.ejs +14 -0
  326. package/templates/default/src/plugin.ts_demo.ejs +316 -0
  327. package/templates/default/src/plugin.ts_demo@import_i18next.ejs +1 -0
  328. package/templates/default/src/plugin.ts_demo@import_lit.ejs +4 -0
  329. package/templates/default/src/plugin.ts_demo@import_preact.ejs +4 -0
  330. package/templates/default/src/plugin.ts_demo@import_react.ejs +4 -0
  331. package/templates/default/src/plugin.ts_demo@import_solid.ejs +4 -0
  332. package/templates/default/src/plugin.ts_demo@import_svelte.ejs +4 -0
  333. package/templates/default/src/plugin.ts_demo@import_typesafe-i18n.ejs +1 -0
  334. package/templates/default/src/plugin.ts_demo@import_vue.ejs +4 -0
  335. package/templates/default/src/plugin.ts_demo@import_wasm.ejs +1 -0
  336. package/templates/default/src/plugin.ts_demo@method_ui-view.ejs +7 -0
  337. package/templates/default/src/plugin.ts_demo@onload_i18next.ejs +2 -0
  338. package/templates/default/src/plugin.ts_demo@onload_lit.ejs +4 -0
  339. package/templates/default/src/plugin.ts_demo@onload_preact.ejs +4 -0
  340. package/templates/default/src/plugin.ts_demo@onload_react.ejs +4 -0
  341. package/templates/default/src/plugin.ts_demo@onload_solid.ejs +4 -0
  342. package/templates/default/src/plugin.ts_demo@onload_svelte.ejs +4 -0
  343. package/templates/default/src/plugin.ts_demo@onload_typesafe-i18n.ejs +8 -0
  344. package/templates/default/src/plugin.ts_demo@onload_vue.ejs +4 -0
  345. package/templates/default/src/plugin.ts_demo@onload_wasm.ejs +2 -0
  346. package/templates/default/src/plugin.ts_enhanced.ejs +72 -0
  347. package/templates/default/src/plugin.ts_enhanced@import2_codemirror.ejs +3 -0
  348. package/templates/default/src/plugin.ts_enhanced@import2_i18next.ejs +2 -0
  349. package/templates/default/src/plugin.ts_enhanced@import2_lit.ejs +4 -0
  350. package/templates/default/src/plugin.ts_enhanced@import2_preact.ejs +4 -0
  351. package/templates/default/src/plugin.ts_enhanced@import2_react.ejs +4 -0
  352. package/templates/default/src/plugin.ts_enhanced@import2_solid.ejs +4 -0
  353. package/templates/default/src/plugin.ts_enhanced@import2_svelte.ejs +4 -0
  354. package/templates/default/src/plugin.ts_enhanced@import2_typesafe-i18n.ejs +2 -0
  355. package/templates/default/src/plugin.ts_enhanced@import2_vue.ejs +4 -0
  356. package/templates/default/src/plugin.ts_enhanced@import2_wasm.ejs +1 -0
  357. package/templates/default/src/plugin.ts_enhanced@method_ui-view.ejs +7 -0
  358. package/templates/default/src/plugin.ts_enhanced@onload_codemirror.ejs +4 -0
  359. package/templates/default/src/plugin.ts_enhanced@onload_i18next.ejs +2 -0
  360. package/templates/default/src/plugin.ts_enhanced@onload_lit.ejs +4 -0
  361. package/templates/default/src/plugin.ts_enhanced@onload_preact.ejs +4 -0
  362. package/templates/default/src/plugin.ts_enhanced@onload_react.ejs +4 -0
  363. package/templates/default/src/plugin.ts_enhanced@onload_solid.ejs +4 -0
  364. package/templates/default/src/plugin.ts_enhanced@onload_svelte.ejs +4 -0
  365. package/templates/default/src/plugin.ts_enhanced@onload_typesafe-i18n.ejs +8 -0
  366. package/templates/default/src/plugin.ts_enhanced@onload_vue.ejs +4 -0
  367. package/templates/default/src/plugin.ts_enhanced@onload_wasm.ejs +2 -0
  368. package/templates/default/src/plugin.ts_standalone.ejs +56 -0
  369. package/templates/default/src/plugin.ts_standalone@import_codemirror.ejs +3 -0
  370. package/templates/default/src/plugin.ts_standalone@import_i18next.ejs +1 -0
  371. package/templates/default/src/plugin.ts_standalone@import_lit.ejs +4 -0
  372. package/templates/default/src/plugin.ts_standalone@import_preact.ejs +4 -0
  373. package/templates/default/src/plugin.ts_standalone@import_react.ejs +4 -0
  374. package/templates/default/src/plugin.ts_standalone@import_solid.ejs +4 -0
  375. package/templates/default/src/plugin.ts_standalone@import_svelte.ejs +4 -0
  376. package/templates/default/src/plugin.ts_standalone@import_typesafe-i18n.ejs +1 -0
  377. package/templates/default/src/plugin.ts_standalone@import_vue.ejs +4 -0
  378. package/templates/default/src/plugin.ts_standalone@import_wasm.ejs +1 -0
  379. package/templates/default/src/plugin.ts_standalone@method_ui-view.ejs +7 -0
  380. package/templates/default/src/plugin.ts_standalone@onload_codemirror.ejs +4 -0
  381. package/templates/default/src/plugin.ts_standalone@onload_i18next.ejs +2 -0
  382. package/templates/default/src/plugin.ts_standalone@onload_lit.ejs +4 -0
  383. package/templates/default/src/plugin.ts_standalone@onload_preact.ejs +4 -0
  384. package/templates/default/src/plugin.ts_standalone@onload_react.ejs +4 -0
  385. package/templates/default/src/plugin.ts_standalone@onload_solid.ejs +4 -0
  386. package/templates/default/src/plugin.ts_standalone@onload_svelte.ejs +4 -0
  387. package/templates/default/src/plugin.ts_standalone@onload_typesafe-i18n.ejs +8 -0
  388. package/templates/default/src/plugin.ts_standalone@onload_vue.ejs +4 -0
  389. package/templates/default/src/plugin.ts_standalone@onload_wasm.ejs +2 -0
  390. package/templates/default/src/preact-components/sample-preact-component.tsx_dev-utils.ejs +47 -0
  391. package/templates/default/src/preact-components/sample-preact-component.tsx_standalone.ejs +47 -0
  392. package/templates/default/src/react-components/sample-react-component.tsx_dev-utils.ejs +35 -0
  393. package/templates/default/src/react-components/sample-react-component.tsx_standalone.ejs +47 -0
  394. package/templates/default/src/settings.ts.ejs +32 -0
  395. package/templates/default/src/solid-components/sample-solid-component.tsx_dev-utils.ejs +47 -0
  396. package/templates/default/src/solid-components/sample-solid-component.tsx_standalone.ejs +47 -0
  397. package/templates/default/src/styles/css-modules.d.ts.ejs +4 -0
  398. package/templates/default/src/styles/main.css_dev-utils.ejs +17 -0
  399. package/templates/default/src/styles/main.css_dev-utils@content_tailwind.ejs +1 -0
  400. package/templates/default/src/styles/main.css_standalone.ejs +11 -0
  401. package/templates/default/src/styles/main.css_standalone@content_tailwind.ejs +1 -0
  402. package/templates/default/src/styles/main.module.css.ejs +3 -0
  403. package/templates/default/src/styles/main.scss_dev-utils.ejs +16 -0
  404. package/templates/default/src/styles/main.scss_standalone.ejs +10 -0
  405. package/templates/default/src/styles/styles.d.ts.ejs +4 -0
  406. package/templates/default/src/svelte-components/sample-svelte-component.d.ts.ejs +7 -0
  407. package/templates/default/src/svelte-components/sample-svelte-component.svelte.ejs +24 -0
  408. package/templates/default/src/views/sample-lit-view.ts.ejs +30 -0
  409. package/templates/default/src/views/sample-lit-view.ts@lint-register-element_dev-utils.ejs +1 -0
  410. package/templates/default/src/views/sample-preact-view.tsx_dev-utils.ejs +45 -0
  411. package/templates/default/src/views/sample-preact-view.tsx_standalone.ejs +42 -0
  412. package/templates/default/src/views/sample-react-view.tsx_dev-utils.ejs +47 -0
  413. package/templates/default/src/views/sample-react-view.tsx_standalone.ejs +49 -0
  414. package/templates/default/src/views/sample-solid-view.tsx_dev-utils.ejs +46 -0
  415. package/templates/default/src/views/sample-solid-view.tsx_standalone.ejs +46 -0
  416. package/templates/default/src/views/sample-svelte-view.ts.ejs +47 -0
  417. package/templates/default/src/views/sample-view.ts.ejs +37 -0
  418. package/templates/default/src/views/sample-vue-view.ts.ejs +34 -0
  419. package/templates/default/src/vue-components/sample-vue-component.d.ts.ejs +6 -0
  420. package/templates/default/src/vue-components/sample-vue-component.vue.ejs +25 -0
  421. package/templates/default/src/wasm/README.md.ejs +29 -0
  422. package/templates/default/src/wasm/answer.ts_esbuild.ejs +23 -0
  423. package/templates/default/src/wasm/answer.ts_parcel.ejs +29 -0
  424. package/templates/default/src/wasm/answer.ts_rollup.ejs +19 -0
  425. package/templates/default/src/wasm/answer.ts_vite.ejs +29 -0
  426. package/templates/default/src/wasm/answer.ts_webpack.ejs +29 -0
  427. package/templates/default/src/wasm/module.wasm +0 -0
  428. package/templates/default/src/wasm/module.wat.ejs +12 -0
  429. package/templates/default/src/wasm/sample-command.ts.ejs +33 -0
  430. package/templates/default/src/wasm.d.ts_esbuild.ejs +12 -0
  431. package/templates/default/src/wasm.d.ts_parcel.ejs +7 -0
  432. package/templates/default/src/wasm.d.ts_rollup.ejs +8 -0
  433. package/templates/default/src/wasm.d.ts_vite.ejs +8 -0
  434. package/templates/default/src/wasm.d.ts_webpack.ejs +7 -0
  435. package/templates/default/tsconfig.json_dev-utils.ejs +34 -0
  436. package/templates/default/tsconfig.json_dev-utils@compiler-options_i18next.ejs +1 -0
  437. package/templates/default/tsconfig.json_dev-utils@compiler-options_lit.ejs +2 -0
  438. package/templates/default/tsconfig.json_dev-utils@compiler-options_preact.ejs +2 -0
  439. package/templates/default/tsconfig.json_dev-utils@compiler-options_react.ejs +1 -0
  440. package/templates/default/tsconfig.json_dev-utils@compiler-options_solid.ejs +2 -0
  441. package/templates/default/tsconfig.json_dev-utils@include_has-e2e.ejs +1 -0
  442. package/templates/default/tsconfig.json_dev-utils@include_svelte.ejs +1 -0
  443. package/templates/default/tsconfig.json_dev-utils@include_vue.ejs +1 -0
  444. package/templates/default/tsconfig.json_dev-utils@types_jest.ejs +2 -0
  445. package/templates/default/tsconfig.json_dev-utils@types_svelte.ejs +2 -0
  446. package/templates/default/tsconfig.json_dev-utils@types_wdio-obsidian.ejs +5 -0
  447. package/templates/default/tsconfig.json_dev-utils@types_with-unofficial.ejs +2 -0
  448. package/templates/default/tsconfig.json_standalone.ejs +47 -0
  449. package/templates/default/tsconfig.json_standalone@compiler-options_i18next.ejs +1 -0
  450. package/templates/default/tsconfig.json_standalone@compiler-options_lit.ejs +2 -0
  451. package/templates/default/tsconfig.json_standalone@compiler-options_preact.ejs +2 -0
  452. package/templates/default/tsconfig.json_standalone@compiler-options_react.ejs +1 -0
  453. package/templates/default/tsconfig.json_standalone@compiler-options_solid.ejs +2 -0
  454. package/templates/default/tsconfig.json_standalone@include-extra_preact.ejs +2 -0
  455. package/templates/default/tsconfig.json_standalone@include-extra_react.ejs +2 -0
  456. package/templates/default/tsconfig.json_standalone@include-extra_solid.ejs +2 -0
  457. package/templates/default/tsconfig.json_standalone@include_has-e2e.ejs +1 -0
  458. package/templates/default/tsconfig.json_standalone@include_svelte.ejs +1 -0
  459. package/templates/default/tsconfig.json_standalone@include_vue.ejs +1 -0
  460. package/templates/default/tsconfig.json_standalone@types_jest.ejs +2 -0
  461. package/templates/default/tsconfig.json_standalone@types_svelte.ejs +2 -0
  462. package/templates/default/tsconfig.json_standalone@types_wdio-obsidian.ejs +5 -0
  463. package/templates/default/tsconfig.json_standalone@types_with-unofficial.ejs +2 -0
  464. package/templates/default/versions.json.ejs +3 -0
  465. package/templates/default/vite.config.ts.ejs +3 -0
  466. package/templates/default/vitest.config.ts_dev-utils.ejs +1 -0
  467. package/templates/default/vitest.config.ts_standalone.ejs +55 -0
  468. package/templates/default/vitest.config.ts_standalone@jsx_solid.ejs +11 -0
  469. package/templates/default/wdio.conf.ts.ejs +21 -0
  470. package/templates/default/webpack.config.ts.ejs +3 -0
@@ -0,0 +1,67 @@
1
+ {
2
+ "version": "0.2",
3
+ "ignorePaths": [
4
+ "**/*.wasm",
5
+ "dist",
6
+ "node_modules",
7
+ "tsconfig.tsbuildinfo"
8
+ ],
9
+ "dictionaryDefinitions": [],
10
+ "dictionaries": [],
11
+ "words": [
12
+ <%- JSON.stringify(authorGitHubName) %>,
13
+ "Invocables",
14
+ "assemblyscript",
15
+ "autoprefixer",
16
+ "biomejs",
17
+ "codicon",
18
+ "codemirror",
19
+ "collab",
20
+ "commitlint",
21
+ "creatordate",
22
+ "dblclick",
23
+ "dprint",
24
+ "edgedriver",
25
+ "eresolve",
26
+ "esbuild",
27
+ "frontmatter",
28
+ "geckodriver",
29
+ "ghsa",
30
+ "hotreload",
31
+ "inlines",
32
+ "jiti",
33
+ "lezer",
34
+ "liberapay",
35
+ "linkinator",
36
+ "lintstagedrc",
37
+ "lucide",
38
+ "markdownlint",
39
+ "mnaoumov",
40
+ "obsidianmd",
41
+ "onload",
42
+ "onunload",
43
+ "postcss",
44
+ "preact",
45
+ "svelte",
46
+ "tailwindcss",
47
+ "tidelift",
48
+ "tsbuildinfo",
49
+ "tseslint",
50
+ "tslib",
51
+ "typesafe",
52
+ "unrs",
53
+ "untracked",
54
+ "unvalidated",
55
+ "vitest",
56
+ "wabt",
57
+ "wasm",
58
+ "wdio",
59
+ "wikilinks"
60
+ ],
61
+ "ignoreRegExpList": [
62
+ "/GHSA(-[0-9a-z]{4}){3}/g"
63
+ ],
64
+ "ignoreWords": [],
65
+ "import": [],
66
+ "enabled": true
67
+ }
@@ -0,0 +1,15 @@
1
+ # Churny, runtime-generated Obsidian state.
2
+ .obsidian/workspace*.json
3
+ .obsidian/hotkeys.json
4
+
5
+ # Both plugins in this vault are injected at release time by obsidian-dev-utils: the freshly built plugin
6
+ # Under test, and the obsidian-dev-utils-owned Demo Vault Helper, which installs, configures and enables
7
+ # CodeScript Toolkit at runtime. Nothing plugin-related is committed.
8
+ #
9
+ # CodeScript Toolkit also lands here the first time you open this vault in Obsidian, which is where the
10
+ # Demo-vault button suite picks it up from.
11
+ .obsidian/plugins/*
12
+
13
+ # Written by the demo buttons in `01 Sample commands.md`; clicking through the walkthrough should not
14
+ # Leave the repository dirty.
15
+ Materials/01 Sample commands/Scratch note.md
@@ -0,0 +1,4 @@
1
+ {
2
+ "attachmentFolderPath": "_assets/attachments",
3
+ "showUnsupportedFiles": true
4
+ }
@@ -0,0 +1,4 @@
1
+ [
2
+ "demo-vault-helper",
3
+ <%- JSON.stringify(pluginId) %>
4
+ ]
@@ -0,0 +1,32 @@
1
+ # Start here
2
+
3
+ This is an [Obsidian](https://obsidian.md/) vault that documents the [<%= pluginName %>](https://github.com/<%= authorGitHubName %>/obsidian-<%= pluginId %>/) plugin by demonstrating it. Every feature has a note that says what it does and why you would want it, and a button you can press to watch it happen.
4
+
5
+ <%= pluginDescription %>
6
+
7
+ ## Your first minute
8
+
9
+ Below this paragraph is a **code button** — a captioned rectangle. It is not a picture of a button: **clicking it runs the code**, and the result appears underneath it. The `</>` toggle beside the caption reveals the code it runs, so nothing here is a black box.
10
+
11
+ ```code-button
12
+ ---
13
+ caption: Run the Sample command
14
+ ---
15
+ require('/demoSetup.ts').runSampleCommand(app);
16
+ ```
17
+
18
+ A notice should have appeared in the top-right corner. That is the plugin's `Sample` command running — the same thing you get from **<%= pluginName %>: Sample** in the Command Palette (`Ctrl+P` / `Cmd+P`).
19
+
20
+ Every button in this vault also states its **manual equivalent**, so you learn the real steps rather than depending on the buttons.
21
+
22
+ ## Features
23
+
24
+ | Note | What it covers |
25
+ | --- | --- |
26
+ | [01 Sample commands](<./01 Sample commands.md>) | The commands the plugin adds, and how to run them. |
27
+ | [02 Settings](<./02 Settings.md>) | Every setting, by the key it is stored under in `data.json`. |
28
+ <%- render('features') -%>
29
+
30
+ ## Materials
31
+
32
+ `Materials/` holds the notes the walkthroughs operate on, so you never have to build a fixture to see a feature working.
@@ -0,0 +1 @@
1
+ | [03 WebAssembly](<./03 WebAssembly.md>) | The WebAssembly module the plugin ships, and the command that calls it. |
@@ -0,0 +1,38 @@
1
+ # Sample commands
2
+
3
+ <%= pluginName %> adds the sample commands below to the Command Palette. They are the scaffolded samples the generator gives every new plugin — replace them with your own, and rewrite this note as you do.
4
+
5
+ ## Sample
6
+
7
+ A **global** command: it runs wherever you are, whether or not a note is open. This one shows a notice.
8
+
9
+ ```code-button
10
+ ---
11
+ caption: Run Sample
12
+ ---
13
+ require('/demoSetup.ts').runSampleCommand(app);
14
+ ```
15
+
16
+ Manual equivalent: open the Command Palette (`Ctrl+P` / `Cmd+P`) and run **<%= pluginName %>: Sample**.
17
+
18
+ ## Sample editor
19
+
20
+ An **editor** command: it only appears when a note is open for editing, and it acts on the cursor. This one inserts text where the cursor is.
21
+
22
+ Editor commands need a live editor, and this vault opens notes in reading view — so the button below opens [Scratch note](<./Materials/01 Sample commands/Scratch note.md>) in Source mode first, puts the cursor at the end, and only then runs the command.
23
+
24
+ ```code-button
25
+ ---
26
+ caption: Run Sample editor on the scratch note
27
+ ---
28
+ await require('/demoSetup.ts').runSampleEditorCommandOnScratchNote(app);
29
+ ```
30
+
31
+ Manual equivalent: open `Scratch note`, switch it to Source mode (`Ctrl+E` / `Cmd+E`), place the cursor, and run **<%= pluginName %>: Sample editor**.
32
+
33
+ The scratch note is gitignored, so whatever you write in it stays out of your repository.
34
+
35
+ ## Where they are defined
36
+
37
+ **Sample** and **Sample editor** live in `src/plugin.ts`, registered in `onloadImpl` with `this.addCommand(...)`. The command id you see in `demoSetup.ts` is `<%= pluginId %>:sample` — Obsidian prefixes every command id with the plugin id from `manifest.json`.
38
+ <%- render('commands') -%>
@@ -0,0 +1,4 @@
1
+
2
+ ## Sample WASM answer
3
+
4
+ A third command, which calls into the WebAssembly module the plugin ships. It is registered in `src/wasm/sample-command.ts` rather than `src/plugin.ts`, and [03 WebAssembly](<./03 WebAssembly.md>) walks through it.
@@ -0,0 +1,40 @@
1
+ # Settings
2
+
3
+ Every setting <%= pluginName %> stores, listed by the **key it is written under in `data.json`** rather than by its display label — that is what you see when you open the file, hit a sync conflict, or read a support thread.
4
+
5
+ Find them in Obsidian under **Settings → Community plugins → <%= pluginName %>**.
6
+
7
+ ## General
8
+
9
+ - `textSetting`
10
+ - free text, shown in the settings tab as **Text setting name**. The scaffolded sample setting; nothing reads it yet.
11
+
12
+ ## Try it
13
+
14
+ Change the setting without leaving this note. The change applies live — the plugin's settings component picks it up, so there is no reload.
15
+
16
+ ```code-button
17
+ ---
18
+ caption: Set textSetting to "changed by the demo"
19
+ ---
20
+ await require('/demoSetup.ts').setTextSetting(app, 'changed by the demo');
21
+ ```
22
+
23
+ Manual equivalent: type the same value into **Text setting name** in the settings tab.
24
+
25
+ Open the settings tab now and the field shows the new value. When you are done, put it back:
26
+
27
+ ```code-button
28
+ ---
29
+ caption: Reset textSetting to its default
30
+ ---
31
+ await require('/demoSetup.ts').resetTextSetting(app);
32
+ ```
33
+
34
+ Manual equivalent: type `defaultText` back into the field.
35
+
36
+ ## Adding your own
37
+
38
+ Settings are declared as plain properties on the `PluginSettings` class in `src/plugin-settings.ts`; the property's initial value **is** its default. `src/plugin-settings-tab.ts` renders one row per setting, and `src/plugin-settings-component.ts` is where migrations and validators go.
39
+
40
+ When you add one, add it to this note too. The demo-vault coverage suite can be told to fail the build when a setting is documented nowhere — see the commented reflection spec in `src/demo-vault.no-app.integration.test.ts`.
@@ -0,0 +1,34 @@
1
+ # WebAssembly
2
+
3
+ <%= pluginName %> ships a working WebAssembly module and a command that calls into it. WebAssembly is how a plugin uses code compiled from Rust, C, Go or AssemblyScript — and unlike a native Node binary it runs on mobile too, so it is the portable route.
4
+
5
+ ```code-button
6
+ ---
7
+ caption: Run Sample WASM answer
8
+ ---
9
+ require('/demoSetup.ts').runSampleWasmAnswerCommand(app);
10
+ ```
11
+
12
+ A notice saying `WebAssembly says: 42` should have appeared. The number was not computed in JavaScript: the command loaded the module, called its exported `answer()` function, and showed what it returned.
13
+
14
+ Manual equivalent: open the Command Palette (`Ctrl+P` / `Cmd+P`) and run **<%= pluginName %>: Sample WASM answer**.
15
+
16
+ ## The module
17
+
18
+ The module is `src/wasm/module.wasm` in the plugin's repository, 39 bytes long. Its source is checked in beside it as `src/wasm/module.wat`:
19
+
20
+ ```wat
21
+ (module
22
+ (func (export "answer") (result i32)
23
+ i32.const 42))
24
+ ```
25
+
26
+ It exports one function, `answer()`, returning the constant `42`, and imports nothing at all — no host functions, no memory — so returning that number is the only thing it can do. `wat2wasm` from [WABT](https://github.com/WebAssembly/wabt) rebuilds the binary from that source byte for byte.
27
+
28
+ ## Why it is inside main.js
29
+
30
+ Obsidian installs a plugin as `main.js`, `styles.css` and `manifest.json`, and nothing else. A module left beside the bundle as a separate `.wasm` file works in the repository and is missing from every installed copy. So the build embeds the module in `main.js`, which is why this command works in the released plugin and not only in development.
31
+
32
+ ## Where it is defined
33
+
34
+ The command is registered in `src/wasm/sample-command.ts`, and `src/wasm/answer.ts` loads the module. `src/wasm/README.md` explains how to replace the sample with a module of your own.
@@ -0,0 +1,5 @@
1
+ # Scratch note
2
+
3
+ A note for [01 Sample commands](<../../01 Sample commands.md>) to write into, so the walkthrough has somewhere to run an editor command without touching anything you care about.
4
+
5
+ It is gitignored: whatever the buttons leave here stays out of the repository.
@@ -0,0 +1,10 @@
1
+ # <%= pluginName %> demo vault
2
+
3
+ This is an [Obsidian](https://obsidian.md/) vault demonstrating features of the [<%= pluginName %>](https://github.com/<%= authorGitHubName %>/obsidian-<%= pluginId %>) plugin.
4
+
5
+ ## Opening this vault
6
+
7
+ - **If you already have the plugin installed**, run the **<%= pluginName %>: Open demo vault** command — it downloads and opens the latest demo vault automatically.
8
+ - **Otherwise**, download `<%= pluginId %>-demo-vault.zip` from the [plugin releases](https://github.com/<%= authorGitHubName %>/obsidian-<%= pluginId %>/releases), unzip it, and in Obsidian choose `Manage vaults...` → `Open folder as vault` → select the `<%= pluginId %>-demo-vault-<version>` folder it unzips into.
9
+
10
+ On first open, Obsidian treats the vault as untrusted — choose **Trust author and enable plugins** (or enable Community plugins manually), then open [00 Start](<./00 Start.md>).
@@ -0,0 +1,88 @@
1
+ import type {
2
+ App,
3
+ TFile
4
+ } from 'obsidian';
5
+
6
+ import {
7
+ MarkdownView,
8
+ Notice
9
+ } from 'obsidian';
10
+ import { configureCommunityPlugin } from 'obsidian-dev-utils/obsidian/community-plugins';
11
+
12
+ // Shared code for every `code-button` in this vault, so each note's button stays a one-liner instead of a
13
+ // Block copy-pasted across notes.
14
+ //
15
+ // The plugin id has to match `manifest.json` exactly: commands are keyed by it, and so is `data.json`.
16
+ const PLUGIN_ID = '<%= pluginId %>';
17
+
18
+ const SCRATCH_NOTE_PATH = 'Materials/01 Sample commands/Scratch note.md';
19
+
20
+ const DEFAULT_TEXT_SETTING = 'defaultText';
21
+
22
+ /**
23
+ * Runs the plugin's `Sample` command, which shows a notice.
24
+ *
25
+ * Manual equivalent: `<%= pluginName %>: Sample` in the Command Palette.
26
+ */
27
+ export function runSampleCommand(app: App): void {
28
+ app.commands.executeCommandById(`${PLUGIN_ID}:sample`);
29
+ }
30
+
31
+ /**
32
+ * Opens the scratch note in editing mode and runs the plugin's `Sample editor` command against it.
33
+ *
34
+ * The command is an editor command, so it needs a live editor -- and this vault opens notes in reading
35
+ * view, where there is none. Opening the scratch note in Source mode first is what a reader would do by
36
+ * hand before running the command.
37
+ *
38
+ * Manual equivalent: open `Scratch note`, switch it to Source mode, put the cursor where you want the text,
39
+ * and run `<%= pluginName %>: Sample editor` in the Command Palette.
40
+ */
41
+ export async function runSampleEditorCommandOnScratchNote(app: App): Promise<void> {
42
+ const scratchNote = await ensureScratchNote(app);
43
+ const leaf = app.workspace.getLeaf(false);
44
+ await leaf.openFile(scratchNote, { state: { mode: 'source' } });
45
+
46
+ const view = app.workspace.getActiveViewOfType(MarkdownView);
47
+ if (!view) {
48
+ new Notice('Could not open the scratch note in editing mode.');
49
+ return;
50
+ }
51
+
52
+ view.editor.setCursor(view.editor.lastLine());
53
+ app.commands.executeCommandById(`${PLUGIN_ID}:sample-editor`);
54
+ new Notice('Ran the Sample editor command. Look at the end of the scratch note.');
55
+ }
56
+ <%- render('commands') -%>
57
+
58
+ /**
59
+ * Sets the plugin's `textSetting` to the given value.
60
+ *
61
+ * `configureCommunityPlugin` routes through the plugin's own settings component while it is loaded, so the
62
+ * change applies live -- no window reload, and no writing `data.json` behind a running plugin's back, which
63
+ * it would overwrite from memory as it unloads.
64
+ *
65
+ * Manual equivalent: change the same field in **Settings -> Community plugins -> <%= pluginName %>**.
66
+ */
67
+ export async function setTextSetting(app: App, value: string): Promise<void> {
68
+ await configureCommunityPlugin({ app, pluginId: PLUGIN_ID, settings: { textSetting: value } });
69
+ new Notice(`textSetting is now "${value}". It is live -- no reload needed.`);
70
+ }
71
+
72
+ /**
73
+ * Puts `textSetting` back to the value a fresh install starts with, so exploring this note leaves the vault
74
+ * as you found it.
75
+ *
76
+ * Manual equivalent: type the default back into the same field in the settings tab.
77
+ */
78
+ export async function resetTextSetting(app: App): Promise<void> {
79
+ await setTextSetting(app, DEFAULT_TEXT_SETTING);
80
+ }
81
+
82
+ async function ensureScratchNote(app: App): Promise<TFile> {
83
+ const existing = app.vault.getFileByPath(SCRATCH_NOTE_PATH);
84
+ if (existing) {
85
+ return existing;
86
+ }
87
+ return await app.vault.create(SCRATCH_NOTE_PATH, '# Scratch note\n\nRun the Sample editor command here.\n');
88
+ }
@@ -0,0 +1,10 @@
1
+
2
+ /**
3
+ * Runs the plugin's `Sample WASM answer` command, which calls into the bundled WebAssembly module and shows
4
+ * what it returned.
5
+ *
6
+ * Manual equivalent: `<%= pluginName %>: Sample WASM answer` in the Command Palette.
7
+ */
8
+ export function runSampleWasmAnswerCommand(app: App): void {
9
+ app.commands.executeCommandById(`${PLUGIN_ID}:sample-wasm-answer`);
10
+ }
@@ -0,0 +1,17 @@
1
+ // Per-vault startup script, run by the universal Demo Vault Helper plugin (through CodeScript Toolkit's
2
+ // `require`) once CodeScript Toolkit is installed and enabled. This is where a demo vault does its own
3
+ // Startup setup. Here it just opens the landing note.
4
+
5
+ import type { App } from 'obsidian';
6
+
7
+ const START_NOTE_PATH = '00 Start.md';
8
+
9
+ // CodeScript Toolkit calls the exported `invoke` on load (its `startupScriptPath` setting, which the Demo
10
+ // Vault Helper points here). A top-level script with no `invoke` export throws
11
+ // `this.startupScript.invoke is not a function` the moment the vault loads.
12
+ export async function invoke(app: App): Promise<void> {
13
+ const startNote = app.vault.getFileByPath(START_NOTE_PATH);
14
+ if (startNote) {
15
+ await app.workspace.getLeaf(false).openFile(startNote);
16
+ }
17
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "./node_modules/obsidian-dev-utils/dist/templates/dprint.json",
3
+ "excludes": [
4
+ "dist",
5
+ "**/node_modules",
6
+ "**/*-lock.json",
7
+ "**/*.md",
8
+ "demo-vault"
9
+ ]
10
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "typescript": {
3
+ "bracePosition": "sameLine",
4
+ "constructSignature.spaceAfterNewKeyword": true,
5
+ "constructorType.spaceAfterNewKeyword": true,
6
+ "exportDeclaration.forceMultiLine": "whenMultiple",
7
+ "functionExpression.spaceAfterFunctionKeyword": true,
8
+ "importDeclaration.forceMultiLine": "whenMultiple",
9
+ "lineWidth": 1000,
10
+ "quoteStyle": "alwaysSingle",
11
+ "trailingCommas": "never"
12
+ },
13
+ "json": {},
14
+ "markdown": {},
15
+ "excludes": [
16
+ "dist",
17
+ "**/node_modules",
18
+ "**/*-lock.json",
19
+ "**/*.md"
20
+ ],
21
+ "plugins": [
22
+ "npm:@dprint/typescript@0.96.1",
23
+ "npm:@dprint/json@0.23.0",
24
+ "npm:@dprint/markdown@0.23.2"
25
+ ]
26
+ }
@@ -0,0 +1,16 @@
1
+ // `node:test`'s `test()` returns a promise that the runner owns and awaits itself, so nothing here
2
+ // Should await it -- but that makes every call a floating promise. `void` is the marker
3
+ // `@typescript-eslint/no-floating-promises` accepts for exactly this case, and it keeps the rule armed
4
+ // For the tests you write yourself.
5
+ <%- render('lint-no-void-disable') -%>
6
+ import assert from 'node:assert';
7
+ import test from 'node:test';
8
+ import { embedded } from 'obsidian-test';
9
+
10
+ embedded((app) => {
11
+ void test('<%= pluginName %> loads successfully', () => {
12
+ assert.ok(app.workspace, 'Workspace should be available');
13
+ });
14
+ <%- render('unofficial') -%>
15
+ });
16
+ <%- render('lint-no-void-enable') -%>
@@ -0,0 +1,3 @@
1
+ // This file is nothing but such calls, so the ban on `void` is lifted for the whole of it rather than line
2
+ // By line.
3
+ /* eslint-disable no-void -- See above: no call in this file awaits its `node:test`, deliberately. */
@@ -0,0 +1 @@
1
+ /* eslint-enable no-void -- See the top of the file. */
@@ -0,0 +1,13 @@
1
+
2
+ void test('plugin is registered', () => {
3
+ const pluginId = '<%= pluginId %>';
4
+ const manifest = app.plugins.manifests[pluginId];
5
+ assert.ok(manifest, `Plugin "${pluginId}" should have a manifest`);
6
+ assert.strictEqual(manifest.id, pluginId);
7
+ });
8
+
9
+ void test('sample command exists', () => {
10
+ const commands = app.commands.listCommands();
11
+ const sampleCommand = commands.find((command) => command.id === '<%= pluginId %>:sample');
12
+ assert.ok(sampleCommand, 'Sample command should be registered');
13
+ });
@@ -0,0 +1,7 @@
1
+ describe('<%= pluginName %>', () => {
2
+ it('should load Obsidian', async () => {
3
+ const title = await browser.getTitle();
4
+ expect(title).toContain('Obsidian');
5
+ });
6
+ <%- render('unofficial') -%>
7
+ });
@@ -0,0 +1,15 @@
1
+
2
+ it('should have the plugin enabled', async () => {
3
+ const result = await browser.executeObsidian(({ app }) => {
4
+ return app.plugins.manifests['<%= pluginId %>']?.id;
5
+ });
6
+ expect(result).toBe('<%= pluginId %>');
7
+ });
8
+
9
+ it('should register the sample command', async () => {
10
+ const hasSampleCommand = await browser.executeObsidian(({ app }) => {
11
+ const commands = app.commands.listCommands();
12
+ return commands.some((command) => command.id === '<%= pluginId %>:sample');
13
+ });
14
+ expect(hasSampleCommand).toBe(true);
15
+ });
@@ -0,0 +1 @@
1
+ export { configs as default } from './scripts/eslint-config.ts';
@@ -0,0 +1,119 @@
1
+ import eslint from '@eslint/js';
2
+ import obsidianmd from 'eslint-plugin-obsidianmd';
3
+ import {
4
+ defineConfig,
5
+ globalIgnores
6
+ } from 'eslint/config';
7
+ import globals from 'globals';
8
+ import tseslint from 'typescript-eslint';
9
+
10
+ const typeScriptFiles = [
11
+ 'src/**/*.ts',
12
+ 'src/**/*.tsx',
13
+ 'scripts/**/*.ts',
14
+ // Root-level config files (`vitest.config.ts`, `commitlint.config.ts`, …). Typed rules need every file
15
+ // ESLint reaches to be in the tsconfig `include`, so these two lists have to agree — and `e2e/` is the
16
+ // Third member whenever an end-to-end runner is chosen. It was in neither list, and the plugin config
17
+ // Below still reached those files: every project with an e2e runner and ESLint died on "You have used
18
+ // A rule which requires type information", the largest single class of install-tier failures.
19
+ '*.ts',
20
+ 'eslint.config.mts'<%- render('extra-files') %>
21
+ ];
22
+
23
+ export default defineConfig(
24
+ globalIgnores([
25
+ '**/*.cjs',
26
+ '**/*.js',
27
+ '**/*.mjs',
28
+ // The demo scripts show unusual module and `require` styles on purpose; a linter that "fixes" them
29
+ // Breaks the lesson.
30
+ 'demo-vault/**',
31
+ 'dist/**',
32
+ 'main.js'
33
+ ]),
34
+ {
35
+ extends: [
36
+ eslint.configs.recommended,
37
+ ...tseslint.configs.strictTypeChecked,
38
+ ...tseslint.configs.stylisticTypeChecked
39
+ ],
40
+ files: typeScriptFiles,
41
+ languageOptions: {
42
+ globals: {
43
+ ...globals.browser,
44
+ ...globals.node
45
+ },
46
+ parserOptions: {
47
+ ecmaFeatures: {
48
+ jsx: true
49
+ },
50
+ projectService: true,
51
+ tsconfigRootDir: import.meta.dirname
52
+ }
53
+ },
54
+ rules: {
55
+ // `process.env['BUILD']` is not a style choice. TypeScript's `noPropertyAccessFromIndexSignature`
56
+ // — which `@tsconfig/strictest` turns on — REJECTS the dotted form on an index signature, so the
57
+ // Compiler and this rule disagree about the same line. The compiler wins, because its complaint is
58
+ // An error and this one is a preference. This preset's `tsconfig.json` spells its strictness out
59
+ // Rather than extending `@tsconfig/strictest`, so the option is off today and the allowance is what
60
+ // Keeps the bracketed form writable if it is ever turned on. Biome's `useLiteralKeys` is turned off
61
+ // In `biome.jsonc` for exactly the same reason.
62
+ '@typescript-eslint/dot-notation': ['error', { allowIndexSignaturePropertyAccess: true }],
63
+ '@typescript-eslint/explicit-function-return-type': 'error',
64
+ '@typescript-eslint/explicit-member-accessibility': 'error',
65
+ '@typescript-eslint/no-unused-vars': [
66
+ 'error',
67
+ {
68
+ args: 'all',
69
+ argsIgnorePattern: '^_',
70
+ caughtErrors: 'all',
71
+ caughtErrorsIgnorePattern: '^_',
72
+ destructuredArrayIgnorePattern: '^_',
73
+ ignoreRestSiblings: true,
74
+ varsIgnorePattern: '^_'
75
+ }
76
+ ],
77
+ '@typescript-eslint/prefer-readonly': 'error',
78
+ 'curly': 'error',
79
+ 'eqeqeq': 'error',
80
+ 'no-console': ['error', { allow: ['warn', 'error'] }],
81
+ 'no-var': 'error',
82
+ 'prefer-const': 'error',
83
+ 'prefer-template': 'error'
84
+ }
85
+ },
86
+ ...obsidianmd.configs.recommended,
87
+ // The Obsidian rules — and the console ban — are about code that SHIPS and runs inside Obsidian: no
88
+ // Node built-ins, because of mobile, and no stray logging. The build scripts are Node by definition
89
+ // And a build script that says what it is doing is behaving correctly, so they are turned back off
90
+ // Outside `src/`. Done as an override rather than by re-scoping the shared config, which would drop
91
+ // The parser settings that come with it.
92
+ {
93
+ files: ['scripts/**/*.ts', '*.ts', 'eslint.config.mts'],
94
+ rules: {
95
+ 'no-console': 'off',
96
+ 'obsidianmd/no-nodejs-modules': 'off',
97
+ 'obsidianmd/rule-custom-message': 'off'
98
+ }
99
+ },
100
+ {
101
+ rules: {
102
+ // `moment` is banned for bundle size, which does not apply here: Obsidian bundles it and
103
+ // Re-exports it, so it is imported from `'obsidian'` and the dependency exists only so
104
+ // `moment.Duration` and friends type-check against the version the app actually runs. A no-op
105
+ // Unless the project depends on it.
106
+ 'depend/ban-dependencies': ['error', { allowed: ['moment'] }]
107
+ }
108
+ },
109
+ {
110
+ rules: {
111
+ 'obsidianmd/ui/sentence-case': [
112
+ 'error',
113
+ {
114
+ brands: [<% _sentenceCaseBrands.forEach((brand, i) => { %>'<%- brand %>'<%= i < _sentenceCaseBrands.length - 1 ? ', ' : '' %><% }); %>]
115
+ }
116
+ ]
117
+ }
118
+ }
119
+ );