Clean up cross-package build coupling

This commit is contained in:
weishu
2026-05-20 19:29:43 +08:00
parent 6759cf4657
commit 83795c0630
22 changed files with 557 additions and 343 deletions
+2 -2
View File
@@ -172,8 +172,8 @@ export function getTunwgPath(): string {
return join(runtimePath(), 'tools', 'tunwg', tunwgBinary);
}
// Development mode: use downloaded binary from hub/tools/tunwg
// Development mode: use downloaded binary from shared/tools/tunwg
const platformDir = getPlatformDir();
const devBinaryName = isWin ? `tunwg-${platformDir}.exe` : `tunwg-${platformDir}`;
return join(__dirname, '..', '..', '..', 'hub', 'tools', 'tunwg', devBinaryName);
return join(__dirname, '..', '..', '..', 'shared', 'tools', 'tunwg', devBinaryName);
}
+6 -6
View File
@@ -4,7 +4,7 @@ import difftasticArchiveLicense from '../../tools/archives/difftastic-LICENSE' a
import ripgrepArchiveLicense from '../../tools/archives/ripgrep-LICENSE' assert { type: 'file' };
import difftasticLicense from '../../tools/licenses/difftastic-LICENSE' assert { type: 'file' };
import ripgrepLicense from '../../tools/licenses/ripgrep-LICENSE' assert { type: 'file' };
import tunwgLicense from '../../../hub/tools/tunwg/LICENSE' assert { type: 'file' };
import tunwgLicense from '../../../shared/tools/tunwg/LICENSE' assert { type: 'file' };
export interface EmbeddedAsset {
relativePath: string;
@@ -35,7 +35,7 @@ async function selectEmbeddedAssets(): Promise<EmbeddedAsset[]> {
] = await Promise.all([
import('../../tools/archives/difftastic-arm64-darwin.tar.gz', { assert: { type: 'file' } }),
import('../../tools/archives/ripgrep-arm64-darwin.tar.gz', { assert: { type: 'file' } }),
import('../../../hub/tools/tunwg/tunwg-arm64-darwin', { assert: { type: 'file' } })
import('../../../shared/tools/tunwg/tunwg-arm64-darwin', { assert: { type: 'file' } })
]);
return [
...COMMON_ASSETS,
@@ -53,7 +53,7 @@ async function selectEmbeddedAssets(): Promise<EmbeddedAsset[]> {
] = await Promise.all([
import('../../tools/archives/difftastic-x64-darwin.tar.gz', { assert: { type: 'file' } }),
import('../../tools/archives/ripgrep-x64-darwin.tar.gz', { assert: { type: 'file' } }),
import('../../../hub/tools/tunwg/tunwg-x64-darwin', { assert: { type: 'file' } })
import('../../../shared/tools/tunwg/tunwg-x64-darwin', { assert: { type: 'file' } })
]);
return [
...COMMON_ASSETS,
@@ -71,7 +71,7 @@ async function selectEmbeddedAssets(): Promise<EmbeddedAsset[]> {
] = await Promise.all([
import('../../tools/archives/difftastic-arm64-linux.tar.gz', { assert: { type: 'file' } }),
import('../../tools/archives/ripgrep-arm64-linux.tar.gz', { assert: { type: 'file' } }),
import('../../../hub/tools/tunwg/tunwg-arm64-linux', { assert: { type: 'file' } })
import('../../../shared/tools/tunwg/tunwg-arm64-linux', { assert: { type: 'file' } })
]);
return [
...COMMON_ASSETS,
@@ -89,7 +89,7 @@ async function selectEmbeddedAssets(): Promise<EmbeddedAsset[]> {
] = await Promise.all([
import('../../tools/archives/difftastic-x64-linux.tar.gz', { assert: { type: 'file' } }),
import('../../tools/archives/ripgrep-x64-linux.tar.gz', { assert: { type: 'file' } }),
import('../../../hub/tools/tunwg/tunwg-x64-linux', { assert: { type: 'file' } })
import('../../../shared/tools/tunwg/tunwg-x64-linux', { assert: { type: 'file' } })
]);
return [
...COMMON_ASSETS,
@@ -107,7 +107,7 @@ async function selectEmbeddedAssets(): Promise<EmbeddedAsset[]> {
] = await Promise.all([
import('../../tools/archives/difftastic-x64-win32.tar.gz', { assert: { type: 'file' } }),
import('../../tools/archives/ripgrep-x64-win32.tar.gz', { assert: { type: 'file' } }),
import('../../../hub/tools/tunwg/tunwg-x64-win32.exe', { assert: { type: 'file' } })
import('../../../shared/tools/tunwg/tunwg-x64-win32.exe', { assert: { type: 'file' } })
]);
return [
...COMMON_ASSETS,