upgrade version to v1.5.0

This commit is contained in:
wanxp 2022-10-26 22:01:01 +08:00
parent 6fd21b7c97
commit 3525b1b402
7 changed files with 56 additions and 62 deletions

@ -1,52 +1,53 @@
import esbuild from "esbuild"; import esbuild from "esbuild";
import process from "process"; import process from "process";
import builtins from 'builtin-modules' import builtins from 'builtin-modules'
const banner = const banner =
`/* `/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin if you want to view the source, please visit the github repository of this plugin
*/ */
`; `;
const prod = (process.argv[2] === 'production'); const prod = (process.argv[2] === 'production');
esbuild.build({ esbuild.build({
banner: { banner: {
js: banner, js: banner,
}, },
entryPoints: ['main.ts'], entryPoints: ['main.ts'],
bundle: true, bundle: true,
external: [ external: [
'obsidian', 'obsidian',
'electron', 'electron',
'@codemirror/autocomplete', '@codemirror/autocomplete',
'@codemirror/closebrackets', '@codemirror/closebrackets',
'@codemirror/collab', '@codemirror/collab',
'@codemirror/commands', '@codemirror/commands',
'@codemirror/comment', '@codemirror/comment',
'@codemirror/fold', '@codemirror/fold',
'@codemirror/gutter', '@codemirror/gutter',
'@codemirror/highlight', '@codemirror/highlight',
'@codemirror/history', '@codemirror/history',
'@codemirror/language', '@codemirror/language',
'@codemirror/lint', '@codemirror/lint',
'@codemirror/matchbrackets', '@codemirror/matchbrackets',
'@codemirror/panel', '@codemirror/panel',
'@codemirror/rangeset', '@codemirror/rangeset',
'@codemirror/rectangular-selection', '@codemirror/rectangular-selection',
'@codemirror/search', '@codemirror/search',
'@codemirror/state', '@codemirror/state',
'@codemirror/stream-parser', '@codemirror/stream-parser',
'@codemirror/text', '@codemirror/text',
'@codemirror/tooltip', '@codemirror/tooltip',
'@codemirror/view', '@codemirror/view',
...builtins], ...builtins],
format: 'cjs', format: 'cjs',
watch: !prod, watch: !prod,
target: 'es2016', target: 'es2016',
logLevel: "info", logLevel: "info",
sourcemap: prod ? false : 'inline', sourcemap: prod ? false : 'inline',
treeShaking: true, treeShaking: true,
outfile: 'main.js', outfile: 'main.js',
}).catch(() => process.exit(1)); minify: true
}).catch(() => process.exit(1));

@ -19,7 +19,6 @@ export default class DoubanPlugin extends Plugin {
log.warn(i18nHelper.getMessage('140101')); log.warn(i18nHelper.getMessage('140101'));
return; return;
} }
log.trace(`you choose item load data success: ${JSON.stringify(extract)}`);
let content:string = this.doubanEtractHandler.parseText(extract, this.settings) let content:string = this.doubanEtractHandler.parseText(extract, this.settings)
if(content) { if(content) {
editor.replaceSelection(content); editor.replaceSelection(content);
@ -28,9 +27,7 @@ export default class DoubanPlugin extends Plugin {
async search(searchTerm:string, editor: Editor) { async search(searchTerm:string, editor: Editor) {
log.trace("[main] start search:" + searchTerm);
const resultList = await Searcher.search(searchTerm, this.settings); 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); new DoubanFuzzySuggester(this, editor).showSearchList(resultList);
} }

@ -1,9 +1,9 @@
{ {
"id": "obsidian-douban-plugin", "id": "obsidian-douban-plugin",
"name": "Douban", "name": "Douban",
"version": "v1.4.3", "version": "v1.5.0",
"minAppVersion": "0.12.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", "author": "Wanxp",
"authorUrl": "https://obsidian-douban.wanxuping.com", "authorUrl": "https://obsidian-douban.wanxuping.com",
"isDesktopOnly": false "isDesktopOnly": false

@ -50,7 +50,6 @@ export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject>
throw: true throw: true
}; };
request(requestUrlParam) request(requestUrlParam)
.then(e => {log.trace(e.toString());return e;})
.then(load) .then(load)
.then(this.parseSubjectFromHtml) .then(this.parseSubjectFromHtml)
.then(content => this.toEditor(editor, content)) .then(content => this.toEditor(editor, content))

@ -67,7 +67,6 @@ export default class DoubanGameLoadHandler extends DoubanAbstractLoadHandler<Dou
}else{ }else{
value = html(info.next.next).text().trim(); value = html(info.next.next).text().trim();
} }
log.trace(key + ":" + value);
valueMap.set(GameKeyValueMap.get(key), value); valueMap.set(GameKeyValueMap.get(key), value);
}) })

@ -33,7 +33,6 @@ class DoubanFuzzySuggester extends FuzzySuggestModal<DoubanSearchResultSubject>
} }
onChooseItem(item: DoubanSearchResultSubject, evt: MouseEvent | KeyboardEvent): void { onChooseItem(item: DoubanSearchResultSubject, evt: MouseEvent | KeyboardEvent): void {
log.trace(`you chosen : ${JSON.stringify(item)}`)
this.plugin.doubanEtractHandler.handle(item, this.editor); this.plugin.doubanEtractHandler.handle(item, this.editor);
} }
@ -50,4 +49,4 @@ class DoubanFuzzySuggester extends FuzzySuggestModal<DoubanSearchResultSubject>
} }
} }
} }

@ -16,7 +16,6 @@ export default class Searcher {
throw: true throw: true
}; };
return request(requestUrlParam) return request(requestUrlParam)
.then(a => {log.trace(a.toString()); return a;})
.then(load) .then(load)
.then(SearchParserHandler.parseSearch) .then(SearchParserHandler.parseSearch)
.catch(e => log.error(i18nHelper.getMessage('130101'))) .catch(e => log.error(i18nHelper.getMessage('130101')))