-
Notifications
You must be signed in to change notification settings - Fork 312
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
chore: 初回ファイルの取得をbackendの関数として表現するようにする #2524
chore: 初回ファイルの取得をbackendの関数として表現するようにする #2524
Conversation
PRありです!! @sabonerune いつもすみません!何か気づいた点あればコメント頂けると心強いです…! |
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.
Copilot reviewed 5 out of 9 changed files in this pull request and generated no comments.
Files not reviewed (4)
- src/components/App.vue: Evaluated as low risk
- README.md: Evaluated as low risk
- src/backend/browser/sandbox.ts: Evaluated as low risk
- src/backend/electron/main.ts: Evaluated as low risk
自分の環境では問題なく動作しました。 Mac環境の場合はどうでしょうか? |
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.
@sabonerune ありです!!!
macOSで試した感じ、確かにファイルがわたされてせんでした!
良い感じにコードがまとまってるなと思います!!
もっとリファクタリングできそう・・・!!
いっぱいコメントしていますが、すでに確かめるために変更済みのコードがあるのでPR送ります!!
どういう観点があるのかわかると思うので、コメントと見比べてみてください 🙏
すみません。。。。checkout -bしてからPRしようとしてたのですが、完全にミスってPRに直接pushしてしまいました。。。 🙇 🙇 🙇 🙇 |
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!!
と言いつついろいろレビューコメントしたのですが、全部変更したプルリクエストを送ります!!
それをレビューいただいて問題無さそうであればこのPRもマージいただければ・・・!!
(勝手にコミットしてしまった点も含め、だいぶややこしいことになってしまってすみません。。)
vite.config.mts
Outdated
const doubleSeparatorIndex = process.argv.indexOf("--"); | ||
if (doubleSeparatorIndex !== -1) { |
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.
ダブルセパレーターというのがなにかわからない・・・かも?
うーん! doubleDashIndex
で!!
@@ -245,7 +245,24 @@ function checkMultiEngineEnabled(): boolean { | |||
return enabled; | |||
} | |||
|
|||
let filePathOnMac: string | undefined = undefined; | |||
function getArgv(): string[] { |
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/backend/electron/main.ts
Outdated
return []; | ||
} | ||
|
||
let initialFilePath: string | undefined = getArgv()[0]; |
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.
これどこで値が変わるのか全くわからない超危険コードなのでカプセル化したいですね。。。
とりあえずTODOコメントだけ足させていただきます!!
src/backend/electron/main.ts
Outdated
fs.existsSync(initialFilePath) && | ||
fs.statSync(initialFilePath).isFile() && |
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/components/App.vue
Outdated
@@ -163,6 +160,7 @@ onMounted(async () => { | |||
}); | |||
|
|||
// プロジェクトファイルが指定されていればロード | |||
const projectFilePath = await window.backend.getInitialProjectFilePath(); |
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.
あー backendに書いたあと、それを叩くactionsを書くのが一応決まりなんですよねー。。
守られてないとこも結構あるし、たぶん明文化されてないけど。。
actions作っちゃいますね!
src/components/App.vue
Outdated
@@ -163,6 +160,7 @@ onMounted(async () => { | |||
}); | |||
|
|||
// プロジェクトファイルが指定されていればロード | |||
const projectFilePath = await window.backend.getInitialProjectFilePath(); | |||
if (typeof projectFilePath === "string" && projectFilePath !== "") { |
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.
ここはstringかundefinedしかこないのと、空文字が来ることはなくなったのでifの中身変えたほうが良さそう!
問題なさそうなのでマージします。 |
内容
backend.getInitialProjectFilePath()
を追加します。関連 Issue
スクリーンショット・動画など
(なし)
その他
これのために
electron:serve
に引数を渡せるような改修をしました。