@mnaoumov/create-obsidian-plugin 1.0.2 → 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 (489) hide show
  1. package/README.md +38 -7
  2. package/dist/main.js +1068 -333
  3. package/package.json +13 -5
  4. package/src/main.ts +118 -11
  5. package/templates/default/.github/ISSUE_TEMPLATE/config.yml.ejs +4 -0
  6. package/templates/default/.github/workflows/attest-release-assets.yml.ejs +1 -11
  7. package/templates/default/.github/workflows/ci.yml_framework.ejs +19 -0
  8. package/templates/default/.github/workflows/ci.yml_framework@job-permissions_measured-coverage-badge.ejs +3 -0
  9. package/templates/default/.github/workflows/ci.yml_framework@with_measured-coverage-badge.ejs +1 -0
  10. package/templates/default/.github/workflows/{ci.yml.ejs → ci.yml_standalone.ejs} +1 -1
  11. package/templates/default/.github/workflows/release.yml_framework.ejs +19 -0
  12. package/templates/default/.github/workflows/{release.yml.ejs → release.yml_standalone.ejs} +1 -1
  13. package/templates/default/.gitignore_common.ejs +1 -0
  14. package/templates/default/.gitignore_wdio-obsidian.ejs +2 -0
  15. package/templates/default/.nvmrc.ejs +1 -0
  16. package/templates/default/.prettierignore.ejs +1 -0
  17. package/templates/default/.prettierignore@ignores_docs-showcase.ejs +3 -0
  18. package/templates/default/{CONTRIBUTING.md@demo-vault_dev-utils.ejs → CONTRIBUTING.md@demo-vault_framework.ejs} +1 -1
  19. package/templates/default/{README.md@demo-vault_dev-utils.ejs → README.md@demo-vault_framework.ejs} +1 -1
  20. package/templates/default/README.md@preset_docs-showcase.ejs +4 -0
  21. package/templates/default/{README.md@preset_dev-utils.ejs → README.md@preset_framework.ejs} +1 -1
  22. package/templates/default/biome.jsonc_framework.ejs +16 -0
  23. package/templates/default/biome.jsonc_framework@excludes_docs-showcase.ejs +1 -0
  24. package/templates/default/{biome.jsonc.ejs → biome.jsonc_standalone.ejs} +1 -1
  25. package/templates/default/cspell.json.ejs +10 -2
  26. package/templates/default/cspell.json@ignore-paths_docs-showcase.ejs +1 -0
  27. package/templates/default/demo-vault/.gitignore.ejs +4 -4
  28. package/templates/default/demo-vault/00 Start.md.ejs +1 -1
  29. package/templates/default/demo-vault/01 Sample commands.md.ejs +4 -4
  30. package/templates/default/demo-vault/02 Settings.md.ejs +2 -2
  31. package/templates/default/demo-vault/03 WebAssembly.md.ejs +2 -2
  32. package/templates/default/demo-vault/README.md.ejs +1 -1
  33. package/templates/default/demo-vault/_assets/CodeScriptToolkit/demoSetup.ts.ejs +1 -1
  34. package/templates/default/demo-vault/_assets/CodeScriptToolkit/startup.ts.ejs +4 -4
  35. package/templates/default/dprint.json_framework.ejs +10 -0
  36. package/templates/default/dprint.json_framework@excludes_docs-showcase.ejs +2 -0
  37. package/templates/default/dprint.json_standalone.ejs +1 -0
  38. package/templates/default/eslint.config.mts_standalone.ejs +9 -0
  39. package/templates/default/jest.config.ts_framework.ejs +31 -0
  40. package/templates/default/{scripts/rollup.config.ts@lint-out-dir_dev-utils.ejs → jest.config.ts_framework@lint-root-dir_framework.ejs} +1 -1
  41. package/templates/default/jest.config.ts_framework@ts-jest-tsconfig_solid.ejs +8 -0
  42. package/templates/default/{jest.config.ts.ejs → jest.config.ts_standalone.ejs} +0 -1
  43. package/templates/default/package.json@targets_parcel-targets.ejs +31 -0
  44. package/templates/default/package.json@targets_parcel.ejs +2 -33
  45. package/templates/default/parcel-transformer-inline-imports.cjs.ejs +1 -1
  46. package/templates/default/prettier.config.mjs_framework.ejs +3 -0
  47. package/templates/default/scripts/build-clean.ts.ejs +2 -2
  48. package/templates/default/scripts/build-compile-typescript.ts.ejs +14 -0
  49. package/templates/default/scripts/build-compile.ts.ejs +2 -2
  50. package/templates/default/scripts/build-options.ts.ejs +9 -0
  51. package/templates/default/scripts/build-styles.ts.ejs +4 -7
  52. package/templates/default/scripts/build.ts.ejs +2 -2
  53. package/templates/default/scripts/build.ts@bundler_adapter-cli.ejs +11 -0
  54. package/templates/default/scripts/build.ts@bundler_adapter-cli@run_rollup.ejs +1 -0
  55. package/templates/default/scripts/build.ts@bundler_adapter-cli@run_vite.ejs +1 -0
  56. package/templates/default/scripts/build.ts@bundler_adapter-cli@run_webpack.ejs +1 -0
  57. package/templates/default/scripts/build.ts@bundler_cli-bundler.ejs +1 -1
  58. package/templates/default/scripts/build.ts@bundler_cli-bundler@import_tailwind.ejs +0 -1
  59. package/templates/default/scripts/build.ts@bundler_esbuild.ejs +2 -2
  60. package/templates/default/scripts/build.ts@bundler_esbuild@preset_framework.ejs +5 -0
  61. package/templates/default/scripts/build.ts@bundler_parcel-adapter.ejs +5 -0
  62. package/templates/default/scripts/commit.ts_framework.ejs +3 -0
  63. package/templates/default/scripts/commitlint-config.ts_framework.ejs +1 -0
  64. package/templates/default/scripts/demo-vault-global-setup.ts.ejs +7 -4
  65. package/templates/default/scripts/dev.ts.ejs +1 -1
  66. package/templates/default/scripts/dev.ts@bundler_adapter-cli.ejs +6 -0
  67. package/templates/default/scripts/dev.ts@bundler_adapter-cli@run_rollup.ejs +3 -0
  68. package/templates/default/scripts/dev.ts@bundler_adapter-cli@run_vite.ejs +3 -0
  69. package/templates/default/scripts/dev.ts@bundler_adapter-cli@run_webpack.ejs +3 -0
  70. package/templates/default/scripts/dev.ts@bundler_esbuild.ejs +2 -2
  71. package/templates/default/scripts/dev.ts@bundler_esbuild@preset_framework.ejs +5 -0
  72. package/templates/default/scripts/dev.ts@bundler_parcel-adapter.ejs +5 -0
  73. package/templates/default/scripts/eslint-config.ts.ejs +3 -14
  74. package/templates/default/scripts/eslint-config.ts@ignores_docs-showcase.ejs +4 -0
  75. package/templates/default/scripts/find-overexposed-fix.ts.ejs +4 -4
  76. package/templates/default/scripts/find-overexposed.ts.ejs +3 -3
  77. package/templates/default/scripts/format-check.ts@tool_biome-formatter.ejs +3 -8
  78. package/templates/default/scripts/format-check.ts@tool_biome-formatter@preset_framework.ejs +7 -0
  79. package/templates/default/scripts/format-check.ts@tool_biome-formatter@preset_standalone.ejs +8 -0
  80. package/templates/default/scripts/format-check.ts@tool_dprint.ejs +2 -2
  81. package/templates/default/scripts/format-check.ts@tool_dprint@preset_framework.ejs +7 -0
  82. package/templates/default/scripts/format-check.ts@tool_prettier.ejs +3 -8
  83. package/templates/default/scripts/format-check.ts@tool_prettier@preset_framework.ejs +7 -0
  84. package/templates/default/scripts/format-check.ts@tool_prettier@preset_standalone.ejs +8 -0
  85. package/templates/default/scripts/format.ts@tool_biome-formatter.ejs +3 -8
  86. package/templates/default/scripts/format.ts@tool_biome-formatter@preset_framework.ejs +7 -0
  87. package/templates/default/scripts/format.ts@tool_biome-formatter@preset_standalone.ejs +8 -0
  88. package/templates/default/scripts/format.ts@tool_dprint.ejs +2 -2
  89. package/templates/default/scripts/format.ts@tool_dprint@preset_framework.ejs +7 -0
  90. package/templates/default/scripts/format.ts@tool_prettier.ejs +3 -8
  91. package/templates/default/scripts/format.ts@tool_prettier@preset_framework.ejs +7 -0
  92. package/templates/default/scripts/format.ts@tool_prettier@preset_standalone.ejs +8 -0
  93. package/templates/default/scripts/gate.ts.ejs +3 -3
  94. package/templates/default/scripts/lint-fix.ts.ejs +2 -2
  95. package/templates/default/scripts/lint-fix.ts@tool_biome-linter.ejs +3 -8
  96. package/templates/default/scripts/lint-fix.ts@tool_biome-linter@preset_framework.ejs +7 -0
  97. package/templates/default/scripts/lint-fix.ts@tool_biome-linter@preset_standalone.ejs +8 -0
  98. package/templates/default/scripts/lint-fix.ts@tool_eslint.ejs +2 -2
  99. package/templates/default/scripts/lint-fix.ts@tool_eslint@preset_framework.ejs +7 -0
  100. package/templates/default/scripts/lint-md-fix.ts_framework.ejs +7 -0
  101. package/templates/default/scripts/lint-md.ts_framework.ejs +7 -0
  102. package/templates/default/scripts/lint.ts.ejs +2 -2
  103. package/templates/default/scripts/lint.ts@tool_biome-linter.ejs +3 -8
  104. package/templates/default/scripts/lint.ts@tool_biome-linter@preset_framework.ejs +7 -0
  105. package/templates/default/scripts/lint.ts@tool_biome-linter@preset_standalone.ejs +8 -0
  106. package/templates/default/scripts/lint.ts@tool_eslint.ejs +2 -2
  107. package/templates/default/scripts/lint.ts@tool_eslint@preset_framework.ejs +7 -0
  108. package/templates/default/scripts/{markdownlint-cli2-config.ts_dev-utils.ejs → markdownlint-cli2-config.ts_framework.ejs} +4 -4
  109. package/templates/default/scripts/markdownlint-cli2-config.ts_standalone.ejs +0 -3
  110. package/templates/default/scripts/nano-staged-config.ts_toolkit-nano-staged.ejs +3 -0
  111. package/templates/default/scripts/prepare.ts_framework.ejs +3 -0
  112. package/templates/default/scripts/rollup.config.ts_framework.ejs +49 -0
  113. package/templates/default/scripts/rollup.config.ts_framework@plugin_rollup-json.ejs +2 -0
  114. package/templates/default/scripts/rollup.config.ts_framework@plugin_scss.ejs +3 -0
  115. package/templates/default/scripts/{rollup.config.ts.ejs → rollup.config.ts_standalone.ejs} +4 -4
  116. package/templates/default/scripts/rollup.config.ts_standalone@import_rollup-json.ejs +1 -0
  117. package/templates/default/scripts/rollup.config.ts_standalone@import_scss.ejs +1 -0
  118. package/templates/default/scripts/rollup.config.ts_standalone@unwrap_rollup-json.ejs +1 -0
  119. package/templates/default/scripts/rollup.config.ts_standalone@unwrap_scss.ejs +1 -0
  120. package/templates/default/scripts/spellcheck.ts_framework.ejs +7 -0
  121. package/templates/default/scripts/stylesheet-stub.ts.ejs +1 -1
  122. package/templates/default/scripts/test-coverage.ts.ejs +2 -8
  123. package/templates/default/scripts/test-coverage.ts@tool_jest.ejs +5 -0
  124. package/templates/default/scripts/test-coverage.ts@tool_vitest.ejs +8 -0
  125. package/templates/default/scripts/test-e2e.ts@tool_obsidian-test.ejs +2 -8
  126. package/templates/default/scripts/test-e2e.ts@tool_obsidian-test@preset_framework.ejs +4 -0
  127. package/templates/default/scripts/test-e2e.ts@tool_obsidian-test@preset_standalone.ejs +8 -0
  128. package/templates/default/scripts/test-e2e.ts@tool_wdio-obsidian.ejs +2 -8
  129. package/templates/default/scripts/test-e2e.ts@tool_wdio-obsidian@preset_framework.ejs +5 -0
  130. package/templates/default/scripts/test-e2e.ts@tool_wdio-obsidian@preset_standalone.ejs +8 -0
  131. package/templates/default/scripts/test-integration-android.ts.ejs +2 -2
  132. package/templates/default/scripts/test-integration-demo-vault.ts.ejs +2 -2
  133. package/templates/default/scripts/test-integration-desktop-performance.ts.ejs +2 -2
  134. package/templates/default/scripts/test-integration-desktop.ts.ejs +2 -2
  135. package/templates/default/scripts/test-integration-no-app.ts.ejs +2 -2
  136. package/templates/default/scripts/test-integration.ts.ejs +2 -2
  137. package/templates/default/scripts/test-watch.ts_framework@tool_jest.ejs +5 -0
  138. package/templates/default/scripts/test-watch.ts_framework@tool_vitest.ejs +8 -0
  139. package/templates/default/scripts/test.ts_framework@tool_jest.ejs +5 -0
  140. package/templates/default/scripts/test.ts_framework@tool_vitest.ejs +8 -0
  141. package/templates/default/scripts/{version.ts_dev-utils.ejs → version.ts_framework.ejs} +3 -3
  142. package/templates/default/scripts/vite.config.ts_framework.ejs +10 -0
  143. package/templates/default/scripts/{vite.config.ts.ejs → vite.config.ts_standalone.ejs} +5 -8
  144. package/templates/default/scripts/vitest-config.ts.ejs +3 -2
  145. package/templates/default/scripts/vitest-config.ts@edit-context_docs-showcase.ejs +3 -0
  146. package/templates/default/scripts/webpack.config.ts_framework.ejs +19 -0
  147. package/templates/default/scripts/webpack.config.ts_framework@import_scss.ejs +1 -0
  148. package/templates/default/scripts/webpack.config.ts_framework@plugin_scss.ejs +1 -0
  149. package/templates/default/scripts/webpack.config.ts_framework@rule_scss.ejs +4 -0
  150. package/templates/default/scripts/{webpack.config.ts.ejs → webpack.config.ts_standalone.ejs} +4 -4
  151. package/templates/default/src/demo-vault-buttons.demo-vault.integration.test.ts.ejs +2 -2
  152. package/templates/default/src/demo-vault.no-app.integration.test.ts.ejs +3 -3
  153. package/templates/default/src/docs-showcase.desktop.integration.test.ts.ejs +77 -0
  154. package/templates/default/src/editor-extensions/{sample-state-field.ts_dev-utils.ejs → sample-state-field.ts_framework.ejs} +1 -1
  155. package/templates/default/src/main.ts@import_tailwind.ejs +1 -1
  156. package/templates/default/src/main.ts@import_tailwind@preset_framework.ejs +1 -0
  157. package/templates/default/src/main.ts@import_tailwind@preset_standalone.ejs +1 -0
  158. package/templates/default/src/{plugin-settings-component.test.ts_enhanced.ejs → plugin-settings-component.test.ts_all-in-one.ejs} +4 -4
  159. package/templates/default/src/plugin-settings-component.test.ts_demo.ejs +5 -5
  160. package/templates/default/src/{plugin-settings-component.ts_enhanced.ejs → plugin-settings-component.ts_all-in-one.ejs} +3 -3
  161. package/templates/default/src/plugin-settings-component.ts_demo.ejs +7 -7
  162. package/templates/default/src/{plugin-settings-tab.ts_enhanced.ejs → plugin-settings-tab.ts_all-in-one.ejs} +1 -1
  163. package/templates/default/src/plugin-settings-tab.ts_demo.ejs +3 -3
  164. package/templates/default/src/plugin-settings.ts_demo.ejs +2 -2
  165. package/templates/default/src/{plugin.ts_enhanced.ejs → plugin.ts_all-in-one.ejs} +5 -5
  166. package/templates/default/src/plugin.ts_all-in-one@import2_css-modules.ejs +1 -0
  167. package/templates/default/src/plugin.ts_all-in-one@import2_docs-showcase.ejs +1 -0
  168. package/templates/default/src/plugin.ts_all-in-one@onload_css-modules.ejs +1 -0
  169. package/templates/default/src/plugin.ts_all-in-one@onload_docs-showcase.ejs +3 -0
  170. package/templates/default/src/plugin.ts_demo.ejs +16 -16
  171. package/templates/default/src/plugin.ts_demo@import_css-modules.ejs +1 -0
  172. package/templates/default/src/plugin.ts_demo@onload_css-modules.ejs +1 -0
  173. package/templates/default/src/plugin.ts_standalone.ejs +5 -3
  174. package/templates/default/src/plugin.ts_standalone@import_css-modules.ejs +1 -0
  175. package/templates/default/src/plugin.ts_standalone@onload_css-modules.ejs +1 -0
  176. package/templates/default/src/react-components/{sample-react-component.tsx_dev-utils.ejs → sample-react-component.tsx_framework.ejs} +1 -1
  177. package/templates/default/src/styles/css-modules.d.ts.ejs +9 -3
  178. package/templates/default/src/styles/{main.css_dev-utils.ejs → main.css_framework.ejs} +2 -2
  179. package/templates/default/src/styles/main.module.css.ejs +4 -2
  180. package/templates/default/src/styles/{main.scss_dev-utils.ejs → main.scss_framework.ejs} +2 -2
  181. package/templates/default/src/styles/sample-css-module-command.ts.ejs +30 -0
  182. package/templates/default/src/views/{sample-react-view.tsx_dev-utils.ejs → sample-react-view.tsx_framework.ejs} +1 -1
  183. package/templates/default/src/wasm/answer.ts_wasm-adapter.ejs +18 -0
  184. package/templates/default/{tsconfig.json_dev-utils.ejs → tsconfig.json_framework.ejs} +2 -2
  185. package/templates/default/tsconfig.json_framework@exclude_docs-showcase.ejs +4 -0
  186. package/templates/default/tsconfig.json_framework@include_wdio-obsidian.ejs +1 -0
  187. package/templates/default/tsconfig.json_framework@types_toolkit-styles.ejs +2 -0
  188. package/templates/default/tsconfig.json_framework@types_wasm.ejs +2 -0
  189. package/templates/default/tsconfig.json_standalone.ejs +1 -1
  190. package/templates/default/vitest.config.ts_standalone.ejs +11 -2
  191. package/templates/default/wdio.conf.mts.ejs +5 -0
  192. package/templates/default/wdio.conf.ts.ejs +4 -4
  193. package/templates/docs-showcase/files/src/docs/README.md +511 -0
  194. package/templates/docs-showcase/files/src/docs/entry.d.ts +8 -0
  195. package/templates/docs-showcase/files/src/docs/entry.js +4 -0
  196. package/templates/docs-showcase/files/src/docs/host.ts +449 -0
  197. package/templates/docs-showcase/files/src/docs/index.ts +699 -0
  198. package/templates/docs-showcase/files/src/docs/plugins/editor/communicating-with-editor-extensions/01-intro.ts +21 -0
  199. package/templates/docs-showcase/files/src/docs/plugins/editor/communicating-with-editor-extensions/03-state-field.ts +32 -0
  200. package/templates/docs-showcase/files/src/docs/plugins/editor/decorations/01-widgets.ts +23 -0
  201. package/templates/docs-showcase/files/src/docs/plugins/editor/decorations/02-widgets.ts +20 -0
  202. package/templates/docs-showcase/files/src/docs/plugins/editor/decorations/04-state-fields.ts +57 -0
  203. package/templates/docs-showcase/files/src/docs/plugins/editor/decorations/05-view-plugins.ts +79 -0
  204. package/templates/docs-showcase/files/src/docs/plugins/editor/editor/01-intro.ts +26 -0
  205. package/templates/docs-showcase/files/src/docs/plugins/editor/editor/03-replace-current-selection.ts +26 -0
  206. package/templates/docs-showcase/files/src/docs/plugins/editor/markdown-post-processing/01-intro.ts +39 -0
  207. package/templates/docs-showcase/files/src/docs/plugins/editor/state-fields/01-defining-state-effects.ts +19 -0
  208. package/templates/docs-showcase/files/src/docs/plugins/editor/state-fields/02-defining-a-state-field.ts +35 -0
  209. package/templates/docs-showcase/files/src/docs/plugins/editor/state-fields/04-dispatching-state-effects.ts +34 -0
  210. package/templates/docs-showcase/files/src/docs/plugins/editor/state-management/01-state-changes.ts +21 -0
  211. package/templates/docs-showcase/files/src/docs/plugins/editor/state-management/02-state-changes.ts +23 -0
  212. package/templates/docs-showcase/files/src/docs/plugins/editor/view-plugins/01-creating-a-view-plugin.ts +36 -0
  213. package/templates/docs-showcase/files/src/docs/plugins/events/01-intro.ts +21 -0
  214. package/templates/docs-showcase/files/src/docs/plugins/getting-started/anatomy-of-a-plugin/01-intro.ts +22 -0
  215. package/templates/docs-showcase/files/src/docs/plugins/getting-started/anatomy-of-a-plugin/02-plugin-lifecycle.ts +22 -0
  216. package/templates/docs-showcase/files/src/docs/plugins/getting-started/build-a-plugin/06-step-5-update-the-source-code.ts +19 -0
  217. package/templates/docs-showcase/files/src/docs/plugins/getting-started/build-a-plugin/07-step-5-update-the-source-code.ts +21 -0
  218. package/templates/docs-showcase/files/src/docs/plugins/getting-started/mobile-development/03-platform-specific-features.ts +25 -0
  219. package/templates/docs-showcase/files/src/docs/plugins/getting-started/use-react-in-your-plugin/03-configure-your-plugin.ts +23 -0
  220. package/templates/docs-showcase/files/src/docs/plugins/guides/build-a-bases-view/01-step-1-sample-plugin-setup.ts +18 -0
  221. package/templates/docs-showcase/files/src/docs/plugins/guides/build-a-bases-view/02-step-2-create-and-register-the-bases-vie.ts +46 -0
  222. package/templates/docs-showcase/files/src/docs/plugins/guides/build-a-bases-view/03-step-3-add-configuration.ts +40 -0
  223. package/templates/docs-showcase/files/src/docs/plugins/guides/defer-views/04-accessing-your-customview-without-reveal.ts +26 -0
  224. package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/01-overview.ts +26 -0
  225. package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/02-overview.ts +30 -0
  226. package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/03-automatic-resource-management-with-compo.ts +26 -0
  227. package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/04-registerevent-eventref.ts +22 -0
  228. package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/05-registerinterval-id.ts +21 -0
  229. package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/06-registerdomevent-el-event-handler.ts +20 -0
  230. package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/08-understanding-the-lifecycle-of-objects.ts +29 -0
  231. package/templates/docs-showcase/files/src/docs/plugins/guides/manage-plugin-lifecycle/14-componentized-modal-example.ts +37 -0
  232. package/templates/docs-showcase/files/src/docs/plugins/guides/optimize-plugin-load-time/01-option-a-check-if-the-layout-is-ready.ts +29 -0
  233. package/templates/docs-showcase/files/src/docs/plugins/guides/optimize-plugin-load-time/02-option-b-register-the-handler-once-the-l.ts +27 -0
  234. package/templates/docs-showcase/files/src/docs/plugins/guides/store-secrets/03-step-3-retrieve-the-secret-value.ts +22 -0
  235. package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/01-use-setheading-instead-of-a-h1-h2.ts +20 -0
  236. package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/03-clean-up-resources-when-plugin-unloads.ts +23 -0
  237. package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/04-avoid-accessing-workspace-activeleaf-dir.ts +24 -0
  238. package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/05-avoid-accessing-workspace-activeleaf-dir.ts +22 -0
  239. package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/10-avoid-iterating-all-files-to-find-a-file.ts +20 -0
  240. package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/11-avoid-iterating-all-files-to-find-a-file.ts +20 -0
  241. package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/13-use-normalizepath-to-clean-up-user-defin.ts +18 -0
  242. package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/15-no-hardcoded-styling.ts +21 -0
  243. package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/16-no-hardcoded-styling.ts +19 -0
  244. package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/17-no-hardcoded-styling.ts +14 -0
  245. package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/18-prefer-async-await-over-promise.ts +24 -0
  246. package/templates/docs-showcase/files/src/docs/plugins/releasing/plugin-guidelines/19-prefer-async-await-over-promise.ts +27 -0
  247. package/templates/docs-showcase/files/src/docs/plugins/user-interface/commands/01-intro.ts +25 -0
  248. package/templates/docs-showcase/files/src/docs/plugins/user-interface/commands/03-editor-commands.ts +27 -0
  249. package/templates/docs-showcase/files/src/docs/plugins/user-interface/commands/05-hot-keys.ts +25 -0
  250. package/templates/docs-showcase/files/src/docs/plugins/user-interface/context-menus/01-intro.ts +41 -0
  251. package/templates/docs-showcase/files/src/docs/plugins/user-interface/html-elements/02-create-html-elements-using-createel.ts +19 -0
  252. package/templates/docs-showcase/files/src/docs/plugins/user-interface/html-elements/03-create-html-elements-using-createel.ts +21 -0
  253. package/templates/docs-showcase/files/src/docs/plugins/user-interface/html-elements/04-style-your-elements.ts +14 -0
  254. package/templates/docs-showcase/files/src/docs/plugins/user-interface/html-elements/05-style-your-elements.ts +21 -0
  255. package/templates/docs-showcase/files/src/docs/plugins/user-interface/html-elements/06-conditional-styles.ts +19 -0
  256. package/templates/docs-showcase/files/src/docs/plugins/user-interface/icons/01-use-icons.ts +20 -0
  257. package/templates/docs-showcase/files/src/docs/plugins/user-interface/icons/02-use-icons.ts +14 -0
  258. package/templates/docs-showcase/files/src/docs/plugins/user-interface/icons/03-add-your-own-icon.ts +23 -0
  259. package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/01-intro.ts +20 -0
  260. package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/02-intro.ts +26 -0
  261. package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/03-accept-user-input.ts +38 -0
  262. package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/04-accept-user-input.ts +22 -0
  263. package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/05-select-from-list-of-suggestions.ts +56 -0
  264. package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/06-approximate-string-matching-results.ts +28 -0
  265. package/templates/docs-showcase/files/src/docs/plugins/user-interface/modals/07-custom-rendering-of-fuzzy-search-results.ts +41 -0
  266. package/templates/docs-showcase/files/src/docs/plugins/user-interface/ribbon-actions/01-intro.ts +21 -0
  267. package/templates/docs-showcase/files/src/docs/plugins/user-interface/right-to-left/01-use-fallback-values-when-necessary.ts +14 -0
  268. package/templates/docs-showcase/files/src/docs/plugins/user-interface/right-to-left/02-global-selectors.ts +14 -0
  269. package/templates/docs-showcase/files/src/docs/plugins/user-interface/right-to-left/03-icons-are-mirrored-automatically.ts +14 -0
  270. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/09-toggle.ts +20 -0
  271. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/10-text.ts +23 -0
  272. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/11-textarea.ts +23 -0
  273. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/12-number.ts +23 -0
  274. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/13-slider.ts +23 -0
  275. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/14-dropdown.ts +28 -0
  276. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/15-file.ts +27 -0
  277. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/16-folder.ts +23 -0
  278. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/17-color-picker.ts +20 -0
  279. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/18-validating-input.ts +28 -0
  280. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/23-groups.ts +27 -0
  281. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/32-cleanup.ts +30 -0
  282. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/33-no-top-level-heading.ts +27 -0
  283. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/34-headings-only-when-there-are-multiple-se.ts +26 -0
  284. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/36-headings.ts +20 -0
  285. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/38-moment-format.ts +42 -0
  286. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/39-buttons.ts +26 -0
  287. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/40-extra-button.ts +28 -0
  288. package/templates/docs-showcase/files/src/docs/plugins/user-interface/settings/41-progress-bar.ts +23 -0
  289. package/templates/docs-showcase/files/src/docs/plugins/user-interface/status-bar/01-intro.ts +20 -0
  290. package/templates/docs-showcase/files/src/docs/plugins/user-interface/status-bar/02-intro.ts +25 -0
  291. package/templates/docs-showcase/files/src/docs/plugins/user-interface/views/01-intro.ts +39 -0
  292. package/templates/docs-showcase/files/src/docs/plugins/user-interface/workspace/05-inspect-the-workspace.ts +23 -0
  293. package/templates/docs-showcase/files/src/docs/plugins/user-interface/workspace/06-leaf-groups.ts +19 -0
  294. package/templates/docs-showcase/files/src/docs/plugins/vault/02-read-files.ts +37 -0
  295. package/templates/docs-showcase/files/src/docs/plugins/vault/03-modify-files.ts +19 -0
  296. package/templates/docs-showcase/files/src/docs/plugins/vault/04-modify-files.ts +22 -0
  297. package/templates/docs-showcase/files/src/docs/plugins/vault/05-is-it-a-file-or-folder.ts +25 -0
  298. package/templates/docs-showcase/files/src/docs/reference/css-variables/about-styling/01-for-plugins.ts +14 -0
  299. package/templates/docs-showcase/files/src/docs/reference/css-variables/about-styling/02-for-themes-and-snippets.ts +14 -0
  300. package/templates/docs-showcase/files/src/docs/reference/css-variables/publish/site-fonts/01-intro.ts +14 -0
  301. package/templates/docs-showcase/files/src/docs/reference/typescript-api/command/callback/01-example.ts +24 -0
  302. package/templates/docs-showcase/files/src/docs/reference/typescript-api/debounce/01-example.ts +24 -0
  303. package/templates/docs-showcase/files/src/docs/reference/typescript-api/vault/process/01-example.ts +22 -0
  304. package/templates/docs-showcase/files/src/docs/themes/app-themes/build-a-theme/05-step-4-change-the-font.ts +14 -0
  305. package/templates/docs-showcase/files/src/docs/themes/app-themes/build-a-theme/06-step-5-change-the-background-color.ts +14 -0
  306. package/templates/docs-showcase/files/src/docs/themes/app-themes/build-a-theme/07-step-6-change-the-input-hover-border-col.ts +14 -0
  307. package/templates/docs-showcase/files/src/docs/themes/app-themes/build-a-theme/08-step-7-discover-css-variables-in-use.ts +14 -0
  308. package/templates/docs-showcase/files/src/docs/themes/app-themes/embed-fonts-and-images-in-your-theme/02-use-data-urls.ts +14 -0
  309. package/templates/docs-showcase/files/src/docs/themes/app-themes/theme-guidelines/01-use-css-variables.ts +14 -0
  310. package/templates/docs-showcase/files/src/docs/themes/obsidian-publish-themes/best-practices-for-publish-themes/01-small-screens-and-mobile-devices.ts +14 -0
  311. package/templates/docs-showcase/files/src/docs/themes/obsidian-publish-themes/build-a-publish-theme/01-intro.ts +14 -0
  312. package/templates/docs-showcase/files/src/docs/tsconfig.json +25 -0
  313. package/templates/docs-showcase/host/entry.d.ts +8 -0
  314. package/templates/docs-showcase/host/entry.js +4 -0
  315. package/templates/docs-showcase/host/host.ts +449 -0
  316. package/templates/docs-showcase/host/tsconfig.json +25 -0
  317. package/templates/docs-showcase/snippets.json +3566 -0
  318. package/templates/official-sample/README.md +9 -0
  319. package/templates/official-sample/files/.editorconfig.vendored +11 -0
  320. package/templates/official-sample/files/.github/workflows/lint.yml.vendored +27 -0
  321. package/templates/official-sample/files/.github/workflows/release.yml.vendored +50 -0
  322. package/templates/official-sample/files/.gitignore.vendored +22 -0
  323. package/templates/official-sample/files/.npmrc.vendored +1 -0
  324. package/templates/official-sample/files/AGENTS.md.vendored +269 -0
  325. package/templates/official-sample/files/LICENSE.vendored +5 -0
  326. package/templates/official-sample/files/README.md.vendored +92 -0
  327. package/templates/official-sample/files/esbuild.config.mjs.vendored +49 -0
  328. package/templates/official-sample/files/eslint.config.mts.vendored +32 -0
  329. package/templates/official-sample/files/manifest.json.vendored +11 -0
  330. package/templates/official-sample/files/package-lock.json.vendored +5053 -0
  331. package/templates/official-sample/files/package.json.vendored +27 -0
  332. package/templates/official-sample/files/src/main.ts.vendored +114 -0
  333. package/templates/official-sample/files/src/settings.ts.vendored +38 -0
  334. package/templates/official-sample/files/styles.css.vendored +8 -0
  335. package/templates/official-sample/files/tsconfig.json.vendored +19 -0
  336. package/templates/official-sample/files/version-bump.mjs.vendored +17 -0
  337. package/templates/official-sample/files/versions.json.vendored +3 -0
  338. package/upstreams.json +35 -0
  339. package/templates/default/dprint.json_dev-utils.ejs +0 -10
  340. package/templates/default/jest.config.ts@lint-root-dir_dev-utils.ejs +0 -1
  341. package/templates/default/scripts/build.ts@bundler_cli-bundler@lint-build-styles_dev-utils.ejs +0 -1
  342. package/templates/default/scripts/build.ts@bundler_esbuild@dev-utils-pre-build_tailwind.ejs +0 -2
  343. package/templates/default/scripts/build.ts@bundler_esbuild@lint-build-styles_dev-utils.ejs +0 -1
  344. package/templates/default/scripts/build.ts@bundler_esbuild@preset_dev-utils.ejs +0 -7
  345. package/templates/default/scripts/commit.ts_dev-utils.ejs +0 -3
  346. package/templates/default/scripts/dev.ts@bundler_esbuild@dev-utils-pre-build_tailwind.ejs +0 -2
  347. package/templates/default/scripts/dev.ts@bundler_esbuild@lint-build-styles_dev-utils.ejs +0 -1
  348. package/templates/default/scripts/dev.ts@bundler_esbuild@preset_dev-utils.ejs +0 -7
  349. package/templates/default/scripts/esbuild-plugins.ts.ejs +0 -20
  350. package/templates/default/scripts/esbuild-plugins.ts@dev-utils-import_vue.ejs +0 -2
  351. package/templates/default/scripts/esbuild-plugins.ts@dev-utils-plugin_vue.ejs +0 -1
  352. package/templates/default/scripts/esbuild-plugins.ts@dev-utils-plugin_wasm.ejs +0 -13
  353. package/templates/default/scripts/format-check.ts@tool_dprint@preset_dev-utils.ejs +0 -7
  354. package/templates/default/scripts/format.ts@tool_dprint@preset_dev-utils.ejs +0 -7
  355. package/templates/default/scripts/lint-fix.ts@tool_eslint@preset_dev-utils.ejs +0 -7
  356. package/templates/default/scripts/lint-md-fix.ts_dev-utils.ejs +0 -7
  357. package/templates/default/scripts/lint-md.ts_dev-utils.ejs +0 -7
  358. package/templates/default/scripts/lint.ts@tool_eslint@preset_dev-utils.ejs +0 -7
  359. package/templates/default/scripts/prepare.ts_dev-utils.ejs +0 -3
  360. package/templates/default/scripts/spellcheck.ts_dev-utils.ejs +0 -7
  361. package/templates/default/scripts/test-watch.ts_dev-utils@tool_jest.ejs +0 -13
  362. package/templates/default/scripts/test-watch.ts_dev-utils@tool_vitest.ejs +0 -8
  363. package/templates/default/scripts/test.ts_dev-utils@tool_jest.ejs +0 -13
  364. package/templates/default/scripts/test.ts_dev-utils@tool_vitest.ejs +0 -8
  365. package/templates/default/scripts/vite.config.ts@lint-empty-out-dir_dev-utils.ejs +0 -1
  366. package/templates/default/scripts/vite.config.ts@lint-out-dir_dev-utils.ejs +0 -1
  367. package/templates/default/scripts/webpack.config.ts@lint-webpack-default_dev-utils.ejs +0 -1
  368. package/templates/default/src/main.ts@import_css-modules.ejs +0 -1
  369. package/templates/default/src/views/sample-preact-view.tsx_dev-utils.ejs +0 -45
  370. package/templates/default/tsconfig.json_dev-utils@compiler-options_preact.ejs +0 -2
  371. package/templates/default/tsconfig.json_dev-utils@compiler-options_react.ejs +0 -1
  372. package/templates/default/tsconfig.json_dev-utils@compiler-options_solid.ejs +0 -2
  373. /package/templates/default/.github/workflows/{ci.yml@steps_biome-linter.ejs → ci.yml_standalone@steps_biome-linter.ejs} +0 -0
  374. /package/templates/default/.github/workflows/{ci.yml@steps_cspell.ejs → ci.yml_standalone@steps_cspell.ejs} +0 -0
  375. /package/templates/default/.github/workflows/{ci.yml@steps_dprint.ejs → ci.yml_standalone@steps_dprint.ejs} +0 -0
  376. /package/templates/default/.github/workflows/{ci.yml@steps_eslint.ejs → ci.yml_standalone@steps_eslint.ejs} +0 -0
  377. /package/templates/default/.github/workflows/{ci.yml@steps_jest.ejs → ci.yml_standalone@steps_jest.ejs} +0 -0
  378. /package/templates/default/.github/workflows/{ci.yml@steps_markdownlint.ejs → ci.yml_standalone@steps_markdownlint.ejs} +0 -0
  379. /package/templates/default/.github/workflows/{ci.yml@steps_prettier.ejs → ci.yml_standalone@steps_prettier.ejs} +0 -0
  380. /package/templates/default/.github/workflows/{ci.yml@steps_vitest.ejs → ci.yml_standalone@steps_vitest.ejs} +0 -0
  381. /package/templates/default/{.gitignore_tailwind.ejs → .gitignore_tailwind-cli.ejs} +0 -0
  382. /package/templates/default/{CONTRIBUTING.md@scripts_dev-utils.ejs → CONTRIBUTING.md@scripts_framework.ejs} +0 -0
  383. /package/templates/default/e2e/{sample.spec.ts_obsidian-test@lint-no-void-disable_dev-utils.ejs → sample.spec.ts_obsidian-test@lint-no-void-disable_framework.ejs} +0 -0
  384. /package/templates/default/e2e/{sample.spec.ts_obsidian-test@lint-no-void-enable_dev-utils.ejs → sample.spec.ts_obsidian-test@lint-no-void-enable_framework.ejs} +0 -0
  385. /package/templates/default/{eslint.config.mts_dev-utils.ejs → eslint.config.mts_framework.ejs} +0 -0
  386. /package/templates/default/{jest.config.ts@ts-jest-tsconfig_solid.ejs → jest.config.ts_standalone@ts-jest-tsconfig_solid.ejs} +0 -0
  387. /package/templates/default/{prettier.config.mjs.ejs → prettier.config.mjs_standalone.ejs} +0 -0
  388. /package/templates/default/scripts/{commitlint-config.ts.ejs → commitlint-config.ts_standalone.ejs} +0 -0
  389. /package/templates/default/scripts/{nano-staged-config.ts.ejs → nano-staged-config.ts_inline-nano-staged.ejs} +0 -0
  390. /package/templates/default/scripts/{rollup.config.ts@import_rollup-json.ejs → rollup.config.ts_framework@import_rollup-json.ejs} +0 -0
  391. /package/templates/default/scripts/{rollup.config.ts@import_scss.ejs → rollup.config.ts_framework@import_scss.ejs} +0 -0
  392. /package/templates/default/scripts/{rollup.config.ts@unwrap_rollup-json.ejs → rollup.config.ts_framework@unwrap_rollup-json.ejs} +0 -0
  393. /package/templates/default/scripts/{rollup.config.ts@unwrap_scss.ejs → rollup.config.ts_framework@unwrap_scss.ejs} +0 -0
  394. /package/templates/default/scripts/{rollup.config.ts@import_rollup-babel.ejs → rollup.config.ts_standalone@import_rollup-babel.ejs} +0 -0
  395. /package/templates/default/scripts/{rollup.config.ts@import_rollup-postcss.ejs → rollup.config.ts_standalone@import_rollup-postcss.ejs} +0 -0
  396. /package/templates/default/scripts/{rollup.config.ts@import_svelte.ejs → rollup.config.ts_standalone@import_svelte.ejs} +0 -0
  397. /package/templates/default/scripts/{rollup.config.ts@import_vue.ejs → rollup.config.ts_standalone@import_vue.ejs} +0 -0
  398. /package/templates/default/scripts/{rollup.config.ts@import_wasm.ejs → rollup.config.ts_standalone@import_wasm.ejs} +0 -0
  399. /package/templates/default/scripts/{rollup.config.ts@post-plugin_preact.ejs → rollup.config.ts_standalone@post-plugin_preact.ejs} +0 -0
  400. /package/templates/default/scripts/{rollup.config.ts@post-plugin_react.ejs → rollup.config.ts_standalone@post-plugin_react.ejs} +0 -0
  401. /package/templates/default/scripts/{rollup.config.ts@post-plugin_rollup-json.ejs → rollup.config.ts_standalone@post-plugin_rollup-json.ejs} +0 -0
  402. /package/templates/default/scripts/{rollup.config.ts@post-plugin_rollup-postcss.ejs → rollup.config.ts_standalone@post-plugin_rollup-postcss.ejs} +0 -0
  403. /package/templates/default/scripts/{rollup.config.ts@post-plugin_scss.ejs → rollup.config.ts_standalone@post-plugin_scss.ejs} +0 -0
  404. /package/templates/default/scripts/{rollup.config.ts@post-plugin_solid.ejs → rollup.config.ts_standalone@post-plugin_solid.ejs} +0 -0
  405. /package/templates/default/scripts/{rollup.config.ts@post-plugin_wasm.ejs → rollup.config.ts_standalone@post-plugin_wasm.ejs} +0 -0
  406. /package/templates/default/scripts/{rollup.config.ts@pre-plugin_svelte.ejs → rollup.config.ts_standalone@pre-plugin_svelte.ejs} +0 -0
  407. /package/templates/default/scripts/{rollup.config.ts@pre-plugin_vue.ejs → rollup.config.ts_standalone@pre-plugin_vue.ejs} +0 -0
  408. /package/templates/default/scripts/{rollup.config.ts@unwrap_rollup-babel.ejs → rollup.config.ts_standalone@unwrap_rollup-babel.ejs} +0 -0
  409. /package/templates/default/scripts/{rollup.config.ts@unwrap_rollup-postcss.ejs → rollup.config.ts_standalone@unwrap_rollup-postcss.ejs} +0 -0
  410. /package/templates/default/scripts/{rollup.config.ts@unwrap_svelte.ejs → rollup.config.ts_standalone@unwrap_svelte.ejs} +0 -0
  411. /package/templates/default/scripts/{rollup.config.ts@unwrap_vue.ejs → rollup.config.ts_standalone@unwrap_vue.ejs} +0 -0
  412. /package/templates/default/scripts/{rollup.config.ts@unwrap_wasm.ejs → rollup.config.ts_standalone@unwrap_wasm.ejs} +0 -0
  413. /package/templates/default/scripts/{test-watch.ts_dev-utils.ejs → test-watch.ts_framework.ejs} +0 -0
  414. /package/templates/default/scripts/{test.ts_dev-utils.ejs → test.ts_framework.ejs} +0 -0
  415. /package/templates/default/scripts/{vite.config.ts@import_preact.ejs → vite.config.ts_standalone@import_preact.ejs} +0 -0
  416. /package/templates/default/scripts/{vite.config.ts@import_react.ejs → vite.config.ts_standalone@import_react.ejs} +0 -0
  417. /package/templates/default/scripts/{vite.config.ts@import_solid.ejs → vite.config.ts_standalone@import_solid.ejs} +0 -0
  418. /package/templates/default/scripts/{vite.config.ts@import_svelte.ejs → vite.config.ts_standalone@import_svelte.ejs} +0 -0
  419. /package/templates/default/scripts/{vite.config.ts@import_vue.ejs → vite.config.ts_standalone@import_vue.ejs} +0 -0
  420. /package/templates/default/scripts/{vite.config.ts@plugin_preact.ejs → vite.config.ts_standalone@plugin_preact.ejs} +0 -0
  421. /package/templates/default/scripts/{vite.config.ts@plugin_react.ejs → vite.config.ts_standalone@plugin_react.ejs} +0 -0
  422. /package/templates/default/scripts/{vite.config.ts@plugin_solid.ejs → vite.config.ts_standalone@plugin_solid.ejs} +0 -0
  423. /package/templates/default/scripts/{vite.config.ts@plugin_svelte.ejs → vite.config.ts_standalone@plugin_svelte.ejs} +0 -0
  424. /package/templates/default/scripts/{vite.config.ts@plugin_vue.ejs → vite.config.ts_standalone@plugin_vue.ejs} +0 -0
  425. /package/templates/default/scripts/{webpack.config.ts@import_svelte.ejs → webpack.config.ts_standalone@import_svelte.ejs} +0 -0
  426. /package/templates/default/scripts/{webpack.config.ts@import_vue.ejs → webpack.config.ts_standalone@import_vue.ejs} +0 -0
  427. /package/templates/default/scripts/{webpack.config.ts@import_webpack-css-extract.ejs → webpack.config.ts_standalone@import_webpack-css-extract.ejs} +0 -0
  428. /package/templates/default/scripts/{webpack.config.ts@plugin_vue.ejs → webpack.config.ts_standalone@plugin_vue.ejs} +0 -0
  429. /package/templates/default/scripts/{webpack.config.ts@plugin_webpack-css-extract.ejs → webpack.config.ts_standalone@plugin_webpack-css-extract.ejs} +0 -0
  430. /package/templates/default/scripts/{webpack.config.ts@rule_css-modules.ejs → webpack.config.ts_standalone@rule_css-modules.ejs} +0 -0
  431. /package/templates/default/scripts/{webpack.config.ts@rule_css.ejs → webpack.config.ts_standalone@rule_css.ejs} +0 -0
  432. /package/templates/default/scripts/{webpack.config.ts@rule_postcss.ejs → webpack.config.ts_standalone@rule_postcss.ejs} +0 -0
  433. /package/templates/default/scripts/{webpack.config.ts@rule_scss.ejs → webpack.config.ts_standalone@rule_scss.ejs} +0 -0
  434. /package/templates/default/scripts/{webpack.config.ts@rule_solid.ejs → webpack.config.ts_standalone@rule_solid.ejs} +0 -0
  435. /package/templates/default/scripts/{webpack.config.ts@rule_svelte.ejs → webpack.config.ts_standalone@rule_svelte.ejs} +0 -0
  436. /package/templates/default/scripts/{webpack.config.ts@rule_tailwind.ejs → webpack.config.ts_standalone@rule_tailwind.ejs} +0 -0
  437. /package/templates/default/scripts/{webpack.config.ts@rule_vue.ejs → webpack.config.ts_standalone@rule_vue.ejs} +0 -0
  438. /package/templates/default/scripts/{webpack.config.ts@rule_wasm.ejs → webpack.config.ts_standalone@rule_wasm.ejs} +0 -0
  439. /package/templates/default/scripts/{webpack.config.ts@ts-loader-compiler-options_vue.ejs → webpack.config.ts_standalone@ts-loader-compiler-options_vue.ejs} +0 -0
  440. /package/templates/default/scripts/{webpack.config.ts@ts-loader-options_vue.ejs → webpack.config.ts_standalone@ts-loader-options_vue.ejs} +0 -0
  441. /package/templates/default/src/{plugin-settings-component.test.ts_enhanced@test-imports_vitest.ejs → plugin-settings-component.test.ts_all-in-one@test-imports_vitest.ejs} +0 -0
  442. /package/templates/default/src/{plugin-settings.ts_enhanced.ejs → plugin-settings.ts_all-in-one.ejs} +0 -0
  443. /package/templates/default/src/{plugin.ts_enhanced@import2_codemirror.ejs → plugin.ts_all-in-one@import2_codemirror.ejs} +0 -0
  444. /package/templates/default/src/{plugin.ts_enhanced@import2_i18next.ejs → plugin.ts_all-in-one@import2_i18next.ejs} +0 -0
  445. /package/templates/default/src/{plugin.ts_enhanced@import2_lit.ejs → plugin.ts_all-in-one@import2_lit.ejs} +0 -0
  446. /package/templates/default/src/{plugin.ts_enhanced@import2_preact.ejs → plugin.ts_all-in-one@import2_preact.ejs} +0 -0
  447. /package/templates/default/src/{plugin.ts_enhanced@import2_react.ejs → plugin.ts_all-in-one@import2_react.ejs} +0 -0
  448. /package/templates/default/src/{plugin.ts_enhanced@import2_solid.ejs → plugin.ts_all-in-one@import2_solid.ejs} +0 -0
  449. /package/templates/default/src/{plugin.ts_enhanced@import2_svelte.ejs → plugin.ts_all-in-one@import2_svelte.ejs} +0 -0
  450. /package/templates/default/src/{plugin.ts_enhanced@import2_typesafe-i18n.ejs → plugin.ts_all-in-one@import2_typesafe-i18n.ejs} +0 -0
  451. /package/templates/default/src/{plugin.ts_enhanced@import2_vue.ejs → plugin.ts_all-in-one@import2_vue.ejs} +0 -0
  452. /package/templates/default/src/{plugin.ts_enhanced@import2_wasm.ejs → plugin.ts_all-in-one@import2_wasm.ejs} +0 -0
  453. /package/templates/default/src/{plugin.ts_enhanced@method_ui-view.ejs → plugin.ts_all-in-one@method_ui-view.ejs} +0 -0
  454. /package/templates/default/src/{plugin.ts_enhanced@onload_codemirror.ejs → plugin.ts_all-in-one@onload_codemirror.ejs} +0 -0
  455. /package/templates/default/src/{plugin.ts_enhanced@onload_i18next.ejs → plugin.ts_all-in-one@onload_i18next.ejs} +0 -0
  456. /package/templates/default/src/{plugin.ts_enhanced@onload_lit.ejs → plugin.ts_all-in-one@onload_lit.ejs} +0 -0
  457. /package/templates/default/src/{plugin.ts_enhanced@onload_preact.ejs → plugin.ts_all-in-one@onload_preact.ejs} +0 -0
  458. /package/templates/default/src/{plugin.ts_enhanced@onload_react.ejs → plugin.ts_all-in-one@onload_react.ejs} +0 -0
  459. /package/templates/default/src/{plugin.ts_enhanced@onload_solid.ejs → plugin.ts_all-in-one@onload_solid.ejs} +0 -0
  460. /package/templates/default/src/{plugin.ts_enhanced@onload_svelte.ejs → plugin.ts_all-in-one@onload_svelte.ejs} +0 -0
  461. /package/templates/default/src/{plugin.ts_enhanced@onload_typesafe-i18n.ejs → plugin.ts_all-in-one@onload_typesafe-i18n.ejs} +0 -0
  462. /package/templates/default/src/{plugin.ts_enhanced@onload_vue.ejs → plugin.ts_all-in-one@onload_vue.ejs} +0 -0
  463. /package/templates/default/src/{plugin.ts_enhanced@onload_wasm.ejs → plugin.ts_all-in-one@onload_wasm.ejs} +0 -0
  464. /package/templates/default/src/preact-components/{sample-preact-component.tsx_dev-utils.ejs → sample-preact-component.tsx_framework.ejs} +0 -0
  465. /package/templates/default/src/solid-components/{sample-solid-component.tsx_dev-utils.ejs → sample-solid-component.tsx_framework.ejs} +0 -0
  466. /package/templates/default/src/styles/{main.css_dev-utils@content_tailwind.ejs → main.css_framework@content_tailwind.ejs} +0 -0
  467. /package/templates/default/src/views/{sample-lit-view.ts@lint-register-element_dev-utils.ejs → sample-lit-view.ts@lint-register-element_framework.ejs} +0 -0
  468. /package/templates/default/src/views/{sample-preact-view.tsx_standalone.ejs → sample-preact-view.tsx.ejs} +0 -0
  469. /package/templates/default/src/views/{sample-solid-view.tsx_dev-utils.ejs → sample-solid-view.tsx_framework.ejs} +0 -0
  470. /package/templates/default/src/wasm/{answer.ts_esbuild.ejs → answer.ts_wasm-esbuild.ejs} +0 -0
  471. /package/templates/default/src/wasm/{answer.ts_parcel.ejs → answer.ts_wasm-parcel.ejs} +0 -0
  472. /package/templates/default/src/wasm/{answer.ts_rollup.ejs → answer.ts_wasm-rollup.ejs} +0 -0
  473. /package/templates/default/src/wasm/{answer.ts_vite.ejs → answer.ts_wasm-vite.ejs} +0 -0
  474. /package/templates/default/src/wasm/{answer.ts_webpack.ejs → answer.ts_wasm-webpack.ejs} +0 -0
  475. /package/templates/default/src/{wasm.d.ts_esbuild.ejs → wasm.d.ts_wasm-esbuild.ejs} +0 -0
  476. /package/templates/default/src/{wasm.d.ts_parcel.ejs → wasm.d.ts_wasm-parcel.ejs} +0 -0
  477. /package/templates/default/src/{wasm.d.ts_rollup.ejs → wasm.d.ts_wasm-rollup.ejs} +0 -0
  478. /package/templates/default/src/{wasm.d.ts_vite.ejs → wasm.d.ts_wasm-vite.ejs} +0 -0
  479. /package/templates/default/src/{wasm.d.ts_webpack.ejs → wasm.d.ts_wasm-webpack.ejs} +0 -0
  480. /package/templates/default/{tsconfig.json_dev-utils@compiler-options_i18next.ejs → tsconfig.json_framework@compiler-options_i18next.ejs} +0 -0
  481. /package/templates/default/{tsconfig.json_dev-utils@compiler-options_lit.ejs → tsconfig.json_framework@compiler-options_lit.ejs} +0 -0
  482. /package/templates/default/{tsconfig.json_dev-utils@include_has-e2e.ejs → tsconfig.json_framework@include_has-e2e.ejs} +0 -0
  483. /package/templates/default/{tsconfig.json_dev-utils@include_svelte.ejs → tsconfig.json_framework@include_svelte.ejs} +0 -0
  484. /package/templates/default/{tsconfig.json_dev-utils@include_vue.ejs → tsconfig.json_framework@include_vue.ejs} +0 -0
  485. /package/templates/default/{tsconfig.json_dev-utils@types_jest.ejs → tsconfig.json_framework@types_jest.ejs} +0 -0
  486. /package/templates/default/{tsconfig.json_dev-utils@types_svelte.ejs → tsconfig.json_framework@types_svelte.ejs} +0 -0
  487. /package/templates/default/{tsconfig.json_dev-utils@types_wdio-obsidian.ejs → tsconfig.json_framework@types_wdio-obsidian.ejs} +0 -0
  488. /package/templates/default/{tsconfig.json_dev-utils@types_with-unofficial.ejs → tsconfig.json_framework@types_with-unofficial.ejs} +0 -0
  489. /package/templates/default/{vitest.config.ts_dev-utils.ejs → vitest.config.ts_framework.ejs} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mnaoumov/create-obsidian-plugin",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Create Obsidian plugin from modern templates.",
