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 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));

@ -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);
}

@ -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

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

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

@ -33,7 +33,6 @@ class DoubanFuzzySuggester extends FuzzySuggestModal<DoubanSearchResultSubject>
}
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<DoubanSearchResultSubject>
}
}
}
}

@ -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')))