diff --git a/esbuild.config.mjs b/esbuild.config.mjs index 99780ca..7097a14 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -1,52 +1,53 @@ -import esbuild from "esbuild"; -import process from "process"; -import builtins from 'builtin-modules' - -const banner = -`/* -THIS IS A GENERATED/BUNDLED FILE BY ESBUILD -if you want to view the source, please visit the github repository of this plugin -*/ -`; - -const prod = (process.argv[2] === 'production'); - -esbuild.build({ - banner: { - js: banner, - }, - entryPoints: ['main.ts'], - bundle: true, - external: [ - 'obsidian', - 'electron', - '@codemirror/autocomplete', - '@codemirror/closebrackets', - '@codemirror/collab', - '@codemirror/commands', - '@codemirror/comment', - '@codemirror/fold', - '@codemirror/gutter', - '@codemirror/highlight', - '@codemirror/history', - '@codemirror/language', - '@codemirror/lint', - '@codemirror/matchbrackets', - '@codemirror/panel', - '@codemirror/rangeset', - '@codemirror/rectangular-selection', - '@codemirror/search', - '@codemirror/state', - '@codemirror/stream-parser', - '@codemirror/text', - '@codemirror/tooltip', - '@codemirror/view', - ...builtins], - format: 'cjs', - watch: !prod, - target: 'es2016', - logLevel: "info", - sourcemap: prod ? false : 'inline', - treeShaking: true, - outfile: 'main.js', -}).catch(() => process.exit(1)); +import esbuild from "esbuild"; +import process from "process"; +import builtins from 'builtin-modules' + +const banner = +`/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source, please visit the github repository of this plugin +*/ +`; + +const prod = (process.argv[2] === 'production'); + +esbuild.build({ + banner: { + js: banner, + }, + entryPoints: ['main.ts'], + bundle: true, + external: [ + 'obsidian', + 'electron', + '@codemirror/autocomplete', + '@codemirror/closebrackets', + '@codemirror/collab', + '@codemirror/commands', + '@codemirror/comment', + '@codemirror/fold', + '@codemirror/gutter', + '@codemirror/highlight', + '@codemirror/history', + '@codemirror/language', + '@codemirror/lint', + '@codemirror/matchbrackets', + '@codemirror/panel', + '@codemirror/rangeset', + '@codemirror/rectangular-selection', + '@codemirror/search', + '@codemirror/state', + '@codemirror/stream-parser', + '@codemirror/text', + '@codemirror/tooltip', + '@codemirror/view', + ...builtins], + format: 'cjs', + watch: !prod, + target: 'es2016', + logLevel: "info", + sourcemap: prod ? false : 'inline', + treeShaking: true, + outfile: 'main.js', + minify: true +}).catch(() => process.exit(1)); diff --git a/main.ts b/main.ts index cf40a8c..4a9000c 100644 --- a/main.ts +++ b/main.ts @@ -19,7 +19,6 @@ export default class DoubanPlugin extends Plugin { log.warn(i18nHelper.getMessage('140101')); return; } - log.trace(`you choose item load data success: ${JSON.stringify(extract)}`); let content:string = this.doubanEtractHandler.parseText(extract, this.settings) if(content) { editor.replaceSelection(content); @@ -28,9 +27,7 @@ export default class DoubanPlugin extends Plugin { async search(searchTerm:string, editor: Editor) { - log.trace("[main] start search:" + searchTerm); const resultList = await Searcher.search(searchTerm, this.settings); - log.trace("[main] complete search:" + searchTerm + ",\n result list:" + JSON.stringify(resultList)); new DoubanFuzzySuggester(this, editor).showSearchList(resultList); } diff --git a/manifest.json b/manifest.json index 7583355..6d5e829 100644 --- a/manifest.json +++ b/manifest.json @@ -1,9 +1,9 @@ { "id": "obsidian-douban-plugin", "name": "Douban", - "version": "v1.4.3", + "version": "v1.5.0", "minAppVersion": "0.12.0", - "description": "This is a plugin that can import movies, books or musics info data from Douban for Obsidian .", + "description": "This is a plugin that can import movies/books/musics/notes/games info data from Douban for Obsidian .", "author": "Wanxp", "authorUrl": "https://obsidian-douban.wanxuping.com", "isDesktopOnly": false diff --git a/src/douban/data/handler/DoubanAbstractLoadHandler.ts b/src/douban/data/handler/DoubanAbstractLoadHandler.ts index f7133d6..1f448aa 100644 --- a/src/douban/data/handler/DoubanAbstractLoadHandler.ts +++ b/src/douban/data/handler/DoubanAbstractLoadHandler.ts @@ -50,7 +50,6 @@ export default abstract class DoubanAbstractLoadHandler throw: true }; request(requestUrlParam) - .then(e => {log.trace(e.toString());return e;}) .then(load) .then(this.parseSubjectFromHtml) .then(content => this.toEditor(editor, content)) diff --git a/src/douban/data/handler/DoubanGameLoadHandler.ts b/src/douban/data/handler/DoubanGameLoadHandler.ts index 58737a7..83e05ca 100644 --- a/src/douban/data/handler/DoubanGameLoadHandler.ts +++ b/src/douban/data/handler/DoubanGameLoadHandler.ts @@ -67,7 +67,6 @@ export default class DoubanGameLoadHandler extends DoubanAbstractLoadHandler } onChooseItem(item: DoubanSearchResultSubject, evt: MouseEvent | KeyboardEvent): void { - log.trace(`you chosen : ${JSON.stringify(item)}`) this.plugin.doubanEtractHandler.handle(item, this.editor); } @@ -50,4 +49,4 @@ class DoubanFuzzySuggester extends FuzzySuggestModal } } -} \ No newline at end of file +} diff --git a/src/douban/data/search/Search.ts b/src/douban/data/search/Search.ts index 2579565..b159d24 100644 --- a/src/douban/data/search/Search.ts +++ b/src/douban/data/search/Search.ts @@ -16,7 +16,6 @@ export default class Searcher { throw: true }; return request(requestUrlParam) - .then(a => {log.trace(a.toString()); return a;}) .then(load) .then(SearchParserHandler.parseSearch) .catch(e => log.error(i18nHelper.getMessage('130101')))