From 2022b056b719491f64a3057125570c25085f1632 Mon Sep 17 00:00:00 2001 From: Ashton Eby Date: Wed, 28 Feb 2024 11:02:43 -0800 Subject: [PATCH] (fix) address PR feedback https://github.com/obsidianmd/obsidian-releases/pull/3124 - removed fundingUrl - removed yaml dependency in favor of obsidian's parseYaml function - removed (unneeded) ribbon icon/action - removed logging --- main.ts | 17 +---------------- manifest.json | 5 ++--- package-lock.json | 11 ----------- package.json | 5 +---- 4 files changed, 4 insertions(+), 34 deletions(-) diff --git a/main.ts b/main.ts index 35fbd87..601ba88 100644 --- a/main.ts +++ b/main.ts @@ -14,19 +14,10 @@ export default class EgoRock extends Plugin { settings: Settings; async onload() { - this.addRibbonIcon('dice', 'Task lookup', () => { - exec('wsl task list limit:1', (error, stdout, stderr) => { - console.log(stdout) - if (error) new Notice(error.message) - else if (stderr && !stdout) new Notice(stderr) - else new Notice(stdout/*.split('\n').join('\t')*/) - }) - }) await this.loadSettings(); this.registerMarkdownCodeBlockProcessor('task-table', (source, element, context) => { - console.debug('input:', JSON.stringify(parse(source))) - this.doCommandReturnString(parse(source).command, element) + this.doCommandReturnString(parseYaml(source).command, element, this.settings.taskBinaryPath) }) } @@ -78,10 +69,6 @@ export default class EgoRock extends Plugin { } } - for(let i = 0; i < indices.length; i++) { - console.log(indices[i].columnName, header.slice(indices[i].startIndex, indices[i].endIndex)) - } - for(let rowIndex = 1; rowIndex < table.length; rowIndex++) { let rowObj: Record = {} for (let columnIndex = 0; columnIndex < indices.length; columnIndex++) { @@ -110,7 +97,6 @@ export default class EgoRock extends Plugin { if (line.match(/^\d+ tasks, \d+ shown*$/)) return false return true }) - console.log(newCommand) return this.buildTable(this.buildTableDescription(asciiTable), el) } else { throw new Error(`Taskwarrior command must be a report, was: ${report}.`) @@ -122,7 +108,6 @@ export default class EgoRock extends Plugin { const report = commandString.split(' ')[0] if (reports.includes(report)) { const newCommand = `${taskwarriorBin.trim()} ${this.buildCommandForReport(report)}` - console.log(newCommand) return JSON.parse(execSync(newCommand).toString()) } else if (report === 'export') { return JSON.parse(execSync(`${taskwarriorBin.trim()} ${commandString}`).toString()) diff --git a/manifest.json b/manifest.json index 7fa1e08..bb03605 100644 --- a/manifest.json +++ b/manifest.json @@ -1,11 +1,10 @@ { "id": "ego-rock", "name": "Ego Rock", - "version": "1.0.2", + "version": "1.0.3", "minAppVersion": "0.15.0", "description": "A basic taskwarrior UI for listing and modifying tasks.", "author": "Ashton Eby", "authorUrl": "https://blog.echobravoyahoo.net", - "fundingUrl": "https://blog.echobravoyahoo.net", "isDesktopOnly": true -} \ No newline at end of file +} diff --git a/package-lock.json b/package-lock.json index 932d677..8b38d33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,9 +8,6 @@ "name": "ego-rock", "version": "1.0.2", "license": "GPL-3.0-only", - "dependencies": { - "yaml": "^2.3.4" - }, "devDependencies": { "@types/node": "^16.11.6", "@typescript-eslint/eslint-plugin": "5.29.0", @@ -2215,14 +2212,6 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, - "node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", - "engines": { - "node": ">= 14" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index c5a63af..0dd0d6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ego-rock", - "version": "1.0.2", + "version": "1.0.3", "description": "A plugin for Obsidian that allows viewing taskwarrior tasks.", "main": "main.js", "scripts": { @@ -20,8 +20,5 @@ "obsidian": "latest", "tslib": "2.4.0", "typescript": "4.7.4" - }, - "dependencies": { - "yaml": "^2.3.4" } }