From e68f86a5787c507d89f86bbc2c2c3d39f53aca13 Mon Sep 17 00:00:00 2001 From: zyrouge Date: Mon, 16 Oct 2023 20:55:08 +0530 Subject: [PATCH] refactor: rebrand --- .github/workflows/test-modules.yml | 2 +- README.md | 4 ++-- modules/anime/animepahe_com/config.dart | 0 modules/anime/animepahe_com/test.dart | 16 ++++++++++++---- modules/anime/gogoanime_bid/config.dart | 0 pubspec.yaml | 2 +- {test => store/test}/all.dart | 8 ++++---- test/files.dart => store/test/modules.dart | 14 +++++++------- 8 files changed, 27 insertions(+), 19 deletions(-) create mode 100644 modules/anime/animepahe_com/config.dart create mode 100644 modules/anime/gogoanime_bid/config.dart rename {test => store/test}/all.dart (97%) rename test/files.dart => store/test/modules.dart (58%) diff --git a/.github/workflows/test-modules.yml b/.github/workflows/test-modules.yml index 1e9b357..a823211 100644 --- a/.github/workflows/test-modules.yml +++ b/.github/workflows/test-modules.yml @@ -25,7 +25,7 @@ jobs: dart pub get - name: 🧪 Test modules - run: dart run ./test/all.dart --ci + run: dart run ./store/test/all.dart --ci - name: 🚀 Upload summary if: always() diff --git a/README.md b/README.md index a97848f..e697dfe 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@

- +

-# Tenka Modules +# Sora âš¡ Officially maintained Tenka modules by Yukino. Check module status [here](https://github.com/yukino-org/sora/tree/summary#readme). diff --git a/modules/anime/animepahe_com/config.dart b/modules/anime/animepahe_com/config.dart new file mode 100644 index 0000000..e69de29 diff --git a/modules/anime/animepahe_com/test.dart b/modules/anime/animepahe_com/test.dart index ec39b45..27302a0 100644 --- a/modules/anime/animepahe_com/test.dart +++ b/modules/anime/animepahe_com/test.dart @@ -13,17 +13,25 @@ abstract class MockedData { final MockedAnimeExtractor mocked = MockedAnimeExtractor( search: (final AnimeExtractor ext) async { - final List results = await ext.search('bunny girl', locale); + final List results = await ext.search( + 'bunny girl', + ext.defaultLocale, + ); MockedData.animeURL = results.first.url; return results; }, getInfo: (final AnimeExtractor ext) async { - final AnimeInfo result = await ext.getInfo(MockedData.animeURL, locale); + final AnimeInfo result = await ext.getInfo( + MockedData.animeURL, + ext.defaultLocale, + ); MockedData.episodeURL = result.episodes.first.url; return result; }, - getSource: (final AnimeExtractor ext) => - ext.getSource(MockedData.episodeURL, locale), + getSource: (final AnimeExtractor ext) => ext.getSource( + MockedData.episodeURL, + ext.defaultLocale, + ), ); Future main() async { diff --git a/modules/anime/gogoanime_bid/config.dart b/modules/anime/gogoanime_bid/config.dart new file mode 100644 index 0000000..e69de29 diff --git a/pubspec.yaml b/pubspec.yaml index e4e58d1..cd334fd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,4 +1,4 @@ -name: tenka_modules +name: sora description: "âš¡ Officially maintained Tenka modules by Yukino." version: 0.0.0 diff --git a/test/all.dart b/store/test/all.dart similarity index 97% rename from test/all.dart rename to store/test/all.dart index 19f53e3..8de8174 100644 --- a/test/all.dart +++ b/store/test/all.dart @@ -7,8 +7,8 @@ import 'package:path/path.dart' as path; import 'package:tenka/tenka.dart'; import 'package:tenka_dev_tools/tenka_dev_tools.dart'; import 'package:utilx/utils.dart'; -import '../tools/utils.dart'; -import 'files.dart'; +import '../../tools/utils.dart'; +import 'modules.dart'; class TestAll { final Map> animeResults = @@ -191,11 +191,11 @@ Future main(final List args) async { await tester.init(); final List Function()> fns = Function()>[ - ...TestFiles.anime.entries.map( + ...TestModules.anime.entries.map( (final MapEntry x) => () => tester.run(TenkaType.anime, x.key, () => x.value.run(x.key)), ), - ...TestFiles.manga.entries.map( + ...TestModules.manga.entries.map( (final MapEntry x) => () => tester.run(TenkaType.manga, x.key, () => x.value.run(x.key)), ), diff --git a/test/files.dart b/store/test/modules.dart similarity index 58% rename from test/files.dart rename to store/test/modules.dart index 28df7eb..1c875e7 100644 --- a/test/files.dart +++ b/store/test/modules.dart @@ -1,13 +1,13 @@ import 'package:tenka/tenka.dart'; import 'package:tenka_dev_tools/tenka_dev_tools.dart'; -import '../modules/anime/animepahe_com/test.dart' as animepahe_com; -import '../modules/anime/gogoanime_bid/test.dart' as gogoanime_bid; -import '../modules/anime/hanime_tv/test.dart' as hanime_tv; -import '../modules/manga/fanfox_net/test.dart' as fanfox_net; -import '../modules/manga/mangadex_org/test.dart' as mangadex_org; -import '../modules/manga/readm_org/test.dart' as readm_org; +import '../../modules/anime/animepahe_com/test.dart' as animepahe_com; +import '../../modules/anime/gogoanime_bid/test.dart' as gogoanime_bid; +import '../../modules/anime/hanime_tv/test.dart' as hanime_tv; +import '../../modules/manga/fanfox_net/test.dart' as fanfox_net; +import '../../modules/manga/mangadex_org/test.dart' as mangadex_org; +import '../../modules/manga/readm_org/test.dart' as readm_org; -abstract class TestFiles { +abstract class TestModules { static final Map anime = { animepahe_com.source: gogoanime_bid.mocked,