FIX - tags stopped working

This commit is contained in:
Owain Williams 2026-06-12 10:42:33 +01:00
parent be34e8a087
commit 3e008331df
5 changed files with 55 additions and 112 deletions

View file

@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Updated version references across package configuration files
- Removed unused dependencies: `dotenv`, `node-fetch`, `@types/node-fetch`, `builtin-modules`
- Plugin already uses Obsidian's `requestUrl` API instead of node-fetch
- Build configuration simplified with explicit Node.js built-ins list in esbuild config
- Resolves Obsidian compatibility flags for Node.js-specific packages
## [1.4.0] - Previous Release

View file

@ -1,6 +1,5 @@
import esbuild from "esbuild";
import process from "process";
import builtins from "builtin-modules";
const banner =
`/*
@ -32,8 +31,32 @@ const context = await esbuild.context({
"@lezer/highlight",
"@lezer/lr",
"@types/node",
"@types/node-fetch",
...builtins],
"assert",
"buffer",
"cluster",
"crypto",
"dgram",
"dns",
"domain",
"events",
"fs",
"http",
"https",
"net",
"os",
"path",
"process",
"querystring",
"readline",
"stream",
"string_decoder",
"tls",
"tty",
"url",
"util",
"vm",
"zlib"
],
format: "cjs",
target: "es2018",
logLevel: "info",

100
package-lock.json generated
View file

@ -11,17 +11,13 @@
"dependencies": {
"@umbraco/headless-client": "^0.9.0",
"crypto": "^1.0.1",
"dotenv": "^16.4.7",
"gray-matter": "^4.0.3",
"markdown-it": "^14.1.0",
"node-fetch": "^2.7.0"
"markdown-it": "^14.1.0"
},
"devDependencies": {
"@types/node": "^16.18.126",
"@types/node-fetch": "^2.6.12",
"@typescript-eslint/eslint-plugin": "5.29.0",
"@typescript-eslint/parser": "5.29.0",
"builtin-modules": "3.3.0",
"esbuild": "0.17.3",
"obsidian": "^1.8.7",
"tslib": "2.4.0",
@ -611,33 +607,6 @@
"dev": true,
"license": "MIT"
},
"node_modules/@types/node-fetch": {
"version": "2.6.12",
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.12.tgz",
"integrity": "sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/node": "*",
"form-data": "^4.0.0"
}
},
"node_modules/@types/node-fetch/node_modules/form-data": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz",
"integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==",
"dev": true,
"license": "MIT",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"es-set-tostringtag": "^2.1.0",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/@types/tern": {
"version": "0.23.9",
"resolved": "https://registry.npmjs.org/@types/tern/-/tern-0.23.9.tgz",
@ -996,19 +965,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/call-bind-apply-helpers": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
@ -1178,18 +1134,6 @@
"node": ">=6.0.0"
}
},
"node_modules/dotenv": {
"version": "16.4.7",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz",
"integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==",
"license": "BSD-2-Clause",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://dotenvx.com"
}
},
"node_modules/dunder-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
@ -2325,26 +2269,6 @@
"license": "MIT",
"peer": true
},
"node_modules/node-fetch": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
"license": "MIT",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
}
},
"node_modules/obsidian": {
"version": "1.8.7",
"resolved": "https://registry.npmjs.org/obsidian/-/obsidian-1.8.7.tgz",
@ -2790,12 +2714,6 @@
"node": ">=8.0"
}
},
"node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
"license": "MIT"
},
"node_modules/tslib": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
@ -2893,22 +2811,6 @@
"license": "MIT",
"peer": true
},
"node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
"license": "BSD-2-Clause"
},
"node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
"license": "MIT",
"dependencies": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",

View file

@ -13,10 +13,8 @@
"license": "MIT",
"devDependencies": {
"@types/node": "^16.18.126",
"@types/node-fetch": "^2.6.12",
"@typescript-eslint/eslint-plugin": "5.29.0",
"@typescript-eslint/parser": "5.29.0",
"builtin-modules": "3.3.0",
"esbuild": "0.17.3",
"obsidian": "^1.8.7",
"tslib": "2.4.0",
@ -25,10 +23,8 @@
"dependencies": {
"@umbraco/headless-client": "^0.9.0",
"crypto": "^1.0.1",
"dotenv": "^16.4.7",
"gray-matter": "^4.0.3",
"markdown-it": "^14.1.0",
"node-fetch": "^2.7.0"
"markdown-it": "^14.1.0"
},
"repository": {
"type": "git",

View file

@ -492,6 +492,7 @@ export class SettingTab extends PluginSettingTab {
*/
private renderBlockSettings(containerEl: HTMLElement, modeLabel: string): void {
let blockPropDropdown: HTMLSelectElement | null = null;
let tagsDropdownEl: HTMLSelectElement | null = null;
new Setting(containerEl)
.setName(`${modeLabel} property`)
@ -532,6 +533,23 @@ export class SettingTab extends PluginSettingTab {
blockPropDropdown.value = this.plugin.settings.blockPropertyAlias || '';
}
if (tagsDropdownEl) {
tagsDropdownEl.innerHTML = '';
const noneOption = document.createElement('option');
noneOption.value = '';
noneOption.text = '[None]';
tagsDropdownEl.appendChild(noneOption);
this.cachedDocTypeProperties.forEach((prop: any) => {
const option = document.createElement('option');
option.value = prop.alias;
option.text = prop.name || prop.alias;
tagsDropdownEl?.appendChild(option);
});
tagsDropdownEl.value = this.plugin.settings.tagsAlias || '';
}
});
})
.addDropdown(dropdown => {
@ -722,24 +740,24 @@ export class SettingTab extends PluginSettingTab {
.setName('Tags property')
.setDesc('Select the tags property on your document type (optional)')
.addDropdown(dropdown => {
const tagsDropdown = dropdown.selectEl;
tagsDropdownEl = dropdown.selectEl;
tagsDropdown.innerHTML = '';
tagsDropdownEl.innerHTML = '';
const noneOption = document.createElement('option');
noneOption.value = '';
noneOption.text = '[None]';
tagsDropdown.appendChild(noneOption);
tagsDropdownEl.appendChild(noneOption);
if (this.cachedDocTypeProperties.length > 0) {
this.cachedDocTypeProperties.forEach((prop: any) => {
const option = document.createElement('option');
option.value = prop.alias;
option.text = prop.name || prop.alias;
tagsDropdown.appendChild(option);
tagsDropdownEl?.appendChild(option);
});
}
tagsDropdown.value = this.plugin.settings.tagsAlias || '';
tagsDropdownEl.value = this.plugin.settings.tagsAlias || '';
dropdown.onChange(async (value) => {
this.plugin.settings.tagsAlias = value;