@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.
- package/LICENSE +19 -0
- package/README.md +341 -2
- package/dist/main.js +4184 -0
- package/package.json +78 -4
- package/src/main.ts +650 -0
- package/templates/default/.depcheckrc.json.ejs +19 -0
- package/templates/default/.editorconfig.ejs +11 -0
- package/templates/default/.env.ejs +1 -0
- package/templates/default/.env@vault_has-vault-false.ejs +2 -0
- package/templates/default/.env@vault_has-vault-true.ejs +1 -0
- package/templates/default/.gitattributes.ejs +7 -0
- package/templates/default/.github/FUNDING.yml.ejs +3 -0
- package/templates/default/.github/ISSUE_TEMPLATE/bug_report.yml.ejs +71 -0
- package/templates/default/.github/ISSUE_TEMPLATE/config.yml.ejs +1 -0
- package/templates/default/.github/ISSUE_TEMPLATE/feature_request.yml.ejs +61 -0
- package/templates/default/.github/workflows/attest-release-assets.yml.ejs +24 -0
- package/templates/default/.github/workflows/ci.yml.ejs +20 -0
- package/templates/default/.github/workflows/ci.yml@steps_biome-linter.ejs +1 -0
- package/templates/default/.github/workflows/ci.yml@steps_cspell.ejs +1 -0
- package/templates/default/.github/workflows/ci.yml@steps_dprint.ejs +1 -0
- package/templates/default/.github/workflows/ci.yml@steps_eslint.ejs +1 -0
- package/templates/default/.github/workflows/ci.yml@steps_jest.ejs +1 -0
- package/templates/default/.github/workflows/ci.yml@steps_markdownlint.ejs +1 -0
- package/templates/default/.github/workflows/ci.yml@steps_prettier.ejs +1 -0
- package/templates/default/.github/workflows/ci.yml@steps_vitest.ejs +1 -0
- package/templates/default/.github/workflows/release.yml.ejs +27 -0
- package/templates/default/.github/workflows/update-license-year.yml.ejs +38 -0
- package/templates/default/.gitignore_common.ejs +27 -0
- package/templates/default/.gitignore_scss.ejs +1 -0
- package/templates/default/.gitignore_tailwind.ejs +3 -0
- package/templates/default/.husky/commit-msg.ejs +1 -0
- package/templates/default/.husky/pre-commit.ejs +1 -0
- package/templates/default/.markdownlint-cli2.mjs.ejs +4 -0
- package/templates/default/.nano-staged.mjs.ejs +5 -0
- package/templates/default/.npmrc.ejs +1 -0
- package/templates/default/.parcelrc.ejs +9 -0
- package/templates/default/.parcelrc@transformers_svelte.ejs +1 -0
- package/templates/default/.prettierignore.ejs +10 -0
- package/templates/default/.typesafe-i18n.json.ejs +5 -0
- package/templates/default/CONTRIBUTING.md.ejs +49 -0
- package/templates/default/CONTRIBUTING.md@demo-vault_dev-utils.ejs +15 -0
- package/templates/default/CONTRIBUTING.md@scripts_biome-formatter.ejs +1 -0
- package/templates/default/CONTRIBUTING.md@scripts_biome-linter.ejs +1 -0
- package/templates/default/CONTRIBUTING.md@scripts_conventional-commits.ejs +1 -0
- package/templates/default/CONTRIBUTING.md@scripts_cspell.ejs +1 -0
- package/templates/default/CONTRIBUTING.md@scripts_dev-utils.ejs +1 -0
- package/templates/default/CONTRIBUTING.md@scripts_dprint.ejs +1 -0
- package/templates/default/CONTRIBUTING.md@scripts_eslint.ejs +1 -0
- package/templates/default/CONTRIBUTING.md@scripts_jest.ejs +1 -0
- package/templates/default/CONTRIBUTING.md@scripts_markdownlint.ejs +1 -0
- package/templates/default/CONTRIBUTING.md@scripts_prettier.ejs +1 -0
- package/templates/default/CONTRIBUTING.md@scripts_vitest.ejs +1 -0
- package/templates/default/LICENSE.ejs +21 -0
- package/templates/default/README.md.ejs +28 -0
- package/templates/default/README.md@demo-vault_dev-utils.ejs +12 -0
- package/templates/default/README.md@preset_dev-utils.ejs +12 -0
- package/templates/default/README.md@support_has-funding.ejs +8 -0
- package/templates/default/babel.config.json.ejs +8 -0
- package/templates/default/babel.config.mjs.ejs +5 -0
- package/templates/default/biome.jsonc.ejs +47 -0
- package/templates/default/commitlint.config.ts.ejs +1 -0
- package/templates/default/cspell.json.ejs +67 -0
- package/templates/default/demo-vault/.gitignore.ejs +15 -0
- package/templates/default/demo-vault/.obsidian/app.json.ejs +4 -0
- package/templates/default/demo-vault/.obsidian/community-plugins.json.ejs +4 -0
- package/templates/default/demo-vault/00 Start.md.ejs +32 -0
- package/templates/default/demo-vault/00 Start.md@features_wasm.ejs +1 -0
- package/templates/default/demo-vault/01 Sample commands.md.ejs +38 -0
- package/templates/default/demo-vault/01 Sample commands.md@commands_wasm.ejs +4 -0
- package/templates/default/demo-vault/02 Settings.md.ejs +40 -0
- package/templates/default/demo-vault/03 WebAssembly.md.ejs +34 -0
- package/templates/default/demo-vault/Materials/01 Sample commands/Scratch note.md.ejs +5 -0
- package/templates/default/demo-vault/README.md.ejs +10 -0
- package/templates/default/demo-vault/_assets/CodeScriptToolkit/demoSetup.ts.ejs +88 -0
- package/templates/default/demo-vault/_assets/CodeScriptToolkit/demoSetup.ts@commands_wasm.ejs +10 -0
- package/templates/default/demo-vault/_assets/CodeScriptToolkit/startup.ts.ejs +17 -0
- package/templates/default/dprint.json_dev-utils.ejs +10 -0
- package/templates/default/dprint.json_standalone.ejs +26 -0
- package/templates/default/e2e/sample.spec.ts_obsidian-test.ejs +16 -0
- package/templates/default/e2e/sample.spec.ts_obsidian-test@lint-no-void-disable_dev-utils.ejs +3 -0
- package/templates/default/e2e/sample.spec.ts_obsidian-test@lint-no-void-enable_dev-utils.ejs +1 -0
- package/templates/default/e2e/sample.spec.ts_obsidian-test@unofficial_with-unofficial.ejs +13 -0
- package/templates/default/e2e/sample.spec.ts_wdio-obsidian.ejs +7 -0
- package/templates/default/e2e/sample.spec.ts_wdio-obsidian@unofficial_with-unofficial.ejs +15 -0
- package/templates/default/eslint.config.mts_dev-utils.ejs +1 -0
- package/templates/default/eslint.config.mts_standalone.ejs +119 -0
- package/templates/default/eslint.config.mts_standalone@extra-files_has-e2e.ejs +2 -0
- package/templates/default/jest.config.ts.ejs +57 -0
- package/templates/default/jest.config.ts@lint-root-dir_dev-utils.ejs +1 -0
- package/templates/default/jest.config.ts@ts-jest-tsconfig_solid.ejs +8 -0
- package/templates/default/linkinator.config.json.ejs +11 -0
- package/templates/default/manifest.json.ejs +11 -0
- package/templates/default/manifest.json@funding_has-funding.ejs +1 -0
- package/templates/default/manifest.json@platform_desktop-and-mobile.ejs +1 -0
- package/templates/default/manifest.json@platform_desktop-only.ejs +1 -0
- package/templates/default/package.json.ejs +32 -0
- package/templates/default/package.json@targets_parcel.ejs +36 -0
- package/templates/default/parcel-namer-obsidian.cjs.ejs +26 -0
- package/templates/default/parcel-resolver-obsidian.cjs.ejs +37 -0
- package/templates/default/parcel-transformer-inline-imports.cjs.ejs +39 -0
- package/templates/default/parcel-transformer-svelte.cjs.ejs +67 -0
- package/templates/default/pinned-versions.json.ejs +1 -0
- package/templates/default/pnpm-workspace.yaml.ejs +19 -0
- package/templates/default/postcss.config.cjs.ejs +12 -0
- package/templates/default/prettier.config.mjs.ejs +5 -0
- package/templates/default/rollup.config.mjs.ejs +7 -0
- package/templates/default/scripts/babel.config.ts_rollup.ejs +16 -0
- package/templates/default/scripts/babel.config.ts_rollup@babel-plugin_preact.ejs +1 -0
- package/templates/default/scripts/babel.config.ts_rollup@babel-preset_react.ejs +1 -0
- package/templates/default/scripts/babel.config.ts_rollup@babel-preset_solid.ejs +1 -0
- package/templates/default/scripts/build-clean.ts.ejs +4 -0
- package/templates/default/scripts/build-compile.ts.ejs +4 -0
- package/templates/default/scripts/build-styles.ts.ejs +12 -0
- package/templates/default/scripts/build.ts.ejs +6 -0
- package/templates/default/scripts/build.ts@bundler_cli-bundler.ejs +63 -0
- package/templates/default/scripts/build.ts@bundler_cli-bundler@compile_svelte.ejs +4 -0
- package/templates/default/scripts/build.ts@bundler_cli-bundler@fs-import_hot-reload-plugin.ejs +2 -0
- package/templates/default/scripts/build.ts@bundler_cli-bundler@hot-reload_hot-reload-plugin.ejs +3 -0
- package/templates/default/scripts/build.ts@bundler_cli-bundler@import_tailwind.ejs +2 -0
- package/templates/default/scripts/build.ts@bundler_cli-bundler@lint-build-styles_dev-utils.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_cli-bundler@reload_obsidian-cli.ejs +5 -0
- package/templates/default/scripts/build.ts@bundler_cli-bundler@run_parcel.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_cli-bundler@run_rollup.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_cli-bundler@run_vite.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_cli-bundler@run_webpack.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_esbuild.ejs +3 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@compile_svelte.ejs +4 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@dev-utils-pre-build_tailwind.ejs +2 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@fs-import_hot-reload-plugin.ejs +2 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@hot-reload_hot-reload-plugin.ejs +4 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@import_postcss.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@import_scss.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@import_solid.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@import_svelte.ejs +10 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@import_tailwind.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@import_vue.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@lint-build-styles_dev-utils.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@options_preact.ejs +2 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@options_react.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@options_wasm.ejs +5 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@plugin_postcss.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@plugin_scss.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@plugin_solid.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@plugin_svelte.ejs +5 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@plugin_vue.ejs +1 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@preset_dev-utils.ejs +7 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@preset_standalone.ejs +138 -0
- package/templates/default/scripts/build.ts@bundler_esbuild@reload_obsidian-cli.ejs +6 -0
- package/templates/default/scripts/commit.ts_dev-utils.ejs +3 -0
- package/templates/default/scripts/commit.ts_standalone.ejs +3 -0
- package/templates/default/scripts/commitlint-config.ts.ejs +5 -0
- package/templates/default/scripts/demo-vault-global-setup.ts.ejs +43 -0
- package/templates/default/scripts/dev.ts.ejs +6 -0
- package/templates/default/scripts/dev.ts@bundler_cli-bundler.ejs +8 -0
- package/templates/default/scripts/dev.ts@bundler_esbuild.ejs +3 -0
- package/templates/default/scripts/dev.ts@bundler_esbuild@dev-utils-pre-build_tailwind.ejs +2 -0
- package/templates/default/scripts/dev.ts@bundler_esbuild@lint-build-styles_dev-utils.ejs +1 -0
- package/templates/default/scripts/dev.ts@bundler_esbuild@preset_dev-utils.ejs +7 -0
- package/templates/default/scripts/dev.ts@bundler_esbuild@preset_standalone.ejs +3 -0
- package/templates/default/scripts/esbuild-plugins.ts.ejs +20 -0
- package/templates/default/scripts/esbuild-plugins.ts@dev-utils-import_vue.ejs +2 -0
- package/templates/default/scripts/esbuild-plugins.ts@dev-utils-plugin_vue.ejs +1 -0
- package/templates/default/scripts/esbuild-plugins.ts@dev-utils-plugin_wasm.ejs +13 -0
- package/templates/default/scripts/eslint-config.ts.ejs +113 -0
- package/templates/default/scripts/eslint-config.ts@extra-files_has-e2e.ejs +7 -0
- package/templates/default/scripts/find-overexposed-fix.ts.ejs +26 -0
- package/templates/default/scripts/find-overexposed.ts.ejs +15 -0
- package/templates/default/scripts/format-check.ts.ejs +4 -0
- package/templates/default/scripts/format-check.ts@tool_biome-formatter.ejs +8 -0
- package/templates/default/scripts/format-check.ts@tool_dprint.ejs +3 -0
- package/templates/default/scripts/format-check.ts@tool_dprint@preset_dev-utils.ejs +7 -0
- package/templates/default/scripts/format-check.ts@tool_dprint@preset_standalone.ejs +8 -0
- package/templates/default/scripts/format-check.ts@tool_prettier.ejs +8 -0
- package/templates/default/scripts/format.ts.ejs +4 -0
- package/templates/default/scripts/format.ts@tool_biome-formatter.ejs +8 -0
- package/templates/default/scripts/format.ts@tool_dprint.ejs +3 -0
- package/templates/default/scripts/format.ts@tool_dprint@preset_dev-utils.ejs +7 -0
- package/templates/default/scripts/format.ts@tool_dprint@preset_standalone.ejs +8 -0
- package/templates/default/scripts/format.ts@tool_prettier.ejs +8 -0
- package/templates/default/scripts/framework-component-stub.ts.ejs +46 -0
- package/templates/default/scripts/gate.ts.ejs +10 -0
- package/templates/default/scripts/lint-fix.ts.ejs +6 -0
- package/templates/default/scripts/lint-fix.ts@tool_biome-linter.ejs +8 -0
- package/templates/default/scripts/lint-fix.ts@tool_eslint.ejs +3 -0
- package/templates/default/scripts/lint-fix.ts@tool_eslint@preset_dev-utils.ejs +7 -0
- package/templates/default/scripts/lint-fix.ts@tool_eslint@preset_standalone.ejs +8 -0
- package/templates/default/scripts/lint-md-fix.ts_dev-utils.ejs +7 -0
- package/templates/default/scripts/lint-md-fix.ts_standalone.ejs +37 -0
- package/templates/default/scripts/lint-md.ts_dev-utils.ejs +7 -0
- package/templates/default/scripts/lint-md.ts_standalone.ejs +37 -0
- package/templates/default/scripts/lint.ts.ejs +6 -0
- package/templates/default/scripts/lint.ts@tool_biome-linter.ejs +8 -0
- package/templates/default/scripts/lint.ts@tool_eslint.ejs +3 -0
- package/templates/default/scripts/lint.ts@tool_eslint@preset_dev-utils.ejs +7 -0
- package/templates/default/scripts/lint.ts@tool_eslint@preset_standalone.ejs +8 -0
- package/templates/default/scripts/markdownlint-cli2-config.ts_dev-utils.ejs +14 -0
- package/templates/default/scripts/markdownlint-cli2-config.ts_standalone.ejs +36 -0
- package/templates/default/scripts/nano-staged-config.ts.ejs +9 -0
- package/templates/default/scripts/postcss.config.ts.ejs +1 -0
- package/templates/default/scripts/postcss.config.ts@plugins_postcss.ejs +7 -0
- package/templates/default/scripts/prepare.ts_dev-utils.ejs +3 -0
- package/templates/default/scripts/prepare.ts_standalone.ejs +3 -0
- package/templates/default/scripts/prettier.config.ts.ejs +12 -0
- package/templates/default/scripts/rollup.config.ts.ejs +129 -0
- package/templates/default/scripts/rollup.config.ts@import_rollup-babel.ejs +5 -0
- package/templates/default/scripts/rollup.config.ts@import_rollup-json.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts@import_rollup-postcss.ejs +4 -0
- package/templates/default/scripts/rollup.config.ts@import_scss.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts@import_svelte.ejs +2 -0
- package/templates/default/scripts/rollup.config.ts@import_vue.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts@import_wasm.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts@lint-out-dir_dev-utils.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts@post-plugin_preact.ejs +4 -0
- package/templates/default/scripts/rollup.config.ts@post-plugin_react.ejs +5 -0
- package/templates/default/scripts/rollup.config.ts@post-plugin_rollup-json.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts@post-plugin_rollup-postcss.ejs +4 -0
- package/templates/default/scripts/rollup.config.ts@post-plugin_scss.ejs +4 -0
- package/templates/default/scripts/rollup.config.ts@post-plugin_solid.ejs +4 -0
- package/templates/default/scripts/rollup.config.ts@post-plugin_wasm.ejs +4 -0
- package/templates/default/scripts/rollup.config.ts@pre-plugin_svelte.ejs +4 -0
- package/templates/default/scripts/rollup.config.ts@pre-plugin_vue.ejs +13 -0
- package/templates/default/scripts/rollup.config.ts@unwrap_rollup-babel.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts@unwrap_rollup-json.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts@unwrap_rollup-postcss.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts@unwrap_scss.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts@unwrap_svelte.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts@unwrap_vue.ejs +1 -0
- package/templates/default/scripts/rollup.config.ts@unwrap_wasm.ejs +1 -0
- package/templates/default/scripts/spellcheck.ts_dev-utils.ejs +7 -0
- package/templates/default/scripts/spellcheck.ts_standalone.ejs +8 -0
- package/templates/default/scripts/stylesheet-stub.ts.ejs +17 -0
- package/templates/default/scripts/test-coverage.ts.ejs +8 -0
- package/templates/default/scripts/test-e2e.ts.ejs +1 -0
- package/templates/default/scripts/test-e2e.ts@tool_obsidian-test.ejs +8 -0
- package/templates/default/scripts/test-e2e.ts@tool_wdio-obsidian.ejs +8 -0
- package/templates/default/scripts/test-integration-android.ts.ejs +8 -0
- package/templates/default/scripts/test-integration-demo-vault.ts.ejs +8 -0
- package/templates/default/scripts/test-integration-desktop-performance.ts.ejs +8 -0
- package/templates/default/scripts/test-integration-desktop.ts.ejs +8 -0
- package/templates/default/scripts/test-integration-no-app.ts.ejs +8 -0
- package/templates/default/scripts/test-integration.ts.ejs +22 -0
- package/templates/default/scripts/test-watch.ts_dev-utils.ejs +1 -0
- package/templates/default/scripts/test-watch.ts_dev-utils@tool_jest.ejs +13 -0
- package/templates/default/scripts/test-watch.ts_dev-utils@tool_vitest.ejs +8 -0
- package/templates/default/scripts/test-watch.ts_standalone.ejs +1 -0
- package/templates/default/scripts/test-watch.ts_standalone@tool_jest.ejs +13 -0
- package/templates/default/scripts/test-watch.ts_standalone@tool_vitest.ejs +8 -0
- package/templates/default/scripts/test.ts_dev-utils.ejs +1 -0
- package/templates/default/scripts/test.ts_dev-utils@tool_jest.ejs +13 -0
- package/templates/default/scripts/test.ts_dev-utils@tool_vitest.ejs +8 -0
- package/templates/default/scripts/test.ts_standalone.ejs +1 -0
- package/templates/default/scripts/test.ts_standalone@tool_jest.ejs +13 -0
- package/templates/default/scripts/test.ts_standalone@tool_vitest.ejs +8 -0
- package/templates/default/scripts/version.ts_dev-utils.ejs +10 -0
- package/templates/default/scripts/version.ts_standalone.ejs +317 -0
- package/templates/default/scripts/vite.config.ts.ejs +76 -0
- package/templates/default/scripts/vite.config.ts@import_preact.ejs +1 -0
- package/templates/default/scripts/vite.config.ts@import_react.ejs +1 -0
- package/templates/default/scripts/vite.config.ts@import_solid.ejs +1 -0
- package/templates/default/scripts/vite.config.ts@import_svelte.ejs +1 -0
- package/templates/default/scripts/vite.config.ts@import_vue.ejs +1 -0
- package/templates/default/scripts/vite.config.ts@lint-empty-out-dir_dev-utils.ejs +1 -0
- package/templates/default/scripts/vite.config.ts@lint-out-dir_dev-utils.ejs +1 -0
- package/templates/default/scripts/vite.config.ts@plugin_preact.ejs +1 -0
- package/templates/default/scripts/vite.config.ts@plugin_react.ejs +1 -0
- package/templates/default/scripts/vite.config.ts@plugin_solid.ejs +1 -0
- package/templates/default/scripts/vite.config.ts@plugin_svelte.ejs +1 -0
- package/templates/default/scripts/vite.config.ts@plugin_vue.ejs +1 -0
- package/templates/default/scripts/vitest-config.ts.ejs +75 -0
- package/templates/default/scripts/vitest-config.ts@post-config_solid.ejs +67 -0
- package/templates/default/scripts/wasm-module-stub.ts.ejs +21 -0
- package/templates/default/scripts/webpack.config.ts.ejs +124 -0
- package/templates/default/scripts/webpack.config.ts@import_svelte.ejs +1 -0
- package/templates/default/scripts/webpack.config.ts@import_vue.ejs +1 -0
- package/templates/default/scripts/webpack.config.ts@import_webpack-css-extract.ejs +4 -0
- package/templates/default/scripts/webpack.config.ts@lint-webpack-default_dev-utils.ejs +1 -0
- package/templates/default/scripts/webpack.config.ts@plugin_vue.ejs +1 -0
- package/templates/default/scripts/webpack.config.ts@plugin_webpack-css-extract.ejs +4 -0
- package/templates/default/scripts/webpack.config.ts@rule_css-modules.ejs +7 -0
- package/templates/default/scripts/webpack.config.ts@rule_css.ejs +4 -0
- package/templates/default/scripts/webpack.config.ts@rule_postcss.ejs +4 -0
- package/templates/default/scripts/webpack.config.ts@rule_scss.ejs +4 -0
- package/templates/default/scripts/webpack.config.ts@rule_solid.ejs +17 -0
- package/templates/default/scripts/webpack.config.ts@rule_svelte.ejs +7 -0
- package/templates/default/scripts/webpack.config.ts@rule_tailwind.ejs +4 -0
- package/templates/default/scripts/webpack.config.ts@rule_vue.ejs +4 -0
- package/templates/default/scripts/webpack.config.ts@rule_wasm.ejs +8 -0
- package/templates/default/scripts/webpack.config.ts@ts-loader-compiler-options_vue.ejs +5 -0
- package/templates/default/scripts/webpack.config.ts@ts-loader-options_vue.ejs +5 -0
- package/templates/default/src/demo-vault-buttons.demo-vault.integration.test.ts.ejs +12 -0
- package/templates/default/src/demo-vault.no-app.integration.test.ts.ejs +18 -0
- package/templates/default/src/editor-extensions/sample-state-field.ts_dev-utils.ejs +56 -0
- package/templates/default/src/editor-extensions/sample-state-field.ts_standalone.ejs +60 -0
- package/templates/default/src/editor-extensions/sample-view-plugin.ts.ejs +66 -0
- package/templates/default/src/editor-extensions/sample-widget.ts.ejs +22 -0
- package/templates/default/src/editor-suggests/sample-editor-suggest.ts.ejs +42 -0
- package/templates/default/src/i18n/en/index.ts.ejs +10 -0
- package/templates/default/src/i18n/index.ts_i18next.ejs +21 -0
- package/templates/default/src/i18n/index.ts_typesafe-i18n.ejs +14 -0
- package/templates/default/src/i18n/locales/en.json.ejs +3 -0
- package/templates/default/src/lit-elements/sample-lit-element.ts.ejs +54 -0
- package/templates/default/src/main.test.ts.ejs +11 -0
- package/templates/default/src/main.test.ts@test-imports_vitest.ejs +6 -0
- package/templates/default/src/main.ts.ejs +4 -0
- package/templates/default/src/main.ts@import_css-modules.ejs +1 -0
- package/templates/default/src/main.ts@import_css.ejs +1 -0
- package/templates/default/src/main.ts@import_postcss.ejs +1 -0
- package/templates/default/src/main.ts@import_scss.ejs +1 -0
- package/templates/default/src/main.ts@import_tailwind.ejs +1 -0
- package/templates/default/src/modals/sample-form-modal.ts.ejs +35 -0
- package/templates/default/src/modals/sample-suggest-modal.ts.ejs +37 -0
- package/templates/default/src/plugin-settings-component.test.ts_demo.ejs +49 -0
- package/templates/default/src/plugin-settings-component.test.ts_demo@test-imports_vitest.ejs +5 -0
- package/templates/default/src/plugin-settings-component.test.ts_enhanced.ejs +41 -0
- package/templates/default/src/plugin-settings-component.test.ts_enhanced@test-imports_vitest.ejs +5 -0
- package/templates/default/src/plugin-settings-component.ts_demo.ejs +87 -0
- package/templates/default/src/plugin-settings-component.ts_enhanced.ejs +27 -0
- package/templates/default/src/plugin-settings-tab.ts_demo.ejs +286 -0
- package/templates/default/src/plugin-settings-tab.ts_enhanced.ejs +26 -0
- package/templates/default/src/plugin-settings.test.ts_demo.ejs +14 -0
- package/templates/default/src/plugin-settings.test.ts_demo@test-imports_vitest.ejs +6 -0
- package/templates/default/src/plugin-settings.ts_demo.ejs +64 -0
- package/templates/default/src/plugin-settings.ts_enhanced.ejs +3 -0
- package/templates/default/src/plugin.test.ts_jest.ejs +9 -0
- package/templates/default/src/plugin.test.ts_vitest.ejs +14 -0
- package/templates/default/src/plugin.ts_demo.ejs +316 -0
- package/templates/default/src/plugin.ts_demo@import_i18next.ejs +1 -0
- package/templates/default/src/plugin.ts_demo@import_lit.ejs +4 -0
- package/templates/default/src/plugin.ts_demo@import_preact.ejs +4 -0
- package/templates/default/src/plugin.ts_demo@import_react.ejs +4 -0
- package/templates/default/src/plugin.ts_demo@import_solid.ejs +4 -0
- package/templates/default/src/plugin.ts_demo@import_svelte.ejs +4 -0
- package/templates/default/src/plugin.ts_demo@import_typesafe-i18n.ejs +1 -0
- package/templates/default/src/plugin.ts_demo@import_vue.ejs +4 -0
- package/templates/default/src/plugin.ts_demo@import_wasm.ejs +1 -0
- package/templates/default/src/plugin.ts_demo@method_ui-view.ejs +7 -0
- package/templates/default/src/plugin.ts_demo@onload_i18next.ejs +2 -0
- package/templates/default/src/plugin.ts_demo@onload_lit.ejs +4 -0
- package/templates/default/src/plugin.ts_demo@onload_preact.ejs +4 -0
- package/templates/default/src/plugin.ts_demo@onload_react.ejs +4 -0
- package/templates/default/src/plugin.ts_demo@onload_solid.ejs +4 -0
- package/templates/default/src/plugin.ts_demo@onload_svelte.ejs +4 -0
- package/templates/default/src/plugin.ts_demo@onload_typesafe-i18n.ejs +8 -0
- package/templates/default/src/plugin.ts_demo@onload_vue.ejs +4 -0
- package/templates/default/src/plugin.ts_demo@onload_wasm.ejs +2 -0
- package/templates/default/src/plugin.ts_enhanced.ejs +72 -0
- package/templates/default/src/plugin.ts_enhanced@import2_codemirror.ejs +3 -0
- package/templates/default/src/plugin.ts_enhanced@import2_i18next.ejs +2 -0
- package/templates/default/src/plugin.ts_enhanced@import2_lit.ejs +4 -0
- package/templates/default/src/plugin.ts_enhanced@import2_preact.ejs +4 -0
- package/templates/default/src/plugin.ts_enhanced@import2_react.ejs +4 -0
- package/templates/default/src/plugin.ts_enhanced@import2_solid.ejs +4 -0
- package/templates/default/src/plugin.ts_enhanced@import2_svelte.ejs +4 -0
- package/templates/default/src/plugin.ts_enhanced@import2_typesafe-i18n.ejs +2 -0
- package/templates/default/src/plugin.ts_enhanced@import2_vue.ejs +4 -0
- package/templates/default/src/plugin.ts_enhanced@import2_wasm.ejs +1 -0
- package/templates/default/src/plugin.ts_enhanced@method_ui-view.ejs +7 -0
- package/templates/default/src/plugin.ts_enhanced@onload_codemirror.ejs +4 -0
- package/templates/default/src/plugin.ts_enhanced@onload_i18next.ejs +2 -0
- package/templates/default/src/plugin.ts_enhanced@onload_lit.ejs +4 -0
- package/templates/default/src/plugin.ts_enhanced@onload_preact.ejs +4 -0
- package/templates/default/src/plugin.ts_enhanced@onload_react.ejs +4 -0
- package/templates/default/src/plugin.ts_enhanced@onload_solid.ejs +4 -0
- package/templates/default/src/plugin.ts_enhanced@onload_svelte.ejs +4 -0
- package/templates/default/src/plugin.ts_enhanced@onload_typesafe-i18n.ejs +8 -0
- package/templates/default/src/plugin.ts_enhanced@onload_vue.ejs +4 -0
- package/templates/default/src/plugin.ts_enhanced@onload_wasm.ejs +2 -0
- package/templates/default/src/plugin.ts_standalone.ejs +56 -0
- package/templates/default/src/plugin.ts_standalone@import_codemirror.ejs +3 -0
- package/templates/default/src/plugin.ts_standalone@import_i18next.ejs +1 -0
- package/templates/default/src/plugin.ts_standalone@import_lit.ejs +4 -0
- package/templates/default/src/plugin.ts_standalone@import_preact.ejs +4 -0
- package/templates/default/src/plugin.ts_standalone@import_react.ejs +4 -0
- package/templates/default/src/plugin.ts_standalone@import_solid.ejs +4 -0
- package/templates/default/src/plugin.ts_standalone@import_svelte.ejs +4 -0
- package/templates/default/src/plugin.ts_standalone@import_typesafe-i18n.ejs +1 -0
- package/templates/default/src/plugin.ts_standalone@import_vue.ejs +4 -0
- package/templates/default/src/plugin.ts_standalone@import_wasm.ejs +1 -0
- package/templates/default/src/plugin.ts_standalone@method_ui-view.ejs +7 -0
- package/templates/default/src/plugin.ts_standalone@onload_codemirror.ejs +4 -0
- package/templates/default/src/plugin.ts_standalone@onload_i18next.ejs +2 -0
- package/templates/default/src/plugin.ts_standalone@onload_lit.ejs +4 -0
- package/templates/default/src/plugin.ts_standalone@onload_preact.ejs +4 -0
- package/templates/default/src/plugin.ts_standalone@onload_react.ejs +4 -0
- package/templates/default/src/plugin.ts_standalone@onload_solid.ejs +4 -0
- package/templates/default/src/plugin.ts_standalone@onload_svelte.ejs +4 -0
- package/templates/default/src/plugin.ts_standalone@onload_typesafe-i18n.ejs +8 -0
- package/templates/default/src/plugin.ts_standalone@onload_vue.ejs +4 -0
- package/templates/default/src/plugin.ts_standalone@onload_wasm.ejs +2 -0
- package/templates/default/src/preact-components/sample-preact-component.tsx_dev-utils.ejs +47 -0
- package/templates/default/src/preact-components/sample-preact-component.tsx_standalone.ejs +47 -0
- package/templates/default/src/react-components/sample-react-component.tsx_dev-utils.ejs +35 -0
- package/templates/default/src/react-components/sample-react-component.tsx_standalone.ejs +47 -0
- package/templates/default/src/settings.ts.ejs +32 -0
- package/templates/default/src/solid-components/sample-solid-component.tsx_dev-utils.ejs +47 -0
- package/templates/default/src/solid-components/sample-solid-component.tsx_standalone.ejs +47 -0
- package/templates/default/src/styles/css-modules.d.ts.ejs +4 -0
- package/templates/default/src/styles/main.css_dev-utils.ejs +17 -0
- package/templates/default/src/styles/main.css_dev-utils@content_tailwind.ejs +1 -0
- package/templates/default/src/styles/main.css_standalone.ejs +11 -0
- package/templates/default/src/styles/main.css_standalone@content_tailwind.ejs +1 -0
- package/templates/default/src/styles/main.module.css.ejs +3 -0
- package/templates/default/src/styles/main.scss_dev-utils.ejs +16 -0
- package/templates/default/src/styles/main.scss_standalone.ejs +10 -0
- package/templates/default/src/styles/styles.d.ts.ejs +4 -0
- package/templates/default/src/svelte-components/sample-svelte-component.d.ts.ejs +7 -0
- package/templates/default/src/svelte-components/sample-svelte-component.svelte.ejs +24 -0
- package/templates/default/src/views/sample-lit-view.ts.ejs +30 -0
- package/templates/default/src/views/sample-lit-view.ts@lint-register-element_dev-utils.ejs +1 -0
- package/templates/default/src/views/sample-preact-view.tsx_dev-utils.ejs +45 -0
- package/templates/default/src/views/sample-preact-view.tsx_standalone.ejs +42 -0
- package/templates/default/src/views/sample-react-view.tsx_dev-utils.ejs +47 -0
- package/templates/default/src/views/sample-react-view.tsx_standalone.ejs +49 -0
- package/templates/default/src/views/sample-solid-view.tsx_dev-utils.ejs +46 -0
- package/templates/default/src/views/sample-solid-view.tsx_standalone.ejs +46 -0
- package/templates/default/src/views/sample-svelte-view.ts.ejs +47 -0
- package/templates/default/src/views/sample-view.ts.ejs +37 -0
- package/templates/default/src/views/sample-vue-view.ts.ejs +34 -0
- package/templates/default/src/vue-components/sample-vue-component.d.ts.ejs +6 -0
- package/templates/default/src/vue-components/sample-vue-component.vue.ejs +25 -0
- package/templates/default/src/wasm/README.md.ejs +29 -0
- package/templates/default/src/wasm/answer.ts_esbuild.ejs +23 -0
- package/templates/default/src/wasm/answer.ts_parcel.ejs +29 -0
- package/templates/default/src/wasm/answer.ts_rollup.ejs +19 -0
- package/templates/default/src/wasm/answer.ts_vite.ejs +29 -0
- package/templates/default/src/wasm/answer.ts_webpack.ejs +29 -0
- package/templates/default/src/wasm/module.wasm +0 -0
- package/templates/default/src/wasm/module.wat.ejs +12 -0
- package/templates/default/src/wasm/sample-command.ts.ejs +33 -0
- package/templates/default/src/wasm.d.ts_esbuild.ejs +12 -0
- package/templates/default/src/wasm.d.ts_parcel.ejs +7 -0
- package/templates/default/src/wasm.d.ts_rollup.ejs +8 -0
- package/templates/default/src/wasm.d.ts_vite.ejs +8 -0
- package/templates/default/src/wasm.d.ts_webpack.ejs +7 -0
- package/templates/default/tsconfig.json_dev-utils.ejs +34 -0
- package/templates/default/tsconfig.json_dev-utils@compiler-options_i18next.ejs +1 -0
- package/templates/default/tsconfig.json_dev-utils@compiler-options_lit.ejs +2 -0
- package/templates/default/tsconfig.json_dev-utils@compiler-options_preact.ejs +2 -0
- package/templates/default/tsconfig.json_dev-utils@compiler-options_react.ejs +1 -0
- package/templates/default/tsconfig.json_dev-utils@compiler-options_solid.ejs +2 -0
- package/templates/default/tsconfig.json_dev-utils@include_has-e2e.ejs +1 -0
- package/templates/default/tsconfig.json_dev-utils@include_svelte.ejs +1 -0
- package/templates/default/tsconfig.json_dev-utils@include_vue.ejs +1 -0
- package/templates/default/tsconfig.json_dev-utils@types_jest.ejs +2 -0
- package/templates/default/tsconfig.json_dev-utils@types_svelte.ejs +2 -0
- package/templates/default/tsconfig.json_dev-utils@types_wdio-obsidian.ejs +5 -0
- package/templates/default/tsconfig.json_dev-utils@types_with-unofficial.ejs +2 -0
- package/templates/default/tsconfig.json_standalone.ejs +47 -0
- package/templates/default/tsconfig.json_standalone@compiler-options_i18next.ejs +1 -0
- package/templates/default/tsconfig.json_standalone@compiler-options_lit.ejs +2 -0
- package/templates/default/tsconfig.json_standalone@compiler-options_preact.ejs +2 -0
- package/templates/default/tsconfig.json_standalone@compiler-options_react.ejs +1 -0
- package/templates/default/tsconfig.json_standalone@compiler-options_solid.ejs +2 -0
- package/templates/default/tsconfig.json_standalone@include-extra_preact.ejs +2 -0
- package/templates/default/tsconfig.json_standalone@include-extra_react.ejs +2 -0
- package/templates/default/tsconfig.json_standalone@include-extra_solid.ejs +2 -0
- package/templates/default/tsconfig.json_standalone@include_has-e2e.ejs +1 -0
- package/templates/default/tsconfig.json_standalone@include_svelte.ejs +1 -0
- package/templates/default/tsconfig.json_standalone@include_vue.ejs +1 -0
- package/templates/default/tsconfig.json_standalone@types_jest.ejs +2 -0
- package/templates/default/tsconfig.json_standalone@types_svelte.ejs +2 -0
- package/templates/default/tsconfig.json_standalone@types_wdio-obsidian.ejs +5 -0
- package/templates/default/tsconfig.json_standalone@types_with-unofficial.ejs +2 -0
- package/templates/default/versions.json.ejs +3 -0
- package/templates/default/vite.config.ts.ejs +3 -0
- package/templates/default/vitest.config.ts_dev-utils.ejs +1 -0
- package/templates/default/vitest.config.ts_standalone.ejs +55 -0
- package/templates/default/vitest.config.ts_standalone@jsx_solid.ejs +11 -0
- package/templates/default/wdio.conf.ts.ejs +21 -0
- package/templates/default/webpack.config.ts.ejs +3 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Config } from 'jest';
|
|
2
|
+
|
|
3
|
+
const config: Config = {
|
|
4
|
+
// The project is `"type": "module"` and the tsconfig is `module: node16`, so ts-jest emits ESM. Jest
|
|
5
|
+
// treats `.ts` as CommonJS unless told otherwise, and then fails to `require` that output.
|
|
6
|
+
extensionsToTreatAsEsm: ['.ts'],
|
|
7
|
+
moduleNameMapper: {
|
|
8
|
+
// `src/main.ts` imports the stylesheet for its side effect, and jest would parse it as JavaScript.
|
|
9
|
+
'\\.(css|scss)$': '<rootDir>/scripts/stylesheet-stub.ts',
|
|
10
|
+
// Compiling a single-file component is the bundler's job, not the unit runner's -- and the plugin
|
|
11
|
+
// That does it is only a dependency when the matching bundler was chosen. A unit test that reaches
|
|
12
|
+
// One through the plugin's module graph gets this stub instead, so the graph loads.
|
|
13
|
+
'\\.(svelte|vue)$': '<rootDir>/scripts/framework-component-stub.ts',
|
|
14
|
+
// Same decision for WebAssembly, and the same reason: loading a `.wasm` is the bundler's job. Two
|
|
15
|
+
// Patterns because two bundlers do not write the import plainly -- vite asks for the asset's URL
|
|
16
|
+
// (`./module.wasm?url`) and parcel uses a scheme (`data-url:./module.wasm`).
|
|
17
|
+
'\\.wasm(\\?.*)?$': '<rootDir>/scripts/wasm-module-stub.ts',
|
|
18
|
+
'^data-url:': '<rootDir>/scripts/wasm-module-stub.ts',
|
|
19
|
+
// The `obsidian` npm package is types-only: `"main": ""`, and a published tarball carrying nothing
|
|
20
|
+
// But `.d.ts` files. There is no module for jest to resolve at runtime, so without this every test
|
|
21
|
+
// That touches the plugin's own code dies in the resolver with "Cannot find module 'obsidian'".
|
|
22
|
+
// A `jest.mock('obsidian')` in a setup file cannot stand in for it: it has the same nothing to
|
|
23
|
+
// Resolve.
|
|
24
|
+
'^obsidian$': 'obsidian-test-mocks/obsidian',
|
|
25
|
+
// Svelte reaches its own runtime through Node subpath imports (`#client/constants`), and jest's ESM
|
|
26
|
+
// Resolver hands back the types entry for those -- so any suite that loads `svelte` dies on "does not
|
|
27
|
+
// Provide an export named 'COMMENT_NODE'" before it can run. The whole package therefore goes to the
|
|
28
|
+
// Stub too, which exports the `mount` / `unmount` the generated view uses. Vitest resolves the subpath
|
|
29
|
+
// Imports correctly and needs none of this.
|
|
30
|
+
'^svelte$': '<rootDir>/scripts/framework-component-stub.ts'
|
|
31
|
+
},
|
|
32
|
+
roots: ['<rootDir>/src'],
|
|
33
|
+
setupFiles: [
|
|
34
|
+
'obsidian-test-mocks/jest-setup'
|
|
35
|
+
],
|
|
36
|
+
// `obsidian-test-mocks`' `setup()` writes to `Document.prototype`, `Element.prototype` and `window`,
|
|
37
|
+
// None of which exist in jest's default `node` environment.
|
|
38
|
+
testEnvironment: 'jsdom',
|
|
39
|
+
testMatch: ['**/*.test.ts'],
|
|
40
|
+
transform: {
|
|
41
|
+
// Replaces `preset: 'ts-jest'`, which is transform-only and leaves nowhere to put these options.
|
|
42
|
+
// `rootDir` is here rather than in `tsconfig.json` because that file declares `noEmit: true` and is
|
|
43
|
+
// also read by the bundler scripts, while ts-jest compiles WITH emit and so raises TS5011 on an
|
|
44
|
+
// inferred common source directory. `.` not `./src`: the tsconfig's `include` also covers `./*.ts`
|
|
45
|
+
// and `./scripts/**/*.ts`. The object is merged over the tsconfig, not substituted for it.
|
|
46
|
+
'^.+\\.tsx?$': ['ts-jest', {
|
|
47
|
+
tsconfig: {
|
|
48
|
+
<%- render('ts-jest-tsconfig') -%>
|
|
49
|
+
<%- render('lint-root-dir') -%>
|
|
50
|
+
rootDir: '.'
|
|
51
|
+
},
|
|
52
|
+
useESM: true
|
|
53
|
+
}]
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default config;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// eslint-disable-next-line unicorn/name-replacements -- `rootDir` is TypeScript's own compiler-option name.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Solid compiles its JSX with `babel-preset-solid`, so the project's own tsconfig sets
|
|
2
|
+
// `jsx: 'preserve'` and leaves the JSX in place for the bundler. ts-jest has no babel step, so
|
|
3
|
+
// Preserved JSX reaches jest as `SyntaxError: Unexpected token '<'`. The automatic runtime is
|
|
4
|
+
// What ts-jest can emit on its own, and `solid-js/h` is the entry point that has one -- plain
|
|
5
|
+
// `solid-js` publishes no `jsx-runtime`. Reactivity is not compiled in, which unit tests do not
|
|
6
|
+
// Need; rendering a Solid component is an integration-test job.
|
|
7
|
+
jsx: 'react-jsx',
|
|
8
|
+
jsxImportSource: 'solid-js/h',
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"comment": [
|
|
3
|
+
"Read automatically by linkinator, which the `lint:md` script runs from the project root over every Markdown file.",
|
|
4
|
+
"The links to this plugin's own GitHub repository are skipped: the scaffold wrote them from the project's answers,",
|
|
5
|
+
"and they return 404 until the repository is created and pushed and its first release is cut, which would leave a",
|
|
6
|
+
"fresh project failing its own `lint:md` for a reason nothing local can fix. Every other link is still checked."
|
|
7
|
+
],
|
|
8
|
+
"skip": [
|
|
9
|
+
<%- JSON.stringify(_ownRepoLinkPattern) %>
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": <%- JSON.stringify(authorGitHubName) %>,
|
|
3
|
+
"authorUrl": <%- JSON.stringify(`https://github.com/${authorGitHubName}/`) %>,
|
|
4
|
+
"description": <%- JSON.stringify(pluginDescription) %>,
|
|
5
|
+
<%- render('funding') -%>
|
|
6
|
+
"id": <%- JSON.stringify(pluginId) %>,
|
|
7
|
+
<%- render('platform') -%>
|
|
8
|
+
"minAppVersion": <%- JSON.stringify(_minAppVersion) %>,
|
|
9
|
+
"name": <%- JSON.stringify(pluginName) %>,
|
|
10
|
+
"version": "0.0.0"
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"fundingUrl": <%- JSON.stringify(fundingUrl) %>,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"isDesktopOnly": false,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"isDesktopOnly": true,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": <%- JSON.stringify(pluginId) %>,
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": <%- JSON.stringify(pluginDescription) %>,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "main.js",
|
|
7
|
+
<%- render('targets') -%>
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"author": <%- JSON.stringify(authorGitHubName) %>,
|
|
11
|
+
"scripts": {
|
|
12
|
+
<% const scriptEntries = Object.entries(_scripts); -%>
|
|
13
|
+
<% scriptEntries.forEach(([key, value], i) => { -%>
|
|
14
|
+
<%- JSON.stringify(key) %>: <%- JSON.stringify(value) %><%= i < scriptEntries.length - 1 ? ',' : '' %>
|
|
15
|
+
<% }); -%>
|
|
16
|
+
},
|
|
17
|
+
"overrides": {
|
|
18
|
+
<% _overrides.forEach((override, i) => { -%>
|
|
19
|
+
<%- JSON.stringify(override.packageName) %>: <%- JSON.stringify(override.spec) %><%= i < _overrides.length - 1 ? ',' : '' %>
|
|
20
|
+
<% }); -%>
|
|
21
|
+
},
|
|
22
|
+
"resolutions": {
|
|
23
|
+
<% _resolutions.forEach((resolution, i) => { -%>
|
|
24
|
+
<%- JSON.stringify(resolution.packageName) %>: <%- JSON.stringify(resolution.spec) %><%= i < _resolutions.length - 1 ? ',' : '' %>
|
|
25
|
+
<% }); -%>
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
<% _dependencies.forEach((dep, i) => { -%>
|
|
29
|
+
<%- JSON.stringify(dep.packageName) %>: <%- JSON.stringify(dep.version) %><%= i < _dependencies.length - 1 ? ',' : '' %>
|
|
30
|
+
<% }); -%>
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<%#
|
|
2
|
+
Parcel alone needs a declared target, for two reasons that both bite silently.
|
|
3
|
+
|
|
4
|
+
`"main": "main.js"` above is a Parcel TARGET as far as Parcel is concerned, with a dist directory of
|
|
5
|
+
`.` -- so `parcel build --dist-dir dist/build` wrote the bundle to the project root instead and left
|
|
6
|
+
`dist/build` holding nothing but `manifest.json`. Disabling that target is what lets `--dist-dir` apply.
|
|
7
|
+
|
|
8
|
+
The replacement target is `electron-renderer`, which is where Obsidian runs a plugin, and CommonJS.
|
|
9
|
+
Parcel counts that context as BOTH a browser and a node one, and each half is load-bearing:
|
|
10
|
+
|
|
11
|
+
- node: builtins stay external, and the resolver may exclude `obsidian` and CodeMirror, which the app
|
|
12
|
+
supplies at runtime. A plain browser target refuses outright to leave any module external.
|
|
13
|
+
- browser: package `exports` resolve the `browser` condition. A plain `node` context resolves `node`,
|
|
14
|
+
which is Solid's and Svelte's SERVER build -- a view whose `render` / `mount` never mounts anything.
|
|
15
|
+
|
|
16
|
+
`includeNodeModules` is what bundles the dependencies at all. A node-flavoured context defaults it to
|
|
17
|
+
false, which left every package a `require()` in `main.js` that nothing installs beside a plugin -- a
|
|
18
|
+
build that exited 0 and a plugin that failed to load.
|
|
19
|
+
|
|
20
|
+
`packageExports` makes the resolver read package `exports`. Without it, a subpath such as
|
|
21
|
+
`svelte/internal/client` does not resolve once the package is bundled rather than required.
|
|
22
|
+
-%>
|
|
23
|
+
"targets": {
|
|
24
|
+
"main": false,
|
|
25
|
+
"obsidianPlugin": {
|
|
26
|
+
"context": "electron-renderer",
|
|
27
|
+
"includeNodeModules": true,
|
|
28
|
+
"isLibrary": false,
|
|
29
|
+
"optimize": true,
|
|
30
|
+
"outputFormat": "commonjs",
|
|
31
|
+
"sourceMap": false
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"@parcel/resolver-default": {
|
|
35
|
+
"packageExports": true
|
|
36
|
+
},
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Names the emitted stylesheet `styles.css`.
|
|
3
|
+
*
|
|
4
|
+
* Obsidian loads a plugin's stylesheet from `styles.css` and nothing else. Parcel does not
|
|
5
|
+
* content-hash an entry bundle, so `src/main.ts` becomes `main.js` -- but the CSS it pulls in is a
|
|
6
|
+
* SIBLING bundle, and siblings are hashed, so the stylesheet came out as `main.<hash>.css`: shipped
|
|
7
|
+
* with every build, and read by nothing.
|
|
8
|
+
*
|
|
9
|
+
* Every other bundler takes an output name as an option -- `MiniCssExtractPlugin({ filename })`,
|
|
10
|
+
* `postcss({ extract })`, `build.lib.cssFileName`. Parcel takes a namer, so this is that option, for
|
|
11
|
+
* the same reason `parcel-resolver-obsidian.cjs` is Parcel's `external` list.
|
|
12
|
+
*
|
|
13
|
+
* Returning `null` for everything else defers to the default namer, so the JavaScript entry keeps the
|
|
14
|
+
* `main.js` it already had.
|
|
15
|
+
*
|
|
16
|
+
* CommonJS on purpose, as with the resolver beside it. The project is `"type": "module"`, so a `.mjs`
|
|
17
|
+
* plugin makes Parcel warn "ES module dependencies are experimental" on every single build.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const { Namer } = require('@parcel/plugin');
|
|
21
|
+
|
|
22
|
+
module.exports = new Namer({
|
|
23
|
+
name({ bundle }) {
|
|
24
|
+
return bundle.type === 'css' ? 'styles.css' : null;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Marks the modules Obsidian supplies at runtime as external.
|
|
3
|
+
*
|
|
4
|
+
* Parcel's default resolver refuses to treat a package as external unless it is declared in
|
|
5
|
+
* `dependencies`, and an Obsidian plugin must not declare `obsidian` there: the app provides it, and
|
|
6
|
+
* bundling a second copy of the API breaks `instanceof` against the running one. Every other bundler
|
|
7
|
+
* takes an `external` list; Parcel takes a resolver, so this is that list.
|
|
8
|
+
*
|
|
9
|
+
* CommonJS on purpose. The project is `"type": "module"`, so a `.mjs` plugin makes Parcel warn "ES
|
|
10
|
+
* module dependencies are experimental" on every single build.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const { Resolver } = require('@parcel/plugin');
|
|
14
|
+
|
|
15
|
+
const EXTERNAL = new Set([
|
|
16
|
+
'@codemirror/autocomplete',
|
|
17
|
+
'@codemirror/collab',
|
|
18
|
+
'@codemirror/commands',
|
|
19
|
+
'@codemirror/language',
|
|
20
|
+
'@codemirror/lint',
|
|
21
|
+
'@codemirror/search',
|
|
22
|
+
'@codemirror/state',
|
|
23
|
+
'@codemirror/view',
|
|
24
|
+
'@lezer/common',
|
|
25
|
+
'@lezer/highlight',
|
|
26
|
+
'@lezer/lr',
|
|
27
|
+
'electron',
|
|
28
|
+
'esbuild',
|
|
29
|
+
'eslint',
|
|
30
|
+
'obsidian'
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
module.exports = new Resolver({
|
|
34
|
+
resolve({ specifier }) {
|
|
35
|
+
return EXTERNAL.has(specifier) ? { isExcluded: true } : null;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Keeps every dynamic `import()` inside `main.js`.
|
|
3
|
+
*
|
|
4
|
+
* Obsidian loads a plugin's `main.js` and nothing beside it, so a code-split chunk is shipped by no
|
|
5
|
+
* release and fails to load in an installed plugin. Parcel's default bundler makes every `import()` a
|
|
6
|
+
* new bundle root unconditionally, and has no option to inline one. The other bundlers each do:
|
|
7
|
+
* rollup's `inlineDynamicImports`, vite's `rollupOptions.output.inlineDynamicImports`, webpack's
|
|
8
|
+
* `asyncChunks: false`. This transformer is that option for Parcel, for the same reason
|
|
9
|
+
* `parcel-resolver-obsidian.cjs` is its `external` list. obsidian-dev-utils is what needs it: it
|
|
10
|
+
* reaches its desktop-only modules through `await import(...)`.
|
|
11
|
+
*
|
|
12
|
+
* It runs before Parcel's own JavaScript transformer and rewrites `import('<literal>')` into a
|
|
13
|
+
* `require()` inside an async arrow. The module still evaluates only when that code runs -- Parcel wraps
|
|
14
|
+
* a module it reaches through a nested `require()` -- which is what the dynamic import was for, and the
|
|
15
|
+
* promise still rejects when evaluation throws. The shape is deliberate: Parcel recognizes
|
|
16
|
+
* `Promise.resolve().then(() => require(...))` as a dynamic import and splits it all the same.
|
|
17
|
+
*
|
|
18
|
+
* Only a plain string specifier is rewritten; a computed one cannot be bundled by any bundler. The
|
|
19
|
+
* rewrite is textual, so an `import('<literal>')` spelled out inside a string or a comment is rewritten
|
|
20
|
+
* too, which changes nothing a plugin runs unless that string is itself code.
|
|
21
|
+
*
|
|
22
|
+
* CommonJS on purpose, as with the resolver beside it.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const { Transformer } = require('@parcel/plugin');
|
|
26
|
+
|
|
27
|
+
const DYNAMIC_IMPORT = /\bimport\(\s*(["'])([^"'`\n\\]+)\1\s*\)/gu;
|
|
28
|
+
|
|
29
|
+
module.exports = new Transformer({
|
|
30
|
+
async transform({ asset }) {
|
|
31
|
+
const source = await asset.getCode();
|
|
32
|
+
|
|
33
|
+
if (source.includes('import(')) {
|
|
34
|
+
asset.setCode(source.replace(DYNAMIC_IMPORT, (_match, quote, specifier) => `(async () => require(${quote}${specifier}${quote}))()`));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return [asset];
|
|
38
|
+
}
|
|
39
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Compiles `.svelte` single-file components.
|
|
3
|
+
*
|
|
4
|
+
* Shipped here rather than installed, because no working package exists. Parcel publishes a scoped
|
|
5
|
+
* transformer for Vue but never has for Svelte, and the community `parcel-transformer-svelte` peers on
|
|
6
|
+
* `svelte@^3` and reaches for `svelte/compiler.js` -- a path Svelte 5 does not ship. Every parcel build
|
|
7
|
+
* that touched a `.svelte` file therefore died, first with "No transformers found" and then, once the
|
|
8
|
+
* package was registered, with "Could not resolve module svelte/compiler.js".
|
|
9
|
+
*
|
|
10
|
+
* The whole job is `compile()` plus handing Parcel the component's styles back as a separate asset, so
|
|
11
|
+
* carrying it is cheaper than depending on an unmaintained package. Same reasoning, and the same
|
|
12
|
+
* CommonJS-on-purpose note, as `parcel-resolver-obsidian.cjs`.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const { Transformer } = require('@parcel/plugin');
|
|
16
|
+
const { compile } = require('svelte/compiler');
|
|
17
|
+
|
|
18
|
+
module.exports = new Transformer({
|
|
19
|
+
async transform({ asset }) {
|
|
20
|
+
const source = await asset.getCode();
|
|
21
|
+
|
|
22
|
+
const { css, js, warnings } = compile(source, {
|
|
23
|
+
css: 'external',
|
|
24
|
+
dev: process.env.BUILD !== 'production',
|
|
25
|
+
filename: asset.filePath,
|
|
26
|
+
name: toComponentName(asset.filePath)
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
for (const warning of warnings) {
|
|
30
|
+
// Parcel has no per-asset warning channel a transformer can write to, and swallowing them would
|
|
31
|
+
// Hide real problems in the component.
|
|
32
|
+
console.warn(`[svelte] ${warning.filename ?? asset.filePath}: ${warning.message}`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
asset.type = 'js';
|
|
36
|
+
asset.setCode(js.code);
|
|
37
|
+
|
|
38
|
+
const assets = [asset];
|
|
39
|
+
|
|
40
|
+
// `css: 'external'` keeps the styles out of the JavaScript so Parcel can extract them into the
|
|
41
|
+
// Plugin's stylesheet, which is what Obsidian loads. A component with no `<style>` block yields
|
|
42
|
+
// Nothing here.
|
|
43
|
+
if (css?.code) {
|
|
44
|
+
asset.addDependency({
|
|
45
|
+
specifier: `./${asset.id}.css`,
|
|
46
|
+
specifierType: 'esm'
|
|
47
|
+
});
|
|
48
|
+
assets.push({
|
|
49
|
+
content: css.code,
|
|
50
|
+
type: 'css',
|
|
51
|
+
uniqueKey: `${asset.id}.css`
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return assets;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
/** Svelte wants a valid JavaScript identifier for the component; the file name is the conventional one. */
|
|
60
|
+
function toComponentName(filePath) {
|
|
61
|
+
const base = filePath.split(/[\\/]/u).pop().replace(/\.svelte$/u, '');
|
|
62
|
+
return base
|
|
63
|
+
.split(/[^A-Za-z0-9]/u)
|
|
64
|
+
.filter(Boolean)
|
|
65
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
66
|
+
.join('') || 'Component';
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%- _pinnedVersionsJson -%>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# pnpm's settings file. Not only for workspaces: since pnpm 10 this is where per-project settings live,
|
|
2
|
+
# and pnpm 12 says outright that "the `pnpm` field in package.json is no longer read by pnpm".
|
|
3
|
+
#
|
|
4
|
+
# pnpm blocks dependency install scripts by default and, unlike npm, treats that as an ERROR rather
|
|
5
|
+
# than a warning -- `pnpm install` fails with ERR_PNPM_IGNORED_BUILDS until each one is named here.
|
|
6
|
+
# Every package below downloads or compiles a native binary, which is exactly what it needs its install
|
|
7
|
+
# script for. Naming one this project does not depend on is harmless, so the list covers what any
|
|
8
|
+
# answer can pull in.
|
|
9
|
+
#
|
|
10
|
+
# `allowBuilds`, not the `onlyBuiltDependencies` list pnpm 10 used: pnpm 12 reads the map form and
|
|
11
|
+
# silently ignores the old key.
|
|
12
|
+
allowBuilds:
|
|
13
|
+
'@parcel/watcher': true
|
|
14
|
+
dprint: true
|
|
15
|
+
edgedriver: true
|
|
16
|
+
esbuild: true
|
|
17
|
+
geckodriver: true
|
|
18
|
+
svelte-preprocess: true
|
|
19
|
+
unrs-resolver: true
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This file is required by postcss at the root level.
|
|
2
|
+
// The actual configuration lives in scripts/postcss.config.ts
|
|
3
|
+
//
|
|
4
|
+
// `.cjs`, not `.mjs`: every consumer finds this file through `postcss-load-config`, and the copy
|
|
5
|
+
// `esbuild-postcss` bundles is v3, whose search places stop at `postcss.config.cjs`. With an `.mjs`
|
|
6
|
+
// name it found nothing, reported no error, and silently ran the build with NO postcss plugins at all
|
|
7
|
+
// -- so autoprefixer and Tailwind never ran on the standalone esbuild path. `.cjs` is the one name
|
|
8
|
+
// every version of the loader, plus parcel, vite, webpack and rollup, all agree on.
|
|
9
|
+
const { createJiti } = require('jiti');
|
|
10
|
+
|
|
11
|
+
const jiti = createJiti(__filename);
|
|
12
|
+
module.exports = jiti('./scripts/postcss.config.ts').config;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// This file is required by rollup at the root level.
|
|
2
|
+
// The actual configuration lives in scripts/rollup.config.ts
|
|
3
|
+
import { createJiti } from 'jiti';
|
|
4
|
+
|
|
5
|
+
const jiti = createJiti(import.meta.url);
|
|
6
|
+
const { config } = await jiti.import('./scripts/rollup.config.ts');
|
|
7
|
+
export default config;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<%# Composed from list sections rather than from three whole-file partials, each of which declared its -%>
|
|
2
|
+
<%# own `export const config`. A preset forcing a second UI framework on top of the chosen one -- which -%>
|
|
3
|
+
<%# `demo` does with react -- rendered two of them into one file: TS2451. The file now declares `config` -%>
|
|
4
|
+
<%# exactly once however many frameworks are active. -%>
|
|
5
|
+
<%# -%>
|
|
6
|
+
<%# Each list item ends in the comma a partial cannot help writing, so the last one is stripped here, as -%>
|
|
7
|
+
<%# `rollup.config.ts.ejs` does with its plugins, and a list nothing contributed to collapses to `[]`. -%>
|
|
8
|
+
<%# `plugins` comes first because `perfectionist/sort-objects` wants the keys sorted. -%>
|
|
9
|
+
<%# -%>
|
|
10
|
+
<%# What SHOULD happen when two JSX transforms are both active is a separate question, and not this -%>
|
|
11
|
+
<%# file's to answer: it is the same demo-collision question the forced frameworks raise everywhere. -%>
|
|
12
|
+
<% const list = (items) => `[\n${items} ]`.replace(/,(?<Trailing>\s*)\]$/, '$<Trailing>]').replace(/^\[\s*\]$/, '[]'); -%>
|
|
13
|
+
export const config = {
|
|
14
|
+
plugins: <%- list(render('babel-plugin')) %>,
|
|
15
|
+
presets: <%- list(render('babel-preset')) %>
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
['@babel/plugin-transform-react-jsx', { importSource: 'preact', runtime: 'automatic' }],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'@babel/preset-react',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'babel-preset-solid',
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
|
|
3
|
+
// Tailwind 4 is compiled by its own CLI rather than through PostCSS, because PostCSS is not reachable on
|
|
4
|
+
// Every path this generator emits: the obsidian-dev-utils presets call that library's esbuild build,
|
|
5
|
+
// Which registers no PostCSS step at all AND registers `esbuild-sass-plugin` -- whose default filter is
|
|
6
|
+
// `/\.(s[ac]ss|css)$/`, so it claims `.css` too -- ahead of the `customEsbuildPlugins` seam a project can
|
|
7
|
+
// Add to. A PostCSS plugin appended there would never see the file. Running the CLI first sidesteps the
|
|
8
|
+
// Question entirely: every bundler then receives ordinary, already-expanded CSS.
|
|
9
|
+
//
|
|
10
|
+
// `src/styles/main.css` is the SOURCE (it carries `@import "tailwindcss"`); nothing imports it directly.
|
|
11
|
+
// `src/main.ts` imports the generated file below, which is git-ignored.
|
|
12
|
+
execSync('npx @tailwindcss/cli --input src/styles/main.css --output src/styles/tailwind.generated.css', { stdio: 'inherit' });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<%# Keyed on the BUNDLER first, as the lint and format scripts are keyed on their tool. Only esbuild -%>
|
|
2
|
+
<%# has a preset-specific build -- obsidian-dev-utils supplies one, and standalone inlines its own -- -%>
|
|
3
|
+
<%# so esbuild splits again underneath and the four CLI bundlers share one script. Splitting on the -%>
|
|
4
|
+
<%# preset first is what made every obsidian-dev-utils preset run esbuild whatever was chosen, while -%>
|
|
5
|
+
<%# still installing the chosen bundler and emitting its config for nothing to read. -%>
|
|
6
|
+
<%- render('bundler') -%>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<%# The relative imports go in a group of their own, after a blank line, which is what an import-sorting -%>
|
|
2
|
+
<%# lint rule asks for -- and the dev-utils presets now run one. Emitted only when a partial contributes. -%>
|
|
3
|
+
<% const relativeImports = render('import'); -%>
|
|
4
|
+
import { execSync } from 'node:child_process';
|
|
5
|
+
import {
|
|
6
|
+
copyFileSync,
|
|
7
|
+
cpSync,
|
|
8
|
+
existsSync,
|
|
9
|
+
mkdirSync,
|
|
10
|
+
rmSync<%- render('fs-import') %>
|
|
11
|
+
} from 'node:fs';
|
|
12
|
+
import { join } from 'node:path';
|
|
13
|
+
import process from 'node:process';
|
|
14
|
+
<%- relativeImports ? `\n${relativeImports}` : '' -%>
|
|
15
|
+
|
|
16
|
+
<%# `npm run dev` re-enters this script with `dev` in this slot; see `scripts/dev.ts`. -%>
|
|
17
|
+
const BUILD_MODE_ARGUMENT_INDEX = 2;
|
|
18
|
+
const isProduction = process.argv[BUILD_MODE_ARGUMENT_INDEX] !== 'dev';
|
|
19
|
+
<%# The `if (prod)` guard belongs to the partial, not to this wrapper. Wrapping it here emitted an -%>
|
|
20
|
+
<%# EMPTY `if (prod) { }` on every answer that contributes no compile step -- which the generated -%>
|
|
21
|
+
<%# ESLint config rejects with `no-empty` -- and a nested `if (prod) { if (prod) { … } }` on the one -%>
|
|
22
|
+
<%# answer that does. -%>
|
|
23
|
+
<%- render('compile') -%>
|
|
24
|
+
|
|
25
|
+
if (existsSync('.env')) {
|
|
26
|
+
process.loadEnvFile('.env');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const distFolder = isProduction ? 'dist/build' : 'dist/dev';
|
|
30
|
+
|
|
31
|
+
if (existsSync(distFolder)) {
|
|
32
|
+
rmSync(distFolder, { recursive: true });
|
|
33
|
+
}
|
|
34
|
+
mkdirSync(distFolder, { recursive: true });
|
|
35
|
+
|
|
36
|
+
copyFileSync('manifest.json', join(distFolder, 'manifest.json'));
|
|
37
|
+
|
|
38
|
+
<%- render('hot-reload') -%>
|
|
39
|
+
process.env['DIST_FOLDER'] = distFolder;
|
|
40
|
+
// Passed through the child's environment rather than as a `BUILD=production ` command prefix.
|
|
41
|
+
// Inline environment assignments are POSIX shell syntax: on Windows cmd.exe they are not a prefix at
|
|
42
|
+
// All, and the build died with "'BUILD' is not recognized as an internal or external command".
|
|
43
|
+
const env = isProduction ? { ...process.env, BUILD: 'production' } : process.env;
|
|
44
|
+
const watchFlag = isProduction ? '' : ' --watch';
|
|
45
|
+
<%- render('run') -%>
|
|
46
|
+
|
|
47
|
+
if (!isProduction) {
|
|
48
|
+
copyToObsidianPluginsFolder(distFolder);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function copyToObsidianPluginsFolder(dist: string): void {
|
|
52
|
+
const obsidianConfigFolder = process.env['OBSIDIAN_CONFIG_FOLDER'] ?? '';
|
|
53
|
+
if (!obsidianConfigFolder) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const pluginFolder = join(obsidianConfigFolder, 'plugins', '<%= pluginId %>');
|
|
58
|
+
if (!existsSync(pluginFolder)) {
|
|
59
|
+
mkdirSync(pluginFolder, { recursive: true });
|
|
60
|
+
}
|
|
61
|
+
cpSync(dist, pluginFolder, { recursive: true });
|
|
62
|
+
<%- render({ section: 'reload', indentLevel: 1 }) -%>
|
|
63
|
+
}
|
package/templates/default/scripts/build.ts@bundler_cli-bundler@lint-build-styles_dev-utils.ejs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// eslint-disable-next-line import-x/no-unassigned-import -- Importing the module RUNS the style build; there is nothing to bind.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
execSync(`npx parcel build src/main.ts --dist-dir ${distFolder} --no-cache${watchFlag}`, { env, stdio: 'inherit' });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
execSync(`npx rollup -c${watchFlag}`, { env, stdio: 'inherit' });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
execSync(`npx vite build${watchFlag}`, { env, stdio: 'inherit' });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
execSync(`npx webpack --config webpack.config.ts${watchFlag}`, { env, stdio: 'inherit' });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import postcssPlugin from 'esbuild-postcss';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { sassPlugin } from 'esbuild-sass-plugin';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { solidPlugin } from 'esbuild-plugin-solid';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import esbuildSvelte from 'esbuild-svelte';
|
|
3
|
+
import { sveltePreprocess } from 'svelte-preprocess';
|
|
4
|
+
|
|
5
|
+
// `esbuild-svelte` declares `export default function` in its types but ships a CommonJS `main` whose
|
|
6
|
+
// `module.exports` IS that function, and it publishes no `exports` map. Under `moduleResolution:
|
|
7
|
+
// node16` TypeScript therefore models the default import as the module object and rejects the call,
|
|
8
|
+
// while at runtime the import really is the function (verified: `typeof` is `function`). The cast
|
|
9
|
+
// follows the runtime. It costs the option object's type-checking, which is the narrower loss.
|
|
10
|
+
const sveltePlugin = esbuildSvelte as unknown as (options?: Record<string, unknown>) => esbuild.Plugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './build-styles.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import vuePlugin from 'esbuild-plugin-vue3';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// eslint-disable-next-line import-x/no-unassigned-import -- Importing the module RUNS the style build; there is nothing to bind.
|