Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 自作 DI コンテナドライバの追加 #1271

Merged
merged 32 commits into from
Feb 6, 2024
Merged

Conversation

MikuroXina
Copy link
Collaborator

close #1270.

Type of Change:

リファクタリング

Details of implementation (実施内容)

新しく src/driver/ フォルダを追加しました. これはドライバ層という名前を付けたモジュールに相当するもので, runner, service, model などのアプリケーションの下位層がさらに依存する土台として用意しました.

これに DepRegistry クラスと型情報追加用の Dep0, ヘルパーの型エイリアスである GetDep0 などを追加して下位層を全体的にリファクタリングしました. また, 併せてテストコードも動作するように修正しました.

これによりエントリポイント側の注入処理に必要な引数が少なくなり, コードの見通しがかなり良くなったと思います.

Additional Information (追加情報)

モジュールの追加に伴い開発者向けドキュメントの更新が必要になるかもしれません. 要調査です.

@MikuroXina MikuroXina self-assigned this Feb 6, 2024
@MikuroXina MikuroXina requested a review from m1sk9 February 6, 2024 15:11
@github-actions github-actions bot added the T-@oreorebot2/bot Type: OreOreBot2 Bot (packages/bot) label Feb 6, 2024
Copy link

cloudflare-workers-and-pages bot commented Feb 6, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7d6e247
Status: ✅  Deploy successful!
Preview URL: https://6984f127.oreorebot2.pages.dev
Branch Preview URL: https://feat-1270.oreorebot2.pages.dev

View logs

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 172 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (main@7acae13). Click here to learn what that means.

❗ Current head 26223cc differs from pull request most recent head 7d6e247. Consider uploading reports for the commit 7d6e247 to get more accurate results

Files Patch % Lines
packages/bot/src/server/index.ts 0.00% 58 Missing ⚠️
packages/bot/src/service/command.ts 0.00% 39 Missing and 1 partial ⚠️
packages/bot/src/driver/dep-registry.ts 68.88% 8 Missing and 6 partials ⚠️
packages/bot/src/service/command/kaere.ts 71.79% 6 Missing and 5 partials ⚠️
packages/bot/src/adaptor/discord/member-stats.ts 0.00% 8 Missing ⚠️
packages/bot/src/service/command/help.ts 0.00% 4 Missing and 1 partial ⚠️
packages/bot/src/service/command/typo-record.ts 85.18% 0 Missing and 4 partials ⚠️
packages/bot/src/service/index.ts 0.00% 3 Missing and 1 partial ⚠️
packages/bot/src/model/random-generator.ts 95.16% 1 Missing and 2 partials ⚠️
packages/bot/src/service/command/judging.ts 57.14% 1 Missing and 2 partials ⚠️
... and 17 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1271   +/-   ##
=======================================
  Coverage        ?   58.94%           
=======================================
  Files           ?      112           
  Lines           ?     7325           
  Branches        ?      530           
=======================================
  Hits            ?     4318           
  Misses          ?     2478           
  Partials        ?      529           
Flag Coverage Δ
unittests 58.94% <72.48%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MikuroXina MikuroXina enabled auto-merge (squash) February 6, 2024 16:24
@MikuroXina MikuroXina merged commit 3dcf046 into main Feb 6, 2024
12 checks passed
@MikuroXina MikuroXina deleted the feat#1270 branch February 6, 2024 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-@oreorebot2/bot Type: OreOreBot2 Bot (packages/bot)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor: DI コンテナを追加する
2 participants