5
5
  "homepage": "https://github.com/mnaoumov/create-obsidian-plugin#readme",
6
6
  "bugs": "https://github.com/mnaoumov/create-obsidian-plugin/issues",
@@ -21,7 +21,8 @@
21
21
  "CHANGELOG.md",
22
22
  "LICENSE",
23
23
  "README.md",
24
- "package.json"
24
+ "package.json",
25
+ "upstreams.json"
25
26
  ],
26
27
  "scripts": {
27
28
  "build": "jiti scripts/build.ts",
@@ -32,11 +33,16 @@
32
33
  "lint": "jiti scripts/lint.ts",
33
34
  "lint:fix": "jiti scripts/lint-fix.ts",
34
35
  "prepare": "jiti scripts/prepare.ts",
35
- "prepublishOnly": "npm run verify:upstream-links && npm run verify:tarball",
36
+ "prepublishOnly": "npm run verify:upstream-links && npm run verify:official-sample && npm run verify:tarball",
36
37
  "render:case": "jiti scripts/render-one-case.ts",
37
38
  "spellcheck": "jiti scripts/spellcheck.ts",
39
+ "sync:docs-showcase": "jiti scripts/sync-docs-showcase.ts",
40
+ "sync:obsidian": "jiti scripts/sync-obsidian.ts",
41
+ "sync:official-sample": "jiti scripts/sync-official-sample.ts",
42
+ "sync:upstreams": "sync-upstreams",
38
43
  "test": "jiti scripts/test.ts",
39
44
  "verify:answer-space": "jiti scripts/verify-answer-space.ts",
45
+ "verify:official-sample": "jiti scripts/verify-official-sample.ts",
40
46
  "verify:plugin-drift": "jiti scripts/verify-plugin-drift.ts",
41
47
  "verify:projects": "jiti scripts/verify-generated-projects.ts",
42
48
  "verify:rendering": "jiti scripts/verify-rendering.ts",
@@ -60,12 +66,13 @@
60
66
  "@commitlint/types": "^21.2.0",
61
67
  "@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
62
68
  "@eslint/js": "^10.0.1",
69
+ "@mnaoumov/typescript-dev-toolkit": "^3.3.0",
63
70
  "@stylistic/eslint-plugin": "^5.10.0",
64
71
  "@total-typescript/ts-reset": "^0.6.1",
65
72
  "@tsconfig/strictest": "^2.0.8",
66
73
  "@types/ejs": "^3.1.5",
67
74
  "@types/semver": "^7.8.0",
68
- "@vitest/coverage-v8": "^4.1.11",
75
+ "@vitest/coverage-v8": "^5.0.5",
69
76
  "better-typescript-lib": "^2.12.0",
70
77
  "cspell": "^10.1.1",
71
78
  "czg": "^1.14.0",
@@ -77,10 +84,11 @@
77
84
  "eslint-plugin-perfectionist": "^5.10.1",
78
85
  "globals": "^17.11.0",
79
86
  "husky": "^9.1.7",
87
+ "ignore": "^7.0.12",
80
88
  "jiti": "^2.7.0",
81
89
  "typescript": "6.0.3",
82
90
  "typescript-eslint": "^8.68.0",
83
- "vitest": "^4.1.11",
91
+ "vitest": "^5.0.5",
84
92
  "yaml": "^2.9.0"
85
93
  }
