chore(package.json): upgrade bitsocial-react-hooks, stop yarn install from depending on kubo postinstall (#1090)

Removes the direct `kubo` install-time dependency and switches Electron dev to the repo-managed Kubo downloader in `electron/start-ipfs.js`. This keeps the hooks upgrade in place while avoiding the `dist.ipfs.tech` timeout during `yarn install`.
This commit is contained in:
Tommaso Casaburi
2026-03-16 19:20:59 +08:00
committed by GitHub
parent cdd87de446
commit 7bd51f00e1
5 changed files with 41 additions and 225 deletions
+10 -5
View File
@@ -10,6 +10,7 @@ const ipfsClientsPath = path.join(path.dirname(fileURLToPath(import.meta.url)),
const ipfsClientWindowsPath = path.join(ipfsClientsPath, 'win');
const ipfsClientMacPath = path.join(ipfsClientsPath, 'mac');
const ipfsClientLinuxPath = path.join(ipfsClientsPath, 'linux');
const kuboReleaseBaseUrl = 'https://github.com/ipfs/kubo/releases/download';
// plebbit kubo download links https://github.com/plebbit/kubo/releases
// const ipfsClientVersion = '0.20.0'
@@ -17,7 +18,6 @@ const ipfsClientLinuxPath = path.join(ipfsClientsPath, 'linux');
// const ipfsClientMacUrl = `https://github.com/plebbit/kubo/releases/download/v${ipfsClientVersion}/ipfs-darwin-amd64`
// const ipfsClientLinuxUrl = `https://github.com/plebbit/kubo/releases/download/v${ipfsClientVersion}/ipfs-linux-amd64`
// NOTE: Keep this version in sync with the kubo version in package.json to avoid repo version mismatches
const ipfsClientVersion = '0.39.0';
// Resolve desired build arch: allow overriding via env (so cross-arch builds pick correct binary)
@@ -33,11 +33,11 @@ const toKuboArch = (arch) => (arch === 'arm64' ? 'arm64' : 'amd64');
const getKuboUrl = (platform) => {
const arch = toKuboArch(resolveBuildArch());
if (platform === 'win32') return `https://dist.ipfs.io/kubo/v${ipfsClientVersion}/kubo_v${ipfsClientVersion}_windows-${arch}.zip`;
if (platform === 'darwin') return `https://dist.ipfs.io/kubo/v${ipfsClientVersion}/kubo_v${ipfsClientVersion}_darwin-${arch}.tar.gz`;
if (platform === 'linux') return `https://dist.ipfs.io/kubo/v${ipfsClientVersion}/kubo_v${ipfsClientVersion}_linux-${arch}.tar.gz`;
if (platform === 'win32') return `${kuboReleaseBaseUrl}/v${ipfsClientVersion}/kubo_v${ipfsClientVersion}_windows-${arch}.zip`;
if (platform === 'darwin') return `${kuboReleaseBaseUrl}/v${ipfsClientVersion}/kubo_v${ipfsClientVersion}_darwin-${arch}.tar.gz`;
if (platform === 'linux') return `${kuboReleaseBaseUrl}/v${ipfsClientVersion}/kubo_v${ipfsClientVersion}_linux-${arch}.tar.gz`;
// default to linux
return `https://dist.ipfs.io/kubo/v${ipfsClientVersion}/kubo_v${ipfsClientVersion}_linux-${arch}.tar.gz`;
return `${kuboReleaseBaseUrl}/v${ipfsClientVersion}/kubo_v${ipfsClientVersion}_linux-${arch}.tar.gz`;
};
const downloadWithProgress = (url) =>
@@ -61,6 +61,11 @@ const downloadWithProgress = (url) =>
return;
}
if (!res.statusCode || res.statusCode >= 400) {
reject(new Error(`Download request for ${url} failed with status ${res.statusCode ?? 'unknown'}`));
return;
}
const len = parseInt(res.headers['content-length'], 10);
console.log();
const bar = new ProgressBar(` ${fileName} [:bar] :rate/bps :percent :etas`, {