From e1a1140d772b440c463bc62bec25e57a4eb49632 Mon Sep 17 00:00:00 2001 From: TfT Hacker Date: Sun, 15 Sep 2024 11:24:55 +0200 Subject: [PATCH] 1.0.3 Bug fixes --- CHANGELOG.md | 7 +++++++ manifest.json | 2 +- package.json | 26 +++++++++++++------------- src/main.ts | 50 ++++++++++++++++++++++++++++---------------------- versions.json | 3 ++- 5 files changed, 51 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7a84c9..b708c0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 1.0.3 + +### fix + +- modified main.ts to better conform to obdisidan.dt.ts +- chore: update all dependencies. + # 1.0.2 ### Fix diff --git a/manifest.json b/manifest.json index 7e7367e..2701b29 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian42-brat", "name": "BRAT", - "version": "1.0.2", + "version": "1.0.3", "minAppVersion": "1.4.16", "description": "Easily install a beta version of a plugin for testing.", "author": "TfTHacker", diff --git a/package.json b/package.json index bef88c1..4f76535 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "obsidian42-brat", - "version": "1.0.2", + "version": "1.0.3", "description": "Obsidian42 - Beta Reviewer's Autoupdate Tool.", "main": "main.js", "scripts": { - "dev": "node esbuild.config.mjs", - "build": "node esbuild.config.mjs production ", + "dev": "node --no-warnings esbuild.config.mjs", + "build": "node esbuild.config.mjs production", "version": "node version-bump.mjs", "githubaction": "node version-github-action.mjs", "lint:check": "eslint --ext .ts,.tsx .", @@ -20,20 +20,20 @@ "url": "git://github.com/TfTHacker/obsidian42-brat.git" }, "devDependencies": { - "typescript": "5.5.4", + "typescript": "5.6.2", "tslib": "^2.7.0", - "@types/node": "^22.5.1", - "@typescript-eslint/eslint-plugin": "^8.3.0", - "@typescript-eslint/parser": "^8.3.0", - "@typescript-eslint/utils": "^8.3.0", + "@types/node": "^22.5.5", + "@typescript-eslint/eslint-plugin": "^8.5.0", + "@typescript-eslint/parser": "^8.5.0", + "@typescript-eslint/utils": "^8.5.0", "builtin-modules": "4.0.0", "esbuild": "0.23.1", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.3", - "eslint-plugin-css": "^0.10.0", + "eslint-plugin-css": "^0.11.0", "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-import": "^2.29.1", + "eslint-plugin-import": "^2.30.0", "eslint-plugin-jsonc": "^2.16.0", "eslint-plugin-mdx": "^3.1.5", "eslint-plugin-only-warn": "^1.1.0", @@ -42,16 +42,16 @@ "eslint-plugin-yml": "^1.14.0", "@html-eslint/eslint-plugin": "^0.26.0", "@html-eslint/parser": "^0.26.0", - "husky": "^9.1.5", + "husky": "^9.1.6", "jsdom": "^25.0.0", - "lint-staged": "^15.2.9", + "lint-staged": "^15.2.10", "prettier": "^3.3.3", "remark-preset-lint-consistent": "^6.0.0", "remark-preset-lint-markdown-style-guide": "^6.0.0", "remark-preset-lint-recommended": "^7.0.0", "remark-preset-prettier": "^2.0.1", "ts-node": "^10.9.2", - "typedoc": "^0.26.6", + "typedoc": "^0.26.7", "@types/obsidian-typings": "github:Fevol/obsidian-typings", "obsidian": "1.6.6" }, diff --git a/src/main.ts b/src/main.ts index c53b29d..ac414e7 100644 --- a/src/main.ts +++ b/src/main.ts @@ -21,33 +21,39 @@ export default class ThePlugin extends Plugin { commands: PluginCommands = new PluginCommands(this); bratApi: BratAPI = new BratAPI(this); - async onload(): Promise { + onload() { console.log('loading ' + this.APP_NAME); - await this.loadSettings(); - this.addSettingTab(new BratSettingsTab(this.app, this)); + this.loadSettings() + .then(() => { + this.addSettingTab(new BratSettingsTab(this.app, this)); - addIcons(); - this.showRibbonButton(); - this.registerObsidianProtocolHandler('brat', this.obsidianProtocolHandler); + addIcons(); + this.showRibbonButton(); + this.registerObsidianProtocolHandler('brat', this.obsidianProtocolHandler); - this.app.workspace.onLayoutReady(() => { - // let obsidian load and calm down before checking for updates - if (this.settings.updateAtStartup) { - setTimeout(() => { - void this.betaPlugins.checkForPluginUpdatesAndInstallUpdates(false); - }, 60000); - } - if (this.settings.updateThemesAtStartup) { - setTimeout(() => { - void themesCheckAndUpdates(this, false); - }, 120000); - } - setTimeout(() => { - window.bratAPI = this.bratApi; - }, 500); - }); + this.app.workspace.onLayoutReady(() => { + // let obsidian load and calm down before checking for updates + if (this.settings.updateAtStartup) { + setTimeout(() => { + void this.betaPlugins.checkForPluginUpdatesAndInstallUpdates(false); + }, 60000); + } + if (this.settings.updateThemesAtStartup) { + setTimeout(() => { + void themesCheckAndUpdates(this, false); + }, 120000); + } + setTimeout(() => { + window.bratAPI = this.bratApi; + }, 500); + }); + }) + .catch((error: unknown) => { + console.error('Failed to load settings:', error); + }); } + showRibbonButton(): void { this.addRibbonIcon('BratIcon', 'BRAT', () => { this.commands.ribbonDisplayCommands(); diff --git a/versions.json b/versions.json index db4eb63..f7cc06d 100644 --- a/versions.json +++ b/versions.json @@ -4,5 +4,6 @@ "0.8.0": "1.4.16", "1.0.0": "1.4.16", "1.0.1": "1.4.16", - "1.0.2": "1.4.16" + "1.0.2": "1.4.16", + "1.0.3": "1.4.16" } \ No newline at end of file