86
94
  }
package/src/main.ts CHANGED
@@ -29,6 +29,7 @@ import type {
29
29
  } from './answers.ts';
30
30
  import type { CliArgs } from './cli-args.ts';
31
31
  import type { Overlay } from './overlay.ts';
32
+ import type { UpstreamSnapshot } from './upstream-snapshot.ts';
32
33
 
33
34
  import {
34
35
  formatAnswersJson,
@@ -53,10 +54,19 @@ import {
53
54
  validatePluginIdIsUnlisted
54
55
  } from './directory-registry.ts';
55
56
  import { needsInitialFormat } from './features/formatter/index.ts';
57
+ import { INITIAL_COMMIT_MESSAGE } from './features/git-hooks.ts';
56
58
  import {
57
59
  getInstallCommand,
58
60
  getRunCommand
59
61
  } from './features/package-manager/index.ts';
62
+ import { isOfficialSamplePreset } from './features/preset/official-sample.ts';
63
+ import {
64
+ copyOfficialSample,
65
+ getUpstreamsPath,
66
+ loadOfficialSampleSnapshot,
67
+ OFFICIAL_SAMPLE_PINNED_ANSWERS,
68
+ OFFICIAL_SAMPLE_UPSTREAM_NAME
69
+ } from './official-sample.ts';
60
70
  import {
61
71
  loadOverlay,
62
72
  toRecordedOverlayPath
@@ -74,6 +84,10 @@ import {
74
84
  loadConfig,
75
85
  recordHashesOnDisk
76
86
  } from './templates.ts';
87
+ import {
88
+ fetchUpstreamSnapshot,
89
+ readUpstream
90
+ } from './upstream-snapshot.ts';
77
91
  import {
78
92
  fetchLatestObsidianVersion,
79
93
  fetchLatestVersion,
@@ -103,9 +117,35 @@ const ARGV_OFFSET = 2;
103
117
 
104
118
  const JSON_INDENT_SPACES = 2;
105
119
 
120
+ /** How much of a commit SHA a message names: git's own short form. */
121
+ const SHORT_SHA_LENGTH = 7;
122
+
106
123
  /** Owner-writable, everyone-executable: a script the user must `chmod` before running is a poor hand-off. */
107
124
  const SCRIPT_MODE = 0o755;
108
125
 
126
+ /**
127
+ * The answers with what the preset pins applied, refusing the two flags only one kind of preset reads.
128
+ *
129
+ * `--latest` picks which upstream tree the official sample copies, so on a template preset it would be dropped.
130
+ * `--customTemplate` layers over the built-in templates, and the official sample renders none.
131
+ */
132
+ function applyPresetFlags(answers: Answers, cliArgs: CliArgs, hasOverlay: boolean): Answers {
133
+ if (!isOfficialSamplePreset(answers.preset)) {
134
+ if (cliArgs.latest) {
135
+ exitWithUsageError(`--latest picks which upstream tree preset=official-sample copies, and the preset is ${answers.preset}.
136
+ Drop --latest, or pass --preset=official-sample.`);
137
+ }
138
+ return answers;
139
+ }
140
+
141
+ if (hasOverlay) {
142
+ exitWithUsageError(`--customTemplate layers over the built-in templates, and preset=official-sample renders none: it copies obsidianmd/obsidian-sample-plugin as it is.
143
+ Drop --customTemplate, or choose another preset.`);
144
+ }
145
+
146
+ return { ...answers, ...OFFICIAL_SAMPLE_PINNED_ANSWERS };
147
+ }
148
+
109
149
  /**
110
150
  * Refuses to scaffold a plugin the Community directory would not list, naming the flag that fixes it.
111
151
  *
@@ -272,6 +312,11 @@ function exitWithUsageError(message: string): never {
272
312
  process.exit(1);
273
313
  }
274
314
 
315
+ function hasPrepareScript(targetDir: string): boolean {
316
+ const packageJson = JSON.parse(readFileSync(join(targetDir, 'package.json'), 'utf-8')) as PackageJson;
317
+ return Object.hasOwn(packageJson.scripts ?? {}, 'prepare');
318
+ }
319
+
275
320
  /**
276
321
  * Loads the overlay or stops with the reason, the same stderr-then-exit shape as a rejected flag: an
277
322
  * overlay that does not load is a usage error, and it is found before any question is asked.
@@ -392,12 +437,41 @@ async function resolveExternalVersions(answers: Answers, overlay: null | Overlay
392
437
  return { minAppVersion, resolvedVersions };
393
438
  }
394
439
 
440
+ /**
441
+ * The upstream tree the official sample copies: the snapshot this release vendored, or under `--latest` upstream's
442
+ * tree today. A failed fetch falls back to the snapshot with a warning, for the reason `resolveVersions()` falls back
443
+ * to `latest`: generating offline must still work.
444
+ */
445
+ async function resolveOfficialSampleSnapshot(latest: boolean): Promise<UpstreamSnapshot> {
446
+ const vendored = loadOfficialSampleSnapshot();
447
+ if (!latest) {
448
+ return vendored;
449
+ }
450
+
451
+ const upstream = readUpstream(getUpstreamsPath(), OFFICIAL_SAMPLE_UPSTREAM_NAME);
452
+ const s = spinner();
453
+ s.start(`Fetching ${upstream.repo}@${upstream.ref}...`);
454
+ try {
455
+ const snapshot = await fetchUpstreamSnapshot(upstream.repo, upstream.ref);
456
+ s.stop(`Fetched ${upstream.repo} at ${snapshot.commit.slice(0, SHORT_SHA_LENGTH)}.`);
457
+ return snapshot;
458
+ } catch (error: unknown) {
459
+ s.stop(`Could not fetch ${upstream.repo}.`);
460
+ log.warn(`${error instanceof Error ? error.message : String(error)}\nUsing the snapshot this release vendored, ${vendored.commit.slice(0, SHORT_SHA_LENGTH)}.`);
461
+ return vendored;
462
+ }
463
+ }
464
+
395
465
  async function runCreate(currentVersion: string, cliArgs: CliArgs): Promise<void> {
396
466
  const { answers: suppliedAnswers, customTemplate, useDefaults } = cliArgs;
397
467
  const overlay = customTemplate ? loadOverlayOrExit(resolvePath(customTemplate)) : null;
398
- const answers = await ensurePluginIdIsUnlisted(
399
- assertManifestAnswersAreListable(useDefaults ? getDefaultAnswers(suppliedAnswers) : await promptAnswers(suppliedAnswers)),
400
- useDefaults
468
+ const answers = applyPresetFlags(
469
+ await ensurePluginIdIsUnlisted(
470
+ assertManifestAnswersAreListable(useDefaults ? getDefaultAnswers(suppliedAnswers) : await promptAnswers(suppliedAnswers)),
471
+ useDefaults
472
+ ),
473
+ cliArgs,
474
+ overlay !== null
401
475
  );
402
476
 
403
477
  // Not under `--yes`: that path is what an exported script itself runs, so offering to export from
@@ -426,15 +500,25 @@ Pass --force to scaffold into it anyway.`);
426
500
  }
427
501
  }
428
502
 
429
- const { minAppVersion, resolvedVersions } = await resolveExternalVersions(answers, overlay);
503
+ let newConfig: GeneratorConfig;
504
+ if (isOfficialSamplePreset(answers.preset)) {
505
+ // Upstream's own versions and lockfile are the point, so nothing is resolved.
506
+ const snapshot = await resolveOfficialSampleSnapshot(cliArgs.latest);
507
+ const s = spinner();
508
+ s.start('Copying the official sample plugin...');
509
+ newConfig = copyOfficialSample(answers, targetDir, currentVersion, null, snapshot);
510
+ s.stop(`Copied obsidianmd/obsidian-sample-plugin at ${snapshot.commit.slice(0, SHORT_SHA_LENGTH)}.`);
511
+ } else {
512
+ const { minAppVersion, resolvedVersions } = await resolveExternalVersions(answers, overlay);
513
+ const s = spinner();
514
+ s.start('Scaffolding plugin...');
515
+ newConfig = copyTemplates(answers, targetDir, currentVersion, null, resolvedVersions, minAppVersion, overlay);
516
+ s.stop('Plugin scaffolded.');
517
+ }
430
518
 
431
- const s = spinner();
432
- s.start('Scaffolding plugin...');
433
- const newConfig = copyTemplates(answers, targetDir, currentVersion, null, resolvedVersions, minAppVersion, overlay);
434
519
  const configPath = join(targetDir, CONFIG_FILE_NAME);
435
520
  const configWithAnswers = buildSavedConfig(newConfig, answers, overlay, targetDir);
436
521
  writeFileSync(configPath, `${JSON.stringify(configWithAnswers, null, JSON_INDENT_SPACES)}\n`);
437
- s.stop('Plugin scaffolded.');
438
522
 
439
523
  // `--yes` installs nothing and so formats nothing, which leaves a prettier or biome project failing its own
440
524
  // `format:check` until `format` runs once. It stays out of the install on purpose -- a script may want to
@@ -526,11 +610,20 @@ async function runPostScaffold(targetDir: string, answers: Answers): Promise<boo
526
610
  // `init.defaultBranch` says, which need not be the branch the generated CI workflow triggers on --
527
611
  // A mismatch produces a repo whose CI never fires. Both come from the same answer.
528
612
  await execAsync(`git init -b ${answers.defaultBranch}`, targetDir);
613
+ // The install ran before there was a `.git`, so its `prepare` installed no hooks, and Yarn 2+ never runs a
614
+ // Root `prepare` on install at all. Running it here is what makes the hooks live from the first commit on.
615
+ if (isInstalled && hasPrepareScript(targetDir)) {
616
+ await execAsync(getRunCommand(pm, 'prepare'), targetDir);
617
+ }
529
618
  await execAsync('git add -A', targetDir);
530
- await execAsync('git commit -m "Initial commit from create-obsidian-plugin"', targetDir);
619
+ // A conventional header, because the commit goes through the project's own `commit-msg` hook.
620
+ await execAsync(`git commit -m "${INITIAL_COMMIT_MESSAGE}"`, targetDir);
531
621
  s.stop('Git repository initialized with initial commit.');
532
- } catch {
622
+ } catch (error: unknown) {
533
623
  s.stop('Failed to initialize git. Run `git init` manually.');
624
+ if (error instanceof Error && 'stderr' in error) {
625
+ log.error(String(error.stderr));
626
+ }
534
627
  }
535
628
  }
536
629
 
@@ -601,7 +694,8 @@ This project records it in ${CONFIG_FILE_NAME}. Pass --customTemplate=<dir> to p
601
694
  assertNotCancelled(shouldRePrompt);
602
695
 
603
696
  if (shouldRePrompt) {
604
- answers = await promptAnswers(saved);
697
+ // The saved answers seed each prompt, and only this run's flags skip theirs.
698
+ answers = await promptAnswers(saved, suppliedAnswers);
605
699
  } else {
606
700
  answers = saved;
607
701
  }
@@ -623,6 +717,19 @@ Run without --yes to answer them again.`);
623
717
  answers = await ensurePluginIdIsUnlisted(answers, useDefaults);
624
718
  }
625
719
 
720
+ answers = applyPresetFlags(answers, cliArgs, overlay !== null);
721
+
722
+ if (isOfficialSamplePreset(answers.preset)) {
723
+ const snapshot = await resolveOfficialSampleSnapshot(cliArgs.latest);
724
+ const s = spinner();
725
+ s.start('Updating project files...');
726
+ const newConfig = copyOfficialSample(answers, targetDir, currentVersion, existingConfig, snapshot);
727
+ writeFileSync(configPath, `${JSON.stringify({ ...newConfig, answers }, null, JSON_INDENT_SPACES)}\n`);
728
+ s.stop(`Update complete: obsidianmd/obsidian-sample-plugin at ${snapshot.commit.slice(0, SHORT_SHA_LENGTH)}.`);
729
+ outro('Project updated successfully!');
730
+ return;
731
+ }
732
+
626
733
  // A project that has already released carries a `manifest.json` its own `npm run version` rewrote, so its
627
734
  // Hash no longer matches the recorded one and the updater skips it -- the freshly looked-up
628
735
  // `minAppVersion` only ever reaches a manifest nobody has touched.
@@ -1 +1,5 @@
1
1
  blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Questions and help
4
+ url: https://github.com/<%= authorGitHubName %>/obsidian-<%= pluginId %>/discussions
5
+ about: Ask how to use the plugin or how to do something with it. Issues are for bug reports and feature requests.
@@ -11,14 +11,4 @@ permissions:
11
11
 
12
12
  jobs:
13
13
  attest:
14
- runs-on: ubuntu-latest
15
- steps:
16
- - name: Download release assets
17
- env:
18
- GH_TOKEN: ${{ github.token }}
19
- run: gh release download "${{ github.event.release.tag_name }}" --repo "${{ github.repository }}" --dir assets
20
-
21
- - name: Generate artifact attestation
22
- uses: actions/attest@v4
23
- with:
24
- subject-path: assets/*
14
+ uses: mnaoumov/obsidian-dev-toolkit/.github/workflows/obsidian-plugin-attest-release-assets.yml@<%= _toolkitWorkflowRef %>
@@ -0,0 +1,19 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [<%= defaultBranch %>]
6
+ pull_request:
7
+ branches: [<%= defaultBranch %>]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ ci:
14
+ # Installs the dependencies and runs `<%= packageManager %> run gate`.
15
+ uses: mnaoumov/obsidian-dev-toolkit/.github/workflows/obsidian-plugin-ci.yml@<%= _toolkitWorkflowRef %>
16
+ <%- render('job-permissions') -%>
17
+ with:
18
+ package-manager: <%= packageManager %>
19
+ <%- render('with') -%>
@@ -0,0 +1,3 @@
1
+ # Publishing the coverage badge pushes it to the `badges` branch.
2
+ permissions:
3
+ contents: write
@@ -13,7 +13,7 @@ jobs:
13
13
  - uses: actions/checkout@v7
14
14
  - uses: actions/setup-node@v7
15
15
  with:
16
- node-version: 24
16
+ node-version-file: .nvmrc
17
17
  cache: npm
18
18
  - run: npm ci
19
19
  <%- render('steps') -%>
@@ -0,0 +1,19 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - '*'
7
+
8
+ permissions:
9
+ contents: write
10
+ id-token: write
11
+ attestations: write
12
+
13
+ jobs:
14
+ release:
15
+ # Checks the tag is the manifest version, builds, archives `demo-vault/`, publishes the release and attests its
16
+ # Assets.
17
+ uses: mnaoumov/obsidian-dev-toolkit/.github/workflows/obsidian-plugin-release.yml@<%= _toolkitWorkflowRef %>
18
+ with:
19
+ package-manager: <%= packageManager %>
@@ -15,7 +15,7 @@ jobs:
15
15
  - uses: actions/checkout@v7
16
16
  - uses: actions/setup-node@v7
17
17
  with:
18
- node-version: 24
18
+ node-version-file: .nvmrc
19
19
  cache: npm
20
20
  - run: npm ci
21
21
  - run: npm run build
@@ -23,5 +23,6 @@ data.json
23
23
 
24
24
  # Build output
25
25
  dist
26
+ coverage
26
27
  .env
27
28
  /tsconfig.tsbuildinfo
@@ -0,0 +1,2 @@
1
+ # The Obsidian builds wdio-obsidian-service downloads for the end-to-end tests
2
+ .obsidian-cache
@@ -0,0 +1 @@
1
+ 26
@@ -8,3 +8,4 @@ demo-vault
8
8
 
9
9
  # Markdown belongs to markdownlint.
10
10
  *.md
11
+ <%- render('ignores') -%>
@@ -0,0 +1,3 @@
1
+
2
+ # The developer docs' code blocks, as the docs show them. See src/docs/README.md.
3
+ src/docs
@@ -7,7 +7,7 @@ When you add a user-facing feature, add or update its note in the same change.
7
7
 
8
8
  ### One-time setup before the button suite can run
9
9
 
10
- `npm run test:integration:demo-vault` opens a copy of `demo-vault/` in a real Obsidian and clicks every button in it. It needs the CodeScript Toolkit binary, which it copies out of your own `demo-vault/` to keep the run hermetic. Open `demo-vault/` in Obsidian once and let `demo-vault-helper` install CodeScript Toolkit; the installed copy is gitignored, so each machine does this for itself. Until then the suite fails with a message telling you exactly this.
10
+ `npm run test:integration:demo-vault` opens a copy of `demo-vault/` in a real Obsidian and clicks every button in it. It needs the `CodeScript Toolkit` binary, which it copies out of your own `demo-vault/` to keep the run hermetic. Open `demo-vault/` in Obsidian once and let `demo-vault-helper` install `CodeScript Toolkit`; the installed copy is gitignored, so each machine does this for itself. Until then the suite fails with a message telling you exactly this.
11
11
 
12
12
  ### Checking the vault
13
13
 
@@ -7,6 +7,6 @@
7
7
 
8
8
  A copy of the vault ships with every release. You can access it via any of the following:
9
9
 
10
- 1. Running the **<%= pluginName %>: Open demo vault** command.
10
+ 1. Running the **`<%- pluginName %>`: Open demo vault** command.
11
11
  2. Downloading `<%= pluginId %>-demo-vault.zip` from the [Releases](https://github.com/<%= authorGitHubName %>/obsidian-<%= pluginId %>/releases). It unzips into a single `<%= pluginId %>-demo-vault-<version>` folder.
12
12
  3. Browsing its source in [`demo-vault/`](./demo-vault/README.md) in this repository.
@@ -0,0 +1,4 @@
1
+
2
+ ## Developer docs showcase
3
+
4
+ Every code block of the [Obsidian developer docs](https://docs.obsidian.md) is a command of this plugin: open the command palette and type `Docs:`. [`src/docs/README.md`](./src/docs/README.md) lists every block, with its command or the reason it has none. Whatever a command shows, a Notice, a modal or a settings tab, links the docs page its code came from, and `Docs showcase: Open the docs page of a snippet` opens that page without running the snippet.
@@ -9,4 +9,4 @@ To show them, run the following command in the `DevTools Console`:
9
9
  window.DEBUG.enable('<%= pluginId %>');
10
10
  ```
11
11
 
12
- For more details, refer to the [documentation](https://mnaoumov.dev/obsidian-dev-utils/guides/debugging/).
12
+ For more details, refer to the [documentation](https://mnaoumov.dev/obsidian-lib/guides/debugging/).
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3
+ "extends": ["./node_modules/@mnaoumov/typescript-dev-toolkit/assets/biome.json"],
4
+ "files": {
5
+ "includes": ["**", "!**/dist", "!**/coverage", "!**/node_modules", "!**/demo-vault", "!**/*-lock.json"<%- render('excludes') %>],
6
+ },
7
+ "linter": {
8
+ "rules": {
9
+ "complexity": {
10
+ // The shared ESLint config's `unicorn/class-reference-in-static-methods` asks for `this` in a static method,
11
+ // which this rule rejects. The sample code follows the shared config and the real plugins.
12
+ "noThisInStatic": "off",
13
+ },
14
+ },
15
+ },
16
+ }
@@ -28,7 +28,7 @@
28
28
  }
29
29
  },
30
30
  "files": {
31
- "includes": ["**", "!**/dist", "!**/node_modules", "!**/demo-vault", "!**/*-lock.json"]
31
+ "includes": ["**", "!**/dist", "!**/coverage", "!**/node_modules", "!**/demo-vault", "!**/*-lock.json"]
32
32
  },
33
33
  "overrides": [
34
34
  {
@@ -2,6 +2,9 @@
2
2
  "version": "0.2",
3
3
  "ignorePaths": [
4
4
  "**/*.wasm",
5
+ ".create-obsidian-plugin.json",
6
+ <%- render('ignore-paths') -%>
7
+ "coverage",
5
8
  "dist",
6
9
  "node_modules",
7
10
  "tsconfig.tsbuildinfo"
@@ -9,11 +12,14 @@
9
12
  "dictionaryDefinitions": [],
10
13
  "dictionaries": [],
11
14
  "words": [
12
- <%- JSON.stringify(authorGitHubName) %>,
15
+ <% _cspellIdentityWords.forEach((word) => { -%>
16
+ <%- JSON.stringify(word) %>,
17
+ <% }); -%>
13
18
  "Invocables",
14
19
  "assemblyscript",
15
20
  "autoprefixer",
16
21
  "biomejs",
22
+ "churny",
17
23
  "codicon",
18
24
  "codemirror",
19
25
  "collab",
@@ -36,12 +42,14 @@
36
42
  "lintstagedrc",
37
43
  "lucide",
38
44
  "markdownlint",
39
- "mnaoumov",
45
+ "nvmrc",
40
46
  "obsidianmd",
41
47
  "onload",
42
48
  "onunload",
43
49
  "postcss",
44
50
  "preact",
51
+ "rescanning",
52
+ "smol",
45
53
  "svelte",
46
54
  "tailwindcss",
47
55
  "tidelift",
@@ -2,11 +2,11 @@
2
2
  .obsidian/workspace*.json
3
3
  .obsidian/hotkeys.json
4
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.
5
+ # Both plugins in this vault are injected at release time by obsidian-dev-toolkit: the freshly built plugin
6
+ # Under test, and the obsidian-dev-toolkit-owned `Demo Vault Helper`, which installs, configures and enables
7
+ # `CodeScript Toolkit` at runtime. Nothing plugin-related is committed.
8
8
  #
9
- # CodeScript Toolkit also lands here the first time you open this vault in Obsidian, which is where the
9
+ # `CodeScript Toolkit` also lands here the first time you open this vault in Obsidian, which is where the
10
10
  # Demo-vault button suite picks it up from.
11
11
  .obsidian/plugins/*
12
12
 
@@ -15,7 +15,7 @@ caption: Run the Sample command
15
15
  require('/demoSetup.ts').runSampleCommand(app);
16
16
  ```
17
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`).
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
19
 
20
20
  Every button in this vault also states its **manual equivalent**, so you learn the real steps rather than depending on the buttons.
21
21
 
@@ -1,6 +1,6 @@
1
1
  # Sample commands
2
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.
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
4
 
5
5
  ## Sample
6
6
 
@@ -13,13 +13,13 @@ caption: Run Sample
13
13
  require('/demoSetup.ts').runSampleCommand(app);
14
14
  ```
15
15
 
16
- Manual equivalent: open the Command Palette (`Ctrl+P` / `Cmd+P`) and run **<%= pluginName %>: Sample**.
16
+ Manual equivalent: open the Command Palette (`Ctrl+P` / `Cmd+P`) and run **`<%- pluginName %>`: Sample**.
17
17
 
18
18
  ## Sample editor
19
19
 
20
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
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.
22
+ Editor commands need a live editor, and this vault opens notes in reading view — so the button below opens the scratch note (`Materials/01 Sample commands/Scratch note.md`, created on first use) in Source mode first, puts the cursor at the end, and only then runs the command.
23
23
 
24
24
  ```code-button
25
25
  ---
@@ -28,7 +28,7 @@ caption: Run Sample editor on the scratch note
28
28
  await require('/demoSetup.ts').runSampleEditorCommandOnScratchNote(app);
29
29
  ```
30
30
 
31
- Manual equivalent: open `Scratch note`, switch it to Source mode (`Ctrl+E` / `Cmd+E`), place the cursor, and run **<%= pluginName %>: Sample editor**.
31
+ Manual equivalent: open `Scratch note`, switch it to Source mode (`Ctrl+E` / `Cmd+E`), place the cursor, and run **`<%- pluginName %>`: Sample editor**.
32
32
 
33
33
  The scratch note is gitignored, so whatever you write in it stays out of your repository.
34
34
 
@@ -1,8 +1,8 @@
1
1
  # Settings
2
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.
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
4
 
5
- Find them in Obsidian under **Settings → Community plugins → <%= pluginName %>**.
5
+ Find them in Obsidian under **Settings → Community plugins → `<%- pluginName %>`**.
6
6
 
7
7
  ## General
8
8
 
@@ -1,6 +1,6 @@
1
1
  # WebAssembly
2
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.
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
4
 
5
5
  ```code-button
6
6
  ---
@@ -11,7 +11,7 @@ require('/demoSetup.ts').runSampleWasmAnswerCommand(app);
11
11
 
12
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
13
 
14
- Manual equivalent: open the Command Palette (`Ctrl+P` / `Cmd+P`) and run **<%= pluginName %>: Sample WASM answer**.
14
+ Manual equivalent: open the Command Palette (`Ctrl+P` / `Cmd+P`) and run **`<%- pluginName %>`: Sample WASM answer**.
15
15
 
16
16
  ## The module
17
17
 
@@ -4,7 +4,7 @@ This is an [Obsidian](https://obsidian.md/) vault demonstrating features of the
4
4
 
5
5
  ## Opening this vault
6
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.
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
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
9
 
10
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>).
@@ -3,11 +3,11 @@ import type {
3
3
  TFile
4
4
  } from 'obsidian';
5
5
 
6
+ import { configureCommunityPlugin } from '@mnaoumov/obsidian-lib/community-plugins';
6
7
  import {
7
8
  MarkdownView,
8
9
  Notice
9
10
  } from 'obsidian';
10
- import { configureCommunityPlugin } from 'obsidian-dev-utils/obsidian/community-plugins';
11
11
 
12
12
  // Shared code for every `code-button` in this vault, so each note's button stays a one-liner instead of a
13
13
  // Block copy-pasted across notes.
@@ -1,13 +1,13 @@
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
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
3
  // Startup setup. Here it just opens the landing note.
4
4
 
5
5
  import type { App } from 'obsidian';
6
6
 
7
7
  const START_NOTE_PATH = '00 Start.md';
8
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
9
+ // `CodeScript Toolkit` calls the exported `invoke` on load (its `startupScriptPath` setting, which the
10
+ // `Demo Vault Helper` points here). A top-level script with no `invoke` export throws
11
11
  // `this.startupScript.invoke is not a function` the moment the vault loads.
12
12
  export async function invoke(app: App): Promise<void> {
13
13
  const startNote = app.vault.getFileByPath(START_NOTE_PATH);