mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
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:
+10
-5
@@ -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`, {
|
||||
|
||||
Reference in New Issue
Block a user