diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f237b21..525954c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,22 +12,19 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4 + - uses: denoland/setup-deno@v2 with: - node-version-file: ".node-version" - cache: "pnpm" - - run: pnpm install - - run: pnpm build + deno-version: v2.x + - run: deno install + - run: deno task build - biome: + check: runs-on: ubuntu-latest steps: - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4 + - uses: denoland/setup-deno@v2 with: - node-version-file: ".node-version" - cache: "pnpm" - - run: pnpm install - - run: pnpm biome check . + deno-version: v2.x + - run: deno check . + - run: deno fmt --check . + - run: deno lint . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56460e0..b96c82c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,13 +11,11 @@ jobs: steps: - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4 + - uses: denoland/setup-deno@v2 with: - node-version-file: ".node-version" - cache: "pnpm" - - run: pnpm install - - run: pnpm build + deno-version: v2.x + - run: deno install + - run: deno task build - run: | tag="${GITHUB_REF#refs/tags/}" gh release create "$tag" \ diff --git a/renovate.json b/.github/workflows/renovate.json similarity index 100% rename from renovate.json rename to .github/workflows/renovate.json diff --git a/.gitignore b/.gitignore index 8a3dff6..ea7d657 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,5 @@ -# Intellij -*.iml -.idea - -# npm node_modules +.DS_Store -# Don't include the compiled main.js file in the repo. -# They should be uploaded to GitHub releases instead. -main.js - -# Exclude sourcemaps -*.map - -# obsidian data.json - -# Exclude macOS Finder (System Explorer) View States -.DS_Store +main.js diff --git a/.node-version b/.node-version deleted file mode 100644 index 2a393af..0000000 --- a/.node-version +++ /dev/null @@ -1 +0,0 @@ -20.18.0 diff --git a/.npmrc b/.npmrc deleted file mode 100644 index b973752..0000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -tag-version-prefix="" \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 16e8e66..3544859 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,3 @@ { - "recommendations": ["biomejs.biome"] + "recommendations": ["denoland.vscode-deno"] } diff --git a/.vscode/settings.json b/.vscode/settings.json index a5cd729..287750e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,23 @@ { - "[javascript][typescript][json]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "biome.enabled": true, - "editor.codeActionsOnSave": { - "quickfix.biome": "explicit", - "source.organizeImports.biome": "explicit" - } + "[css]": { + "editor.defaultFormatter": "denoland.vscode-deno" + }, + "[json]": { + "editor.defaultFormatter": "denoland.vscode-deno" + }, + "[jsonc]": { + "editor.defaultFormatter": "denoland.vscode-deno" + }, + "[markdown]": { + "editor.defaultFormatter": "denoland.vscode-deno" + }, + "[typescript]": { + "editor.defaultFormatter": "denoland.vscode-deno" + }, + "[yaml]": { + "editor.defaultFormatter": "denoland.vscode-deno" + }, + "deno.enable": true, + "deno.lint": true, + "editor.defaultFormatter": "denoland.vscode-deno" } diff --git a/README.md b/README.md index 0b51c26..7c81c84 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,27 @@ # Graph Banner -[![release](https://img.shields.io/github/manifest-json/v/ras0q/obsidian-graph-banner.svg?color=A68AF9&style=for-the-badge&logo=github)](https://github.com/ras0q/obsidian-graph-banner/releases/latest) [![downloads](https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/obsidianmd/obsidian-releases/master/community-plugin-stats.json&query=$['graph-banner'].downloads&label=Downloads&color=A68AF9&style=for-the-badge&logo=obsidian& -)](https://obsidian.md/plugins?id=graph-banner) +[![release](https://img.shields.io/github/manifest-json/v/ras0q/obsidian-graph-banner.svg?color=A68AF9&style=for-the-badge&logo=github)](https://github.com/ras0q/obsidian-graph-banner/releases/latest) +[![downloads](https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/obsidianmd/obsidian-releases/master/community-plugin-stats.json&query=$['graph-banner'].downloads&label=Downloads&color=A68AF9&style=for-the-badge&logo=obsidian&)](https://obsidian.md/plugins?id=graph-banner) -An [Obsidian](https://obsidian.md/) plugin to display a local graph view to the note header. +An [Obsidian](https://obsidian.md/) plugin to display a local graph view to the +note header. ![screenshot thumbnail](./thumbnail.png) -This screenshot was generated using [s-blu/obsidian_dataview_example_vault](https://github.com/s-blu/obsidian_dataview_example_vault) +This screenshot was generated using +[s-blu/obsidian_dataview_example_vault](https://github.com/s-blu/obsidian_dataview_example_vault) ## Usage -1. **[Install](https://obsidian.md/plugins?id=graph-banner)** and **enable** the plugin. +1. **[Install](https://obsidian.md/plugins?id=graph-banner)** and **enable** the + plugin. 2. **Just open a note** and the graph will be displayed in the header! > [!TIP] > -> - You can customize the banner appearance via [Style Settings](https://github.com/mgmeyers/obsidian-style-setting) plugin. -> - You can save the local graph settings via [Sync Graph Settings](https://github.com/Xallt/sync-graph-settings) plugin. -> - **Graph settings synchronizatoin is only reflected the first time you open a note**, so reload the app if you change those settings. +> - You can customize the banner appearance via +> [Style Settings](https://github.com/mgmeyers/obsidian-style-setting) plugin. +> - You can save the local graph settings via +> [Sync Graph Settings](https://github.com/Xallt/sync-graph-settings) plugin. +> - **Graph settings synchronizatoin is only reflected the first time you open +> a note**, so reload the app if you change those settings. diff --git a/biome.json b/biome.json deleted file mode 100644 index 0fea7e4..0000000 --- a/biome.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/1.7.3/schema.json", - "formatter": { - "enabled": true - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true - } - }, - "organizeImports": { - "enabled": true - }, - "vcs": { - "enabled": true, - "clientKind": "git", - "useIgnoreFile": true, - "defaultBranch": "master" - } -} diff --git a/deno.jsonc b/deno.jsonc new file mode 100644 index 0000000..c07294d --- /dev/null +++ b/deno.jsonc @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "lib": [ + "deno.window", + "dom" + ] + }, + "exclude": [ + "node_modules", + "main.js" + ], + "fmt": { + "useTabs": true + }, + "imports": { + "esbuild": "npm:esbuild@0.24.0", + "ignore": "npm:ignore@6.0.2", + "obsidian": "npm:obsidian@1.7.2" + }, + "nodeModulesDir": "auto", + "tasks": { + "build": "esbuild ./src/main.ts --bundle --external:obsidian --format=cjs --minify --target=es6 --outfile=./main.js", + "dev": "esbuild ./src/main.ts --watch --bundle --external:obsidian --format=cjs --target=es6 --sourcemap=inline --outfile=./main.js" + } +} diff --git a/deno.lock b/deno.lock new file mode 100644 index 0000000..0859502 --- /dev/null +++ b/deno.lock @@ -0,0 +1,165 @@ +{ + "version": "4", + "specifiers": { + "npm:esbuild@0.24.0": "0.24.0", + "npm:ignore@6.0.2": "6.0.2", + "npm:obsidian@1.7.2": "1.7.2_@codemirror+state@6.4.1_@codemirror+view@6.34.1" + }, + "npm": { + "@codemirror/state@6.4.1": { + "integrity": "sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==" + }, + "@codemirror/view@6.34.1": { + "integrity": "sha512-t1zK/l9UiRqwUNPm+pdIT0qzJlzuVckbTEMVNFhfWkGiBQClstzg+78vedCvLSX0xJEZ6lwZbPpnljL7L6iwMQ==", + "dependencies": [ + "@codemirror/state", + "style-mod", + "w3c-keyname" + ] + }, + "@esbuild/aix-ppc64@0.24.0": { + "integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==" + }, + "@esbuild/android-arm64@0.24.0": { + "integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==" + }, + "@esbuild/android-arm@0.24.0": { + "integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==" + }, + "@esbuild/android-x64@0.24.0": { + "integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==" + }, + "@esbuild/darwin-arm64@0.24.0": { + "integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==" + }, + "@esbuild/darwin-x64@0.24.0": { + "integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==" + }, + "@esbuild/freebsd-arm64@0.24.0": { + "integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==" + }, + "@esbuild/freebsd-x64@0.24.0": { + "integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==" + }, + "@esbuild/linux-arm64@0.24.0": { + "integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==" + }, + "@esbuild/linux-arm@0.24.0": { + "integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==" + }, + "@esbuild/linux-ia32@0.24.0": { + "integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==" + }, + "@esbuild/linux-loong64@0.24.0": { + "integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==" + }, + "@esbuild/linux-mips64el@0.24.0": { + "integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==" + }, + "@esbuild/linux-ppc64@0.24.0": { + "integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==" + }, + "@esbuild/linux-riscv64@0.24.0": { + "integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==" + }, + "@esbuild/linux-s390x@0.24.0": { + "integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==" + }, + "@esbuild/linux-x64@0.24.0": { + "integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==" + }, + "@esbuild/netbsd-x64@0.24.0": { + "integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==" + }, + "@esbuild/openbsd-arm64@0.24.0": { + "integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==" + }, + "@esbuild/openbsd-x64@0.24.0": { + "integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==" + }, + "@esbuild/sunos-x64@0.24.0": { + "integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==" + }, + "@esbuild/win32-arm64@0.24.0": { + "integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==" + }, + "@esbuild/win32-ia32@0.24.0": { + "integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==" + }, + "@esbuild/win32-x64@0.24.0": { + "integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==" + }, + "@types/codemirror@5.60.8": { + "integrity": "sha512-VjFgDF/eB+Aklcy15TtOTLQeMjTo07k7KAjql8OK5Dirr7a6sJY4T1uVBDuTVG9VEmn1uUsohOpYnVfgC6/jyw==", + "dependencies": [ + "@types/tern" + ] + }, + "@types/estree@1.0.6": { + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==" + }, + "@types/tern@0.23.9": { + "integrity": "sha512-ypzHFE/wBzh+BlH6rrBgS5I/Z7RD21pGhZ2rltb/+ZrVM1awdZwjx7hE5XfuYgHWk9uvV5HLZN3SloevCAp3Bw==", + "dependencies": [ + "@types/estree" + ] + }, + "esbuild@0.24.0": { + "integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==", + "dependencies": [ + "@esbuild/aix-ppc64", + "@esbuild/android-arm", + "@esbuild/android-arm64", + "@esbuild/android-x64", + "@esbuild/darwin-arm64", + "@esbuild/darwin-x64", + "@esbuild/freebsd-arm64", + "@esbuild/freebsd-x64", + "@esbuild/linux-arm", + "@esbuild/linux-arm64", + "@esbuild/linux-ia32", + "@esbuild/linux-loong64", + "@esbuild/linux-mips64el", + "@esbuild/linux-ppc64", + "@esbuild/linux-riscv64", + "@esbuild/linux-s390x", + "@esbuild/linux-x64", + "@esbuild/netbsd-x64", + "@esbuild/openbsd-arm64", + "@esbuild/openbsd-x64", + "@esbuild/sunos-x64", + "@esbuild/win32-arm64", + "@esbuild/win32-ia32", + "@esbuild/win32-x64" + ] + }, + "ignore@6.0.2": { + "integrity": "sha512-InwqeHHN2XpumIkMvpl/DCJVrAHgCsG5+cn1XlnLWGwtZBm8QJfSusItfrwx81CTp5agNZqpKU2J/ccC5nGT4A==" + }, + "moment@2.29.4": { + "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==" + }, + "obsidian@1.7.2_@codemirror+state@6.4.1_@codemirror+view@6.34.1": { + "integrity": "sha512-k9hN9brdknJC+afKr5FQzDRuEFGDKbDjfCazJwpgibwCAoZNYHYV8p/s3mM8I6AsnKrPKNXf8xGuMZ4enWelZQ==", + "dependencies": [ + "@codemirror/state", + "@codemirror/view", + "@types/codemirror", + "moment" + ] + }, + "style-mod@4.1.2": { + "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==" + }, + "w3c-keyname@2.2.8": { + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==" + } + }, + "workspace": { + "dependencies": [ + "npm:esbuild@0.24.0", + "npm:ignore@6.0.2", + "npm:obsidian@1.7.2" + ] + } +} diff --git a/package.json b/package.json deleted file mode 100644 index e5a7f2d..0000000 --- a/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "obsidian-graph-banner", - "version": "1.4.2", - "description": "Display a local graph view to the note header", - "main": "main.js", - "engines": { - "node": "20.x" - }, - "packageManager": "pnpm@9.12.2+sha512.22721b3a11f81661ae1ec68ce1a7b879425a1ca5b991c975b074ac220b187ce56c708fe5db69f4c962c989452eee76c82877f4ee80f474cebd61ee13461b6228", - "scripts": { - "dev": "node ./scripts/esbuild.config.mjs", - "build": "tsc -noEmit -skipLibCheck && node ./scripts/esbuild.config.mjs production", - "bump-version": "node ./scripts/version-bump.mjs" - }, - "keywords": [], - "author": "ras0q", - "license": "MIT", - "devDependencies": { - "@biomejs/biome": "1.9.3", - "@types/node": "20.16.12", - "esbuild": "0.24.0", - "tslib": "2.8.0", - "typescript": "5.6.3" - }, - "dependencies": { - "ignore": "^6.0.0", - "obsidian": "^1.6.6" - } -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index 3643ffc..0000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,463 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - dependencies: - ignore: - specifier: ^6.0.0 - version: 6.0.2 - obsidian: - specifier: ^1.6.6 - version: 1.7.2(@codemirror/state@6.4.1)(@codemirror/view@6.33.0) - devDependencies: - '@biomejs/biome': - specifier: 1.9.3 - version: 1.9.3 - '@types/node': - specifier: 20.16.12 - version: 20.16.12 - esbuild: - specifier: 0.24.0 - version: 0.24.0 - tslib: - specifier: 2.8.0 - version: 2.8.0 - typescript: - specifier: 5.6.3 - version: 5.6.3 - -packages: - - '@biomejs/biome@1.9.3': - resolution: {integrity: sha512-POjAPz0APAmX33WOQFGQrwLvlu7WLV4CFJMlB12b6ZSg+2q6fYu9kZwLCOA+x83zXfcPd1RpuWOKJW0GbBwLIQ==} - engines: {node: '>=14.21.3'} - hasBin: true - - '@biomejs/cli-darwin-arm64@1.9.3': - resolution: {integrity: sha512-QZzD2XrjJDUyIZK+aR2i5DDxCJfdwiYbUKu9GzkCUJpL78uSelAHAPy7m0GuPMVtF/Uo+OKv97W3P9nuWZangQ==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [darwin] - - '@biomejs/cli-darwin-x64@1.9.3': - resolution: {integrity: sha512-vSCoIBJE0BN3SWDFuAY/tRavpUtNoqiceJ5PrU3xDfsLcm/U6N93JSM0M9OAiC/X7mPPfejtr6Yc9vSgWlEgVw==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [darwin] - - '@biomejs/cli-linux-arm64-musl@1.9.3': - resolution: {integrity: sha512-VBzyhaqqqwP3bAkkBrhVq50i3Uj9+RWuj+pYmXrMDgjS5+SKYGE56BwNw4l8hR3SmYbLSbEo15GcV043CDSk+Q==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [linux] - - '@biomejs/cli-linux-arm64@1.9.3': - resolution: {integrity: sha512-vJkAimD2+sVviNTbaWOGqEBy31cW0ZB52KtpVIbkuma7PlfII3tsLhFa+cwbRAcRBkobBBhqZ06hXoZAN8NODQ==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [linux] - - '@biomejs/cli-linux-x64-musl@1.9.3': - resolution: {integrity: sha512-TJmnOG2+NOGM72mlczEsNki9UT+XAsMFAOo8J0me/N47EJ/vkLXxf481evfHLlxMejTY6IN8SdRSiPVLv6AHlA==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [linux] - - '@biomejs/cli-linux-x64@1.9.3': - resolution: {integrity: sha512-x220V4c+romd26Mu1ptU+EudMXVS4xmzKxPVb9mgnfYlN4Yx9vD5NZraSx/onJnd3Gh/y8iPUdU5CDZJKg9COA==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [linux] - - '@biomejs/cli-win32-arm64@1.9.3': - resolution: {integrity: sha512-lg/yZis2HdQGsycUvHWSzo9kOvnGgvtrYRgoCEwPBwwAL8/6crOp3+f47tPwI/LI1dZrhSji7PNsGKGHbwyAhw==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [win32] - - '@biomejs/cli-win32-x64@1.9.3': - resolution: {integrity: sha512-cQMy2zanBkVLpmmxXdK6YePzmZx0s5Z7KEnwmrW54rcXK3myCNbQa09SwGZ8i/8sLw0H9F3X7K4rxVNGU8/D4Q==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [win32] - - '@codemirror/state@6.4.1': - resolution: {integrity: sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==} - - '@codemirror/view@6.33.0': - resolution: {integrity: sha512-AroaR3BvnjRW8fiZBalAaK+ZzB5usGgI014YKElYZvQdNH5ZIidHlO+cyf/2rWzyBFRkvG6VhiXeAEbC53P2YQ==} - - '@esbuild/aix-ppc64@0.24.0': - resolution: {integrity: sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [aix] - - '@esbuild/android-arm64@0.24.0': - resolution: {integrity: sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==} - engines: {node: '>=18'} - cpu: [arm64] - os: [android] - - '@esbuild/android-arm@0.24.0': - resolution: {integrity: sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==} - engines: {node: '>=18'} - cpu: [arm] - os: [android] - - '@esbuild/android-x64@0.24.0': - resolution: {integrity: sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==} - engines: {node: '>=18'} - cpu: [x64] - os: [android] - - '@esbuild/darwin-arm64@0.24.0': - resolution: {integrity: sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [darwin] - - '@esbuild/darwin-x64@0.24.0': - resolution: {integrity: sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==} - engines: {node: '>=18'} - cpu: [x64] - os: [darwin] - - '@esbuild/freebsd-arm64@0.24.0': - resolution: {integrity: sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==} - engines: {node: '>=18'} - cpu: [arm64] - os: [freebsd] - - '@esbuild/freebsd-x64@0.24.0': - resolution: {integrity: sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==} - engines: {node: '>=18'} - cpu: [x64] - os: [freebsd] - - '@esbuild/linux-arm64@0.24.0': - resolution: {integrity: sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==} - engines: {node: '>=18'} - cpu: [arm64] - os: [linux] - - '@esbuild/linux-arm@0.24.0': - resolution: {integrity: sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==} - engines: {node: '>=18'} - cpu: [arm] - os: [linux] - - '@esbuild/linux-ia32@0.24.0': - resolution: {integrity: sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==} - engines: {node: '>=18'} - cpu: [ia32] - os: [linux] - - '@esbuild/linux-loong64@0.24.0': - resolution: {integrity: sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==} - engines: {node: '>=18'} - cpu: [loong64] - os: [linux] - - '@esbuild/linux-mips64el@0.24.0': - resolution: {integrity: sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==} - engines: {node: '>=18'} - cpu: [mips64el] - os: [linux] - - '@esbuild/linux-ppc64@0.24.0': - resolution: {integrity: sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [linux] - - '@esbuild/linux-riscv64@0.24.0': - resolution: {integrity: sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==} - engines: {node: '>=18'} - cpu: [riscv64] - os: [linux] - - '@esbuild/linux-s390x@0.24.0': - resolution: {integrity: sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==} - engines: {node: '>=18'} - cpu: [s390x] - os: [linux] - - '@esbuild/linux-x64@0.24.0': - resolution: {integrity: sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==} - engines: {node: '>=18'} - cpu: [x64] - os: [linux] - - '@esbuild/netbsd-x64@0.24.0': - resolution: {integrity: sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==} - engines: {node: '>=18'} - cpu: [x64] - os: [netbsd] - - '@esbuild/openbsd-arm64@0.24.0': - resolution: {integrity: sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==} - engines: {node: '>=18'} - cpu: [arm64] - os: [openbsd] - - '@esbuild/openbsd-x64@0.24.0': - resolution: {integrity: sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==} - engines: {node: '>=18'} - cpu: [x64] - os: [openbsd] - - '@esbuild/sunos-x64@0.24.0': - resolution: {integrity: sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==} - engines: {node: '>=18'} - cpu: [x64] - os: [sunos] - - '@esbuild/win32-arm64@0.24.0': - resolution: {integrity: sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==} - engines: {node: '>=18'} - cpu: [arm64] - os: [win32] - - '@esbuild/win32-ia32@0.24.0': - resolution: {integrity: sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==} - engines: {node: '>=18'} - cpu: [ia32] - os: [win32] - - '@esbuild/win32-x64@0.24.0': - resolution: {integrity: sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==} - engines: {node: '>=18'} - cpu: [x64] - os: [win32] - - '@types/codemirror@5.60.8': - resolution: {integrity: sha512-VjFgDF/eB+Aklcy15TtOTLQeMjTo07k7KAjql8OK5Dirr7a6sJY4T1uVBDuTVG9VEmn1uUsohOpYnVfgC6/jyw==} - - '@types/estree@1.0.6': - resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} - - '@types/node@20.16.12': - resolution: {integrity: sha512-LfPFB0zOeCeCNQV3i+67rcoVvoN5n0NVuR2vLG0O5ySQMgchuZlC4lgz546ZOJyDtj5KIgOxy+lacOimfqZAIA==} - - '@types/tern@0.23.9': - resolution: {integrity: sha512-ypzHFE/wBzh+BlH6rrBgS5I/Z7RD21pGhZ2rltb/+ZrVM1awdZwjx7hE5XfuYgHWk9uvV5HLZN3SloevCAp3Bw==} - - esbuild@0.24.0: - resolution: {integrity: sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==} - engines: {node: '>=18'} - hasBin: true - - ignore@6.0.2: - resolution: {integrity: sha512-InwqeHHN2XpumIkMvpl/DCJVrAHgCsG5+cn1XlnLWGwtZBm8QJfSusItfrwx81CTp5agNZqpKU2J/ccC5nGT4A==} - engines: {node: '>= 4'} - - moment@2.29.4: - resolution: {integrity: sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==} - - obsidian@1.7.2: - resolution: {integrity: sha512-k9hN9brdknJC+afKr5FQzDRuEFGDKbDjfCazJwpgibwCAoZNYHYV8p/s3mM8I6AsnKrPKNXf8xGuMZ4enWelZQ==} - peerDependencies: - '@codemirror/state': ^6.0.0 - '@codemirror/view': ^6.0.0 - - style-mod@4.1.2: - resolution: {integrity: sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==} - - tslib@2.8.0: - resolution: {integrity: sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==} - - typescript@5.6.3: - resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} - engines: {node: '>=14.17'} - hasBin: true - - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - - w3c-keyname@2.2.8: - resolution: {integrity: sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==} - -snapshots: - - '@biomejs/biome@1.9.3': - optionalDependencies: - '@biomejs/cli-darwin-arm64': 1.9.3 - '@biomejs/cli-darwin-x64': 1.9.3 - '@biomejs/cli-linux-arm64': 1.9.3 - '@biomejs/cli-linux-arm64-musl': 1.9.3 - '@biomejs/cli-linux-x64': 1.9.3 - '@biomejs/cli-linux-x64-musl': 1.9.3 - '@biomejs/cli-win32-arm64': 1.9.3 - '@biomejs/cli-win32-x64': 1.9.3 - - '@biomejs/cli-darwin-arm64@1.9.3': - optional: true - - '@biomejs/cli-darwin-x64@1.9.3': - optional: true - - '@biomejs/cli-linux-arm64-musl@1.9.3': - optional: true - - '@biomejs/cli-linux-arm64@1.9.3': - optional: true - - '@biomejs/cli-linux-x64-musl@1.9.3': - optional: true - - '@biomejs/cli-linux-x64@1.9.3': - optional: true - - '@biomejs/cli-win32-arm64@1.9.3': - optional: true - - '@biomejs/cli-win32-x64@1.9.3': - optional: true - - '@codemirror/state@6.4.1': {} - - '@codemirror/view@6.33.0': - dependencies: - '@codemirror/state': 6.4.1 - style-mod: 4.1.2 - w3c-keyname: 2.2.8 - - '@esbuild/aix-ppc64@0.24.0': - optional: true - - '@esbuild/android-arm64@0.24.0': - optional: true - - '@esbuild/android-arm@0.24.0': - optional: true - - '@esbuild/android-x64@0.24.0': - optional: true - - '@esbuild/darwin-arm64@0.24.0': - optional: true - - '@esbuild/darwin-x64@0.24.0': - optional: true - - '@esbuild/freebsd-arm64@0.24.0': - optional: true - - '@esbuild/freebsd-x64@0.24.0': - optional: true - - '@esbuild/linux-arm64@0.24.0': - optional: true - - '@esbuild/linux-arm@0.24.0': - optional: true - - '@esbuild/linux-ia32@0.24.0': - optional: true - - '@esbuild/linux-loong64@0.24.0': - optional: true - - '@esbuild/linux-mips64el@0.24.0': - optional: true - - '@esbuild/linux-ppc64@0.24.0': - optional: true - - '@esbuild/linux-riscv64@0.24.0': - optional: true - - '@esbuild/linux-s390x@0.24.0': - optional: true - - '@esbuild/linux-x64@0.24.0': - optional: true - - '@esbuild/netbsd-x64@0.24.0': - optional: true - - '@esbuild/openbsd-arm64@0.24.0': - optional: true - - '@esbuild/openbsd-x64@0.24.0': - optional: true - - '@esbuild/sunos-x64@0.24.0': - optional: true - - '@esbuild/win32-arm64@0.24.0': - optional: true - - '@esbuild/win32-ia32@0.24.0': - optional: true - - '@esbuild/win32-x64@0.24.0': - optional: true - - '@types/codemirror@5.60.8': - dependencies: - '@types/tern': 0.23.9 - - '@types/estree@1.0.6': {} - - '@types/node@20.16.12': - dependencies: - undici-types: 6.19.8 - - '@types/tern@0.23.9': - dependencies: - '@types/estree': 1.0.6 - - esbuild@0.24.0: - optionalDependencies: - '@esbuild/aix-ppc64': 0.24.0 - '@esbuild/android-arm': 0.24.0 - '@esbuild/android-arm64': 0.24.0 - '@esbuild/android-x64': 0.24.0 - '@esbuild/darwin-arm64': 0.24.0 - '@esbuild/darwin-x64': 0.24.0 - '@esbuild/freebsd-arm64': 0.24.0 - '@esbuild/freebsd-x64': 0.24.0 - '@esbuild/linux-arm': 0.24.0 - '@esbuild/linux-arm64': 0.24.0 - '@esbuild/linux-ia32': 0.24.0 - '@esbuild/linux-loong64': 0.24.0 - '@esbuild/linux-mips64el': 0.24.0 - '@esbuild/linux-ppc64': 0.24.0 - '@esbuild/linux-riscv64': 0.24.0 - '@esbuild/linux-s390x': 0.24.0 - '@esbuild/linux-x64': 0.24.0 - '@esbuild/netbsd-x64': 0.24.0 - '@esbuild/openbsd-arm64': 0.24.0 - '@esbuild/openbsd-x64': 0.24.0 - '@esbuild/sunos-x64': 0.24.0 - '@esbuild/win32-arm64': 0.24.0 - '@esbuild/win32-ia32': 0.24.0 - '@esbuild/win32-x64': 0.24.0 - - ignore@6.0.2: {} - - moment@2.29.4: {} - - obsidian@1.7.2(@codemirror/state@6.4.1)(@codemirror/view@6.33.0): - dependencies: - '@codemirror/state': 6.4.1 - '@codemirror/view': 6.33.0 - '@types/codemirror': 5.60.8 - moment: 2.29.4 - - style-mod@4.1.2: {} - - tslib@2.8.0: {} - - typescript@5.6.3: {} - - undici-types@6.19.8: {} - - w3c-keyname@2.2.8: {} diff --git a/scripts/esbuild.config.mjs b/scripts/esbuild.config.mjs deleted file mode 100644 index 80513cc..0000000 --- a/scripts/esbuild.config.mjs +++ /dev/null @@ -1,27 +0,0 @@ -import path from "node:path"; -import process from "node:process"; -import { fileURLToPath } from "node:url"; -import { context } from "esbuild"; - -const isProduction = process.argv[2] === "production"; -const __dirname = path.dirname(fileURLToPath(import.meta.url)); - -const ctx = await context({ - entryPoints: [path.resolve(__dirname, "../src/main.ts")], - minify: isProduction, - bundle: true, - external: ["obsidian"], - format: "cjs", - target: "es6", - logLevel: "info", - sourcemap: isProduction ? false : "inline", - treeShaking: true, - outfile: path.resolve(__dirname, "../main.js"), -}); - -if (isProduction) { - await ctx.rebuild(); - process.exit(0); -} else { - await ctx.watch(); -} diff --git a/scripts/version-bump.mjs b/scripts/version-bump.mjs deleted file mode 100644 index f592236..0000000 --- a/scripts/version-bump.mjs +++ /dev/null @@ -1,32 +0,0 @@ -import { readFileSync, writeFileSync } from "node:fs"; -import path from "node:path"; -import { fileURLToPath } from "node:url"; - -const targetVersion = process.env.npm_package_version; -const __dirname = path.dirname(fileURLToPath(import.meta.url)); - -// read minAppVersion from manifest.json and bump version to target version -const manifest = JSON.parse( - readFileSync(path.resolve(__dirname, "../manifest.json"), "utf8"), -); -const { minAppVersion } = manifest; -manifest.version = targetVersion; -writeFileSync("manifest.json", `${JSON.stringify(manifest, null, "\t")}\n`); - -// update versions.json with target version and minAppVersion from manifest.json -const versions = JSON.parse( - readFileSync(path.resolve(__dirname, "../versions.json"), "utf8"), -); -versions[targetVersion] = minAppVersion; -writeFileSync("versions.json", `${JSON.stringify(versions, null, "\t")}\n`); - -// commit changes and tag with target version -console.log(`Bumped version to ${targetVersion}`); -console.log("Please commit and tag the changes to complete the process"); -console.log(); -console.log("pnpm install"); -console.log("git add package.json pnpm-lock.yaml manifest.json versions.json"); -console.log(`git commit -m ":bookmark: ${targetVersion}"`); -console.log(`git tag ${targetVersion}`); -console.log("git push"); -console.log("git push --tags"); diff --git a/src/main.ts b/src/main.ts index c6d3648..85ab8be 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,17 +1,17 @@ import ignore from "ignore"; import { MarkdownView, Plugin, type WorkspaceLeaf } from "obsidian"; -import { DEFAULT_SETTINGS, SettingTab, type Settings } from "./settings"; +import { DEFAULT_SETTINGS, type Settings, SettingTab } from "./settings.ts"; export default class GraphBannerPlugin extends Plugin { static graphBannerNodeClass = "graph-banner-content"; - settings: Settings; + settings: Settings = DEFAULT_SETTINGS; unloadListeners: (() => void)[] = []; graphLeaf: WorkspaceLeaf | null = null; graphNode: Element | null = null; - async onload() { + override async onload() { await this.loadSettings(); this.addSettingTab(new SettingTab(this.app, this)); @@ -22,14 +22,15 @@ export default class GraphBannerPlugin extends Plugin { this.app.workspace.on("file-open", async (file) => { if (!file || file.extension !== "md") return; - const isIgnoredPath = ignore() + const isIgnoredPath = ignore + .default() // FIXME: ignore() is not a function? .add(this.settings.ignore) .ignores(file.path); this.graphNode?.toggleClass("hidden", isIgnoredPath); if (isIgnoredPath) return; const fileView = await this.tryUntilNonNull(() => - this.app.workspace.getActiveViewOfType(MarkdownView), + this.app.workspace.getActiveViewOfType(MarkdownView) ); if (fileView.file !== file) { throw new Error("Failed to get file view"); @@ -47,9 +48,9 @@ export default class GraphBannerPlugin extends Plugin { }); if (!this.graphNode) { - const graphNode = this.graphLeaf.view.containerEl - .getElementsByClassName("view-content") - .item(0); + const graphNode = this.graphLeaf.view.containerEl.find( + ".view-content", + ); if (!graphNode) { throw new Error("Failed to get graph node"); } @@ -65,14 +66,10 @@ export default class GraphBannerPlugin extends Plugin { } // NOTE: close graph controls - const graphControls = graphNode - .getElementsByClassName("graph-controls") - .item(0); + const graphControls = graphNode.find(".graph-controls"); graphControls?.toggleClass("is-close", true); - const noteHeader = fileView.containerEl - .getElementsByClassName("inline-title") - .item(0); + const noteHeader = fileView.containerEl.find(".inline-title"); if (!noteHeader?.parentElement || !noteHeader?.nextSibling) { throw new Error("Failed to get note header"); } @@ -84,14 +81,13 @@ export default class GraphBannerPlugin extends Plugin { this.registerEvent( this.app.workspace.on("layout-change", async () => { - const fileView = - this.app.workspace.getActiveViewOfType(MarkdownView); + const fileView = this.app.workspace.getActiveViewOfType( + MarkdownView, + ); if (!fileView) return; const noteHeader = await this.tryUntilNonNull(() => - fileView.containerEl - .getElementsByClassName("inline-title") - .item(0), + fileView.containerEl.find(".inline-title") ); if (!noteHeader.parentElement || !noteHeader.nextSibling) { throw new Error("Failed to get note header"); @@ -108,7 +104,7 @@ export default class GraphBannerPlugin extends Plugin { ); } - async onunload() { + override onunload() { console.log("Unloading GraphBannerPlugin"); this.graphLeaf?.detach(); diff --git a/src/settings.ts b/src/settings.ts index 30d5d6b..dcbf238 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -1,5 +1,5 @@ import { type App, Notice, PluginSettingTab, Setting } from "obsidian"; -import type GraphBannerPlugin from "./main"; +import type GraphBannerPlugin from "./main.ts"; export interface Settings { ignore: string[]; @@ -38,7 +38,7 @@ export class SettingTab extends PluginSettingTab { .onChange(async (value) => { this.plugin.settings.ignore = value.split("\n"); await this.plugin.saveData(this.plugin.settings); - }), + }) ); new Setting(containerEl) @@ -60,7 +60,7 @@ export class SettingTab extends PluginSettingTab { } this.plugin.settings.timeToRemoveLeaf = time; await this.plugin.saveData(this.plugin.settings); - }), + }) ); } } diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 6f3474b..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": ".", - "inlineSourceMap": true, - "inlineSources": true, - "module": "ESNext", - "target": "ES6", - "allowJs": true, - "noImplicitAny": true, - "moduleResolution": "Bundler", - "importHelpers": true, - "isolatedModules": true, - "strictNullChecks": true, - "lib": ["DOM", "ES5", "ES6", "ES7"] - }, - "include": ["**/*.ts"] -} diff --git a/versions.json b/versions.json index ee8f1e1..10fc566 100644 --- a/versions.json +++ b/versions.json @@ -1,25 +1,3 @@ { - "0.1.2": "1.5.11", - "0.1.3": "1.5.11", - "0.1.4": "1.5.11", - "0.1.5": "1.5.11", - "0.1.6": "1.5.11", - "0.1.7": "1.5.11", - "0.1.8": "1.5.11", - "0.1.9": "1.5.11", - "0.1.10": "1.5.11", - "0.1.11": "1.5.11", - "0.1.12": "1.5.11", - "1.0.0": "1.5.11", - "1.0.1": "1.5.11", - "1.0.3": "1.5.11", - "1.1.0": "1.5.11", - "1.1.1": "1.5.11", - "1.2.0": "1.5.11", - "1.3.0": "1.5.11", - "1.3.1": "1.5.11", - "1.3.2": "1.5.11", - "1.4.0": "1.5.11", - "1.4.1": "1.5.11", - "1.4.2": "1.5.11" + "0.1.2": "1.5.11" }