Skip to content

Commit

Permalink
update package dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ronny1982 committed Aug 2, 2024
1 parent 817daf6 commit e7e3c79
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 46 deletions.
4 changes: 3 additions & 1 deletion app/electron/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';

export default tseslint.config({
files: [
Expand All @@ -7,6 +8,7 @@ export default tseslint.config({
plugins: {
'@typescript-eslint': tseslint.plugin,
//'eslint-plugin-tsdoc': ...,
'@stylistic': stylistic,
},
languageOptions: {
ecmaVersion: 2018,
Expand All @@ -17,7 +19,7 @@ export default tseslint.config({
rules: {
'semi': [ 'error', 'always' ],
'no-extra-parens': 'off',
'@typescript-eslint/no-extra-parens': 'error',
'@stylistic/no-extra-parens': 'error',
'@typescript-eslint/no-unused-vars': [ 'error', { 'argsIgnorePattern': '^_' } ],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/ban-ts-comment': 'warn',
Expand Down
4 changes: 2 additions & 2 deletions app/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"yargs": "17.7.2"
},
"devDependencies": {
"@types/ws": "8.5.11",
"@types/ws": "8.5.12",
"extract-zip": "2.0.1",
"electron": "31.3.0",
"electron": "31.3.1",
"plist": "3.1.0"
},
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion app/nw/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';

export default tseslint.config({
files: [
Expand All @@ -7,6 +8,7 @@ export default tseslint.config({
plugins: {
'@typescript-eslint': tseslint.plugin,
//'eslint-plugin-tsdoc': ...,
'@stylistic': stylistic,
},
languageOptions: {
ecmaVersion: 2018,
Expand All @@ -17,7 +19,7 @@ export default tseslint.config({
rules: {
'semi': [ 'error', 'always' ],
'no-extra-parens': 'off',
'@typescript-eslint/no-extra-parens': 'error',
'@stylistic/no-extra-parens': 'error',
'@typescript-eslint/no-unused-vars': [ 'error', { 'argsIgnorePattern': '^_' } ],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/ban-ts-comment': 'warn',
Expand Down
4 changes: 2 additions & 2 deletions app/nw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"yargs": "17.7.2"
},
"devDependencies": {
"@types/ws": "8.5.11",
"@types/ws": "8.5.12",
"extract-zip": "2.0.1",
"nw": "0.89.0-sdk",
"nw": "0.90.0-sdk",
"plist": "3.1.0"
},
"scripts": {
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@
"docs"
],
"devDependencies": {
"@stylistic/eslint-plugin": "^2.6.1",
"@types/chrome": "^0.0.269",
"@types/jsdom": "^21.1.7",
"@types/nw.js": "^0.13.21",
"eslint": "^9.8.0",
"eslint-plugin-tsdoc": "^0.3.0",
"jsdom": "^24.1.1",
"puppeteer-core": "^22.14.0",
"puppeteer-core": "^22.15.0",
"tslib": "^2.6.3",
"typescript": "^5.5.4",
"typescript-eslint": "^7.17.0",
"typescript-eslint": "^8.0.0",
"vite": "^5.3.5",
"vitest": "^2.0.4",
"vitest": "^2.0.5",
"vitest-mock-extended": "^2.0.0"
},
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion web/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';

export default tseslint.config({
files: [
Expand All @@ -9,6 +10,7 @@ export default tseslint.config({
plugins: {
'@typescript-eslint': tseslint.plugin,
//'eslint-plugin-tsdoc': ...,
'@stylistic': stylistic,
},
languageOptions: {
ecmaVersion: 2018,
Expand All @@ -19,7 +21,7 @@ export default tseslint.config({
rules: {
'semi': [ 'error', 'always' ],
'no-extra-parens': 'off',
'@typescript-eslint/no-extra-parens': 'error',
'@stylistic/no-extra-parens': 'error',
'@typescript-eslint/no-unused-vars': [ 'error', { 'argsIgnorePattern': '^_' } ],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/ban-ts-comment': 'warn',
Expand Down
8 changes: 4 additions & 4 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"protobufjs": "^7.3.2"
},
"devDependencies": {
"@fluentui/svg-icons": "^1.1.250",
"@fluentui/svg-icons": "^1.1.252",
"@fluentui/web-components": "^2.6.1",
"@microsoft/fast-element": "^1.13.0",
"@svelte-put/dragscroll": "^3.0.1",
Expand All @@ -22,7 +22,7 @@
"@types/react-dom": "^18.3.0",
"@types/wicg-file-system-access": "^2023.10.5",
"@vitejs/plugin-react": "^4.3.1",
"@vitejs/plugin-vue": "^5.1.1",
"@vitejs/plugin-vue": "^5.1.2",
"@vscode/codicons": "^0.0.36",
"carbon-components-svelte": "^0.85.0",
"carbon-icons-svelte": "^12.10.0",
Expand All @@ -31,9 +31,9 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"svelte": "^4.2.18",
"svelte-check": "^3.8.4",
"svelte-check": "^3.8.5",
"svelte-preprocess": "^6.0.2",
"vue": "^3.4.34",
"vue": "^3.4.35",
"vue-tsc": "^2.0.29"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion web/src/engine/platform/electron/FetchProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default class extends FetchProvider {
await destroy();
resolve(result);
}
} catch(error) {
} catch {
await destroy();
}
});
Expand Down
15 changes: 8 additions & 7 deletions web/src/engine/websites/Alphapolis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ import { Exception } from '../Error';
import { WebsiteResourceKey as R } from '../../i18n/ILocale';
import { AddAntiScrapingDetection, FetchRedirection } from '../platform/AntiScrapingDetection';

type JSONPages = [JSONObject | string]

AddAntiScrapingDetection(async (render) => {
const dom = await render();
return dom.documentElement.innerHTML.includes('window.awsWafCookieDomainList') ? FetchRedirection.Automatic : undefined;
});

function ChaptersExtractor(element: HTMLElement) {

const id = element instanceof HTMLAnchorElement ? element.pathname : element.querySelector<HTMLAnchorElement>('a.read-episode').pathname;
const title = element.querySelector('.title').textContent.trim();
return { id, title };
Expand Down Expand Up @@ -48,13 +45,17 @@ export default class extends DecoratableMangaScraper {
let viewer: HTMLElement = undefined;
try {
[viewer] = await FetchCSS(new Request(new URL(chapter.Identifier, this.URI)), '[v-bind\\:pages]');
} catch (error) {
} catch { // TODO: Do not use same message for generic errors
throw new Exception(R.Plugin_Common_Chapter_UnavailableError);
}
const pages: JSONPages = JSON.parse(viewer.getAttribute('v-bind:pages'));
const links: unknown[] = JSON.parse(viewer.getAttribute('v-bind:pages'));
const isVertical = viewer.getAttribute('v-bind:is-vertical-manga') === '1';
return pages.filter(element => typeof element === 'string' && !element.match('white_page') && element != '').map(element => new Page(this, chapter, isVertical ? new URL(element as string) : new URL((element as string).replace(/\/[0-9]+x[0-9]+/, '/1080x1536')), isVertical ? undefined : { fallbackURL: element }));

return (links
.filter(link => link && typeof link === 'string' && !/white_page/.test(link)) as string[])
.map(link => {
const uri = new URL(isVertical ? link : link.replace(/\/[0-9]+x[0-9]+/, '/1080x1536'));
return new Page(this, chapter, uri, isVertical ? null : { fallbackURL: link });
});
}

//Since high resolution is not always available, use the real picture url instead of the forces one in case of failure
Expand Down
2 changes: 1 addition & 1 deletion web/src/engine/websites/ComicFuz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default class extends DecoratableMangaScraper {
let data: MangaViewerResponse = undefined;
try {
data = await FetchProto<MangaViewerResponse>(request, protoTypes, 'ComicFuz.MangaViewerResponse');
} catch (error) {
} catch { // TODO: Do not use same message for generic errors
throw new Exception(R.Plugin_Common_Chapter_UnavailableError);
}
return data.pages
Expand Down
3 changes: 1 addition & 2 deletions web/src/engine/websites/ComicK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default class extends DecoratableMangaScraper {
try {
const data = await FetchJSON<APIManga[]>(new Request(new URL(`v1.0/search?page=${page}&limit=49`, this.apiUrl)));
return data.map(item => new Manga(this, provider, item.hid, item.title.trim()));
} catch (error) {
} catch { // TODO: Do not return empty list for generic errors
return [];
}
}
Expand Down Expand Up @@ -136,5 +136,4 @@ export default class extends DecoratableMangaScraper {
const { chapter: { md_images } } = await FetchJSON<APISingleChapter>(new Request(new URL(`/chapter/${chapter.Identifier}`, this.apiUrl)));
return md_images.map(image => new Page(this, chapter, new URL(image.b2key, `https://s3.comick.ink/comick/`), { Referer: this.URI.href }));
}

}
4 changes: 1 addition & 3 deletions web/src/engine/websites/CopyManga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export default class extends DecoratableMangaScraper {
//this.Settings.url = new Text('urloverride', W.Plugin_Settings_UrlOverride, W.Plugin_Settings_UrlOverrideInfo, this.URI.href);
//(this.Settings.url as Text).Subscribe(value => this.URI.href = value);
//this.URI.href = this.Settings.url.Value as string;

}

public override get Icon() {
Expand Down Expand Up @@ -81,7 +80,7 @@ export default class extends DecoratableMangaScraper {
const request = this.CreateApiRequest(`/api/v3/comics?ordering=-datetime_updated&limit=50&offset=${page * 50}`);
const data = await FetchJSON<APIResponse<APIResultList<APIComic>>>(request);
return data.results.list.map(item => new Manga(this, provider, item.path_word, item.name.trim()));
} catch (error) {
} catch { // TODO: Do not return empty list for generic errors
return [];
}
}
Expand All @@ -100,7 +99,6 @@ export default class extends DecoratableMangaScraper {
const imageData = dataElement.getAttribute('contentKey');
const images = await this.Decrypt<APIPage[]>(imageData);
return images.map(image => new Page(this, chapter, new URL(image.url)));

}

private async Decrypt<T>(encryptedData: string): Promise<T> {
Expand Down
2 changes: 1 addition & 1 deletion web/src/engine/websites/DynastyScans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class extends DecoratableMangaScraper {
}
}
}
catch (error) {
catch { // TODO: Do not return incomplete list for generic errors
run = false;
}
}
Expand Down
6 changes: 1 addition & 5 deletions web/src/engine/websites/MangaFire.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,14 @@ export default class extends DecoratableMangaScraper {
const id = JSON.stringify({ itemid: chapter.dataset.id, itemtype: type, language: language });
const title = chapter.text.trim();
const newChapter = new Chapter(this, manga, id, title);
try {
if(chapterLanguageMap[language]) {
newChapter.Tags.push(chapterLanguageMap[language]);
} catch (error) {
//console.warn('Unable to find language')
}
chapterList.push(newChapter);
});
}
}
return chapterList;

}

public override async FetchPages(chapter: Chapter): Promise<Page[]> {
Expand Down Expand Up @@ -134,6 +131,5 @@ export default class extends DecoratableMangaScraper {
}

});

}
}
7 changes: 3 additions & 4 deletions web/src/engine/websites/MangaNexus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,11 @@ export default class extends DecoratableMangaScraper {
try {
const url = new URL(`/_next/data/${this.nextBuild}/lista-de-mangas.json?p=${page}`, this.URI).href;
const request = new Request(url);
const data = await FetchJSON<JSONMangas>(request);
return data.pageProps.mangas.items.map(element => new Manga(this, provider, element.slug, element.name.trim()));
} catch (error) {
const { pageProps: { mangas: { items } } } = await FetchJSON<JSONMangas>(request);
return items.map(item => new Manga(this, provider, item.slug, item.name.trim()));
} catch { // TODO: Do not return empty list for generic errors
return [];
}

}

public override async FetchChapters(manga: Manga): Promise<Chapter[]> {
Expand Down
12 changes: 6 additions & 6 deletions web/src/engine/websites/ShonenMagazine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ export default class extends DecoratableMangaScraper {
//Shonenmagazine.com && pocket.shonenmagazine.com mangas url starts with https://pocket.shonenmagazine.com so this plugin handles both.
super('shonenmagazine', `週刊少年マガジ (Weekly Shonen Magazine & Pocket Magazine)`, 'https://pocket.shonenmagazine.com', Tags.Language.Japanese, Tags.Source.Official, Tags.Media.Manga);
}

public override get Icon() {
return icon;
}

public override async FetchMangas(provider: MangaPlugin): Promise<Manga[]> {

//fetch from pocket.shonenmagazine.com
const mangas1 = await CoreView.FetchMangasMultiPageCSS.call(this, provider, ['/series'], 'div.series-items ul.daily-series > li.daily-series-item > a');
let mangas2 = [];
try {
//fetch from shonenmagazine.com
this.URI.href = 'https://shonenmagazine.com';
// TODO: Do not change a read-only property, this may cause problems for concurrent operations!
this.URI.hostname = 'shonenmagazine.com';
mangas2 = await CoreView.FetchMangasMultiPageCSS.call(this, provider, ['/series/smaga', '/series/bmaga', '/series/others'], 'article.serial-series-contents ul.serial-series-list > li.serial-series-item > a');
} catch (error) {
} catch { // Do not supress generic errors
//
}
this.URI.href = 'https://pocket.shonenmagazine.com';
// TODO: Do not change a read-only property, this may cause problems for concurrent operations!
this.URI.hostname = 'pocket.shonenmagazine.com';
return [...mangas1, ...mangas2];
}
}
2 changes: 1 addition & 1 deletion web/src/engine/websites/SundayWebry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default class extends DecoratableMangaScraper {
return {
chapters: chapters.reverse(), nextUrl: data.nextUrl
};
} catch (error) {
} catch { // TODO: Do not return incomplete list for generic errors
return { chapters: [], nextUrl: '' };
}
}
Expand Down
2 changes: 1 addition & 1 deletion web/src/engine/websites/decorators/MangaReaderCMS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function ChapterPageExtractor(this: MangaScraper, image: HTMLImageElement
try {
const src = image.dataset['src'].split('://').pop();
return decodeURIComponent(window.atob(src || undefined));
} catch (error) {
} catch { // TODO: Do not return url for generic errors
const src = (image.dataset['src'] || image.src).trim();
return new URL(src, this.URI).href;
}
Expand Down

0 comments on commit e7e3c79

Please sign in to comment.