-
Notifications
You must be signed in to change notification settings - Fork 7
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
ディレクトリ配下のファイルでもプレビューだけ表示できるように修正 #121
Conversation
@@ -225,7 +225,8 @@ | |||
"@types/webpack-env": "^1.17.0", | |||
"@typescript-eslint/eslint-plugin": "^5.30.0", | |||
"@typescript-eslint/parser": "^5.30.0", | |||
"@vscode/test-web": "^0.0.26", | |||
"@vscode/test-web": "^0.0.65", | |||
"@vscode/vsce": "^3.2.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nits] vsce
は非推奨だから @vscode/vsce
に変えてねとコンソールに出たため従いました。
<span className={styles.topic}>{topic}</span> | ||
<span key={topic} className={styles.topic}> | ||
{topic} | ||
</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nits] ブラウザコンソールにエラーが出ていたので修正
article: new RegExp(/\/articles\/(?:[^/]+\/)*[^/]+\.md$/), | ||
bookChapter: new RegExp(/\/books\/[^/]+\/[^/]+\.md$/), | ||
bookConfig: new RegExp(`/books/[^/]+/${BOOK_CONFIG_FILE_PATTERN.source}$`), // prettier-ignore | ||
bookCoverImage: new RegExp(`/books/[^/]+/${BOOK_COVER_IMAGE_FILE_PATTERN.source}$`), // prettier-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[note] この部分をプレビューしようとしているファイルの妥当性に使用していました。ここをユーザーフォルダーが入っていても .test()
メソッドでパスするような正規表現に修正しています。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
後方一致にしたということですね!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
はい、そのとおりです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コメント確認お願いします!
article: new RegExp(/\/articles\/(?:[^/]+\/)*[^/]+\.md$/), | ||
bookChapter: new RegExp(/\/books\/[^/]+\/[^/]+\.md$/), | ||
bookConfig: new RegExp(`/books/[^/]+/${BOOK_CONFIG_FILE_PATTERN.source}$`), // prettier-ignore | ||
bookCoverImage: new RegExp(`/books/[^/]+/${BOOK_COVER_IMAGE_FILE_PATTERN.source}$`), // prettier-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
後方一致にしたということですね!
src/context/app.ts
Outdated
bookConfig: new RegExp(`^${booksFolderUri}/[^/]+/${BOOK_CONFIG_FILE_PATTERN.source}$`), // prettier-ignore | ||
bookCoverImage: new RegExp(`^${booksFolderUri}/[^/]+/${BOOK_COVER_IMAGE_FILE_PATTERN.source}$`), // prettier-ignore | ||
book: new RegExp(/\/books\/[^/]+\/?$/), | ||
article: new RegExp(/\/articles\/(?:[^/]+\/)*[^/]+\.md$/), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[q] ここだけ条件が変わっていると思うのですが意図した変更ですか?(articles以下のディレクトリが深くてもOKになっている?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとうございます。意図していませんでした。いろいろ試した結果の正規表現が残ってしまっていました。ご指摘ありがとうございます。ついでに 変数を使っていないところはわざわざ new RegExp()
を使う必要もないため、合わせて修正しました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTMです!
📑 Summary
セキュリティ上のリスクについて
により影響は小さいと考えています。
Resolves #120
📋 Tasks
プルリクエストを作成いただく際、お手数ですが以下の内容についてご確認をお願いします。
canary
ブランチに対するプルリクエストであるより詳しい内容は Pull Request Policy を参照してください。