Skip to content

Conversation

@sevenc-nanashi
Copy link
Member

内容

タイトル通りです。

関連 Issue

(なし)

スクリーンショット・動画など

(なし)

その他

(なし)

@sevenc-nanashi sevenc-nanashi requested a review from a team as a code owner July 12, 2025 16:18
@sevenc-nanashi sevenc-nanashi requested review from Hiroshiba and removed request for a team July 12, 2025 16:18
@Hiroshiba Hiroshiba requested a review from Copilot July 12, 2025 16:20
Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ちなみにこれって、起こり得る致命的な問題とかありますかね?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

A migration of the Electron Builder setup and related build scripts from CommonJS to TypeScript/ESM, with a dynamic loader for the TS config.

  • Updated the electron:build script in package.json to point at a new CJS loader and added jiti for TS imports.
  • Converted split/archive and post-build hooks (splitNsisArchive, afterAllArtifactBuild, afterNsisWebArtifactBuild) to TypeScript with ESM imports and type annotations.
  • Introduced electronBuilderConfigLoader.cjs to load a TS-based electronBuilderConfig.ts, removed legacy CJS config files.

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package.json Switched build command to custom CJS loader, added jiti dependency
build/splitNsisArchive.ts Migrated to TS/ESM, added type annotations, improved error throws
build/electronBuilderConfigLoader.cjs New loader module to import TS config via jiti
build/electronBuilderConfig.ts TS-based Electron Builder config with imports, replaced __dirname
build/afterNsisWebArtifactBuild.ts New TS hook wrapping splitNsisArchive
build/afterNsisWebArtifactBuild.cjs Removed legacy CJS wrapper
build/afterAllArtifactBuild.ts Migrated main post-build hook to TS, returns array
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (3)

build/splitNsisArchive.ts:22

  • [nitpick] The constant name ErrorMessage is in PascalCase, while the earlier error uses lowerCamelCase (errorMessage). Rename this to errorMessage for consistency.
    const ErrorMessage = "Project version is undefined.";

build/afterAllArtifactBuild.ts:18

  • Returning an empty array from the afterAllArtifactBuild hook overrides the default artifact list behavior. Confirm whether you intend to return no additional artifacts or should simply return void to preserve existing artifacts.
  return [];

build/electronBuilderConfig.ts:7

  • import.meta.dirname is not a standard property in ES modules. To get the current file directory, use something like:
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const rootDir = path.join(__dirname, '..');
const rootDir = path.join(import.meta.dirname, "..");

@sevenc-nanashi
Copy link
Member Author

思いつく限りではないですね。electron-builderの視点ではコンフィグを返す(非同期な)関数またはコンフィグそのものを受け取っていれば問題ない、そしてこれもそのコンフィグを返す関数というのは変わっていないので。

@voicevox-preview-pages
Copy link

voicevox-preview-pages bot commented Jul 12, 2025

🚀 プレビュー用ページを作成しました 🚀

更新時点でのコミットハッシュ:43e77cc

@Hiroshiba
Copy link
Member

なるほどです!

jiti採用はわりと良さそうなんですが、念の為メンテナとして、ライブラリの選定基準をどれくらい満たしてるのか気にしておいても良いかもと思いました!
VOICEVOXの依存ライブラリの選定基準
https://github.com/VOICEVOX/voicevox_project/blob/main/docs/判断等メモ.md#依存ライブラリの選定基準

@Hiroshiba
Copy link
Member

📝 以前jitiについて話した記憶があったのでメモ
eslintのconfigもtsにできそう! #2560 (comment)

@sevenc-nanashi
Copy link
Member Author

  • 160M/month
  • unjs製(Nuxtとかのとこのはず?)
  • だいぶ使われてる
  • 何かあったら引き剥がせる(具体的にはesbuildとかで手動実装するとか、jsに戻すとか)
  • 最終コミット4ヶ月前

なので問題なさそう?

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なので問題なさそう?

なるほどです、良さそう!!!
ライブラリによってはテストコードの充実度を見ておくのも良さそう。(electron-storeの経験 😇 )


LGTM!!

1つzodの提案していますが、もしよければくらいの気持ちです!

// else: nop
}
};
return [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝
これ何が入るんだろうと思ったら // you can return additional files to publish とのこと。
分かりづらい!

@sevenc-nanashi
Copy link
Member Author

特に問題なさそうなのでマージします。

@sevenc-nanashi sevenc-nanashi enabled auto-merge July 12, 2025 22:39
@sevenc-nanashi sevenc-nanashi added this pull request to the merge queue Jul 12, 2025
Merged via the queue into VOICEVOX:main with commit f77ff85 Jul 12, 2025
12 checks passed
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