Skip to content

Commit

Permalink
Use bgipfs for upload (#1039)
Browse files Browse the repository at this point in the history
  • Loading branch information
azf20 authored Feb 21, 2025
1 parent ae1338f commit b1da2ca
Show file tree
Hide file tree
Showing 5 changed files with 4,655 additions and 112 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"test": "yarn hardhat:test",
"vercel": "yarn workspace @se-2/nextjs vercel",
"vercel:yolo": "yarn workspace @se-2/nextjs vercel:yolo",
"ipfs": "yarn workspace @se-2/nextjs ipfs",
"vercel:login": "yarn workspace @se-2/nextjs vercel:login",
"verify": "yarn hardhat:verify"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/nextjs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ yarn-error.log*

# typescript
*.tsbuildinfo

ipfs-upload.config.json
10 changes: 10 additions & 0 deletions packages/nextjs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,14 @@ const nextConfig = {
},
};

const isIpfs = process.env.NEXT_PUBLIC_IPFS_BUILD === "true";

if (isIpfs) {
nextConfig.output = "export";
nextConfig.trailingSlash = true;
nextConfig.images = {
unoptimized: true,
};
}

module.exports = nextConfig;
3 changes: 3 additions & 0 deletions packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"start": "next dev",
"vercel": "vercel --build-env YARN_ENABLE_IMMUTABLE_INSTALLS=false --build-env ENABLE_EXPERIMENTAL_COREPACK=1 --build-env VERCEL_TELEMETRY_DISABLED=1",
"vercel:yolo": "vercel --build-env YARN_ENABLE_IMMUTABLE_INSTALLS=false --build-env ENABLE_EXPERIMENTAL_COREPACK=1 --build-env NEXT_PUBLIC_IGNORE_BUILD_ERROR=true --build-env VERCEL_TELEMETRY_DISABLED=1",
"ipfs": "NEXT_PUBLIC_IPFS_BUILD=true yarn build && yarn bgipfs upload config init -u https://upload.bgipfs.com && CID=$(yarn bgipfs upload out | grep -o 'CID: [^ ]*' | cut -d' ' -f2) && [ ! -z \"$CID\" ] && echo '🚀 Upload complete! Your site is now available at: https://community.bgipfs.com/ipfs/'$CID || echo '❌ Upload failed'",
"vercel:login": "vercel login"
},
"dependencies": {
Expand All @@ -23,6 +24,7 @@
"blo": "^1.2.0",
"burner-connector": "0.0.9",
"daisyui": "4.12.10",
"kubo-rpc-client": "^5.0.2",
"next": "^14.2.11",
"next-nprogress-bar": "^2.3.13",
"next-themes": "^0.3.0",
Expand All @@ -42,6 +44,7 @@
"@types/react": "^18.3.5",
"abitype": "1.0.6",
"autoprefixer": "^10.4.20",
"bgipfs": "^0.0.12",
"eslint": "^8.57.1",
"eslint-config-next": "^14.2.15",
"eslint-config-prettier": "^8.10.0",
Expand Down
Loading

0 comments on commit b1da2ca

Please sign in to comment.