diff --git a/esbuild.config.mjs b/esbuild.config.mjs index a5de8b8..ee2aa92 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -1,6 +1,6 @@ import esbuild from "esbuild"; import process from "process"; -import builtins from "builtin-modules"; +import { builtinModules } from "node:module"; const banner = `/* @@ -31,7 +31,8 @@ const context = await esbuild.context({ "@lezer/common", "@lezer/highlight", "@lezer/lr", - ...builtins], + ...builtinModules, + ...builtinModules.map((m) => `node:${m}`)], format: "cjs", target: "es2018", logLevel: "info", diff --git a/main.ts b/main.ts index 0234ae2..0e4800f 100644 --- a/main.ts +++ b/main.ts @@ -71,7 +71,7 @@ export default class TableOfContentsPlugin extends Plugin { } async loadSettings() { - this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData()); + this.settings = Object.assign({}, DEFAULT_SETTINGS, (await this.loadData()) as Partial | null); } async saveSettings() { @@ -153,7 +153,7 @@ export default class TableOfContentsPlugin extends Plugin { } } else { await this.app.vault.process(file, (content) => replaceTOC(content, toc, isTitle)); - await this.app.fileManager.processFrontMatter(file, (frontmatter) => { + await this.app.fileManager.processFrontMatter(file, (frontmatter: Record) => { frontmatter[TOC_FRONTMATTER_KEY] = { generated: true }; }); new Notice('Table of contents updated'); @@ -188,7 +188,7 @@ export default class TableOfContentsPlugin extends Plugin { await this.app.vault.process(file, (content) => removeTOCSection(content, isTitle)); } if (hasMetadata) { - await this.app.fileManager.processFrontMatter(file, (frontmatter) => { + await this.app.fileManager.processFrontMatter(file, (frontmatter: Record) => { delete frontmatter[TOC_FRONTMATTER_KEY]; }); } @@ -301,7 +301,6 @@ class TOCSettingTab extends PluginSettingTab { .addSlider(slider => slider .setLimits(1, 6, 1) .setValue(this.plugin.settings.maxDepth) - .setDynamicTooltip() .onChange(async (value) => { this.plugin.settings.maxDepth = value; await this.plugin.saveSettings(); diff --git a/manifest.json b/manifest.json index 2101a47..6e11dc1 100644 --- a/manifest.json +++ b/manifest.json @@ -3,9 +3,8 @@ "name": "Table of Contents Generator", "version": "1.1.0", "minAppVersion": "1.7.2", - "description": "Generate a table of contents for your notes", + "description": "Generate a table of contents for your notes.", "author": "Matt Kaili", "authorUrl": "https://github.com/m-kk", - "isDesktopOnly": false, - "fundingUrl": "https://www.buymeacoffee.com/mkk" + "isDesktopOnly": false } diff --git a/package-lock.json b/package-lock.json index b5d58de..44fd4c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,17 @@ { "name": "obsidian-toc-generator", - "version": "1.0.0", + "version": "1.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "obsidian-toc-generator", - "version": "1.0.0", + "version": "1.1.0", "license": "MIT", "devDependencies": { "@types/node": "^22.20.1", "@typescript-eslint/eslint-plugin": "5.29.0", "@typescript-eslint/parser": "5.29.0", - "builtin-modules": "3.3.0", "esbuild": "0.25.9", "obsidian": "latest", "tslib": "2.4.0", @@ -1491,19 +1490,6 @@ "node": ">=8" } }, - "node_modules/builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", diff --git a/package.json b/package.json index 05a5332..63a3a78 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "@types/node": "^22.20.1", "@typescript-eslint/eslint-plugin": "5.29.0", "@typescript-eslint/parser": "5.29.0", - "builtin-modules": "3.3.0", "esbuild": "0.25.9", "obsidian": "latest", "tslib": "2.4.0",