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

list links from specified page #107

Merged
merged 22 commits into from
Jan 21, 2024
Merged

Conversation

JQinglong
Copy link
Contributor

InstallActionに対して、-P でページを指定して、-eでリンクURLの絞り込み条件を指定するようにしました。
現時点では抽出したurlをconsoleに出力しています。
このようにして複数取得したurlについて実際のInstallAction(その他のオプション指定に従ってコンテンツの取得)を行いたいですが、そのためには、InstallActionの実体の処理を切り出して、それを呼び出すようにする必要があるのではないかと思いましたが、既存ソースへの改変が大きいため相談させていただきました。

@ryo-ma
Copy link
Collaborator

ryo-ma commented Mar 30, 2023

InstallActionの実体の処理を切り出して
どちらの部分のコードの想定でしょうか?

私の認識では以下の部分installFromURLをループで実行できれば良いと思っていますがいかがでしょうか?

dim/libs/actions.ts

Lines 82 to 97 in 337de17

const fullPath = await installFromURL(
url,
options.name,
options.postProcesses,
parsedHeaders,
).catch(
(error) => {
console.error(
Colors.red("Failed to install."),
Colors.red(error.message),
);
Deno.exit(1);
},
);
console.log(
Colors.green(`Installed to ${fullPath}`),

また、parsedHeadersも利用したいため、今回実装しているpageInstalll の処理をparsedHeadersの宣言以降に移動させたほうがいいですね。
最終的には、今回実装のpageInstallに関してはaction_helper/installer.tsの方にまとめてしまいたいと思ってます。
でも、まずは一旦は動く様にしましょうか。

@ryo-ma
Copy link
Collaborator

ryo-ma commented May 8, 2023

下部のCIで落ちてしまっているのでdeno fmtコマンドによってフォーマットしていただければと思います。

libs/actions.ts Outdated Show resolved Hide resolved
libs/actions.ts Outdated Show resolved Hide resolved
libs/actions.ts Outdated Show resolved Hide resolved
libs/actions.ts Show resolved Hide resolved
libs/actions.ts Outdated Show resolved Hide resolved
libs/actions.ts Outdated Show resolved Hide resolved
@ryo-ma
Copy link
Collaborator

ryo-ma commented Jun 26, 2023

CIがまたもやdeno fmtで落ちてますね。

libs/actions.ts Outdated Show resolved Hide resolved
libs/actions.ts Outdated Show resolved Hide resolved
libs/actions.ts Outdated Show resolved Hide resolved
libs/actions.ts Outdated Show resolved Hide resolved
@ryo-ma
Copy link
Collaborator

ryo-ma commented Jun 26, 2023

一通り修正が完了したら今回の処理部分の try の中の処理を 他のインストール処理と同様installFromPage()のような感じで libs/action_helper/installer.tsに処理をまとめたいですね。

@ryo-ma
Copy link
Collaborator

ryo-ma commented Jul 3, 2023

Github Action(CI)のlintでひっかかっちゃいましたね。 deno lint でチェックすると出てきます。

@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7196131) 100.00% compared to head (08ce138) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #107   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        20           
  Lines         1429      1510   +81     
  Branches       147       156    +9     
=========================================
+ Hits          1429      1510   +81     

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

@ryo-ma
Copy link
Collaborator

ryo-ma commented Jul 22, 2023

また少しフォーマットでCIが落ちてしまってますね。

JQinglong and others added 2 commits October 29, 2023 21:32
…hanges. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Committer: JQinglong <[email protected]>
#
# On branch feature/page-install
# Your branch is ahead of 'origin/feature/page-install' by 1 commit.
# (use "git push" to publish your local commits)
#
# Changes to be committed:
#	modified: libs/action_helper/installer.ts
#	modified: libs/actions.ts
#	modified: tests/libs/actions.install.test.ts
#	new file: tests/test_data/test-page-empty.html
#	new file: tests/test_data/test-page-invalid.html
#
@ryo-ma
Copy link
Collaborator

ryo-ma commented Oct 30, 2023

@JQinglong
あと以下の行だけですね。ここの分岐を通せたりしますか?それができて、あらためて動作確認したらマージしたいと思います。

https://app.codecov.io/gh/c-3lab/dim/pull/107?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=checks&utm_campaign=pr+comments&utm_term=c-3lab#4663a8fc79877a2f7b91c1d0c139accd-R322

@JQinglong
Copy link
Contributor Author

@ryo-ma
未実行になっている行ですが、何が問題でこれが必要だったのかわからなくなってしまったので、一旦外しました。
また前段階で何かのチェックにかかってしまうかもしれませんが、すみません・・・

@ryo-ma
Copy link
Collaborator

ryo-ma commented Jan 21, 2024

@JQinglong ありがとうございます。エラー処理周りは少し気になるところもありますが、とりあえずマージしてしまいましょうか。使っている中で問題があればまたプルリクで対応してきましょう。

@ryo-ma ryo-ma merged commit 8f80c37 into c-3lab:main Jan 21, 2024
3 checks passed
@JQinglong
Copy link
Contributor Author

マージありがとうございました。ぜひ、自分の開発でも使って、フィードバックもしていきたいと思っています。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants