Skip to content

Commit ff9c57f

Browse files
feat: use siteId for upload-proxy, use web3storage public gateway for… (#77)
… storage ## Why? Clear and short explanation here. ## How? - Done A (replace with a breakdown of the steps) - Done B - Done C ## Tickets? - [Ticket 1](the-ticket-url-here) - [Ticket 2](the-ticket-url-here) - [Ticket 3](the-ticket-url-here) ## Contribution checklist? - [ ] The commit messages are detailed - [ ] The `build` command runs locally - [ ] Assets or static content are linked and stored in the project - [ ] You have manually tested - [ ] You have provided tests ## Security checklist? - [ ] Sensitive data has been identified and is being protected properly - [ ] Injection has been prevented (parameterized queries, no eval or system calls) ## Preview? Optionally, provide the preview url here
1 parent 967d2d4 commit ff9c57f

7 files changed

Lines changed: 28 additions & 19 deletions

File tree

.changeset/empty-fishes-compare.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@fleek-platform/cli": patch
3+
---
4+
5+
change link in `ipfs add` command to w3s.link
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@fleek-platform/cli": minor
3+
---
4+
5+
Legacy site deployment upload was replaced by new SDK client

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fleek-platform/cli",
3-
"version": "3.8.3",
3+
"version": "3.9.4",
44
"bin": {
55
"fleek": "bin/index.js"
66
},
@@ -69,11 +69,11 @@
6969
"@biomejs/biome": "^1.8.3",
7070
"@changesets/cli": "^2.27.6",
7171
"@fleek-platform/errors": "^2.7.0",
72-
"@fleek-platform/sdk": "^3.5.4",
72+
"@fleek-platform/sdk": "^3.7.2",
7373
"@fleek-platform/tester": "^2.12.1",
7474
"@fleek-platform/utils-gateways": "^0.1.12",
7575
"@fleek-platform/utils-github": "^0.1.0",
76-
"@fleek-platform/utils-ipfs": "^0.4.4",
76+
"@fleek-platform/utils-ipfs": "^0.4.5",
7777
"@fleek-platform/utils-ipns": "^0.1.13",
7878
"@fleek-platform/utils-validation": "^2.4.0",
7979
"@tsconfig/node16": "^16.1.3",

pnpm-lock.yaml

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commands/ipfs/add.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import fs from 'node:fs';
22

33
import {
4-
getFleekXyzIpfsGatewayUrl,
54
getPrivateIpfsGatewayUrl,
5+
getWeb3IpfsGatewayUrl,
66
} from '@fleek-platform/utils-ipfs';
77

88
import { output } from '../../cli';
@@ -47,7 +47,7 @@ const addAction: SdkGuardedFunction<AddActionArgs> = async ({ sdk, args }) => {
4747

4848
if (privateGatewayDomains.length === 0) {
4949
output.hint(`${t('getFileFromPubAddr')}:`);
50-
output.link(getFleekXyzIpfsGatewayUrl(hash));
50+
output.link(getWeb3IpfsGatewayUrl(hash));
5151

5252
return;
5353
}

src/commands/sites/deploy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ const deployAction: SdkGuardedFunction<DeployActionArgs> = async ({
3434

3535
const uploadResults = await sdk.ipfs().addSitesToIpfs(siteConfig.distDir, {
3636
wrapWithDirectory: true,
37-
// We must pass plain object instead of URLSearchParams because of ipfs-http-client bug
38-
searchParams: { site_id: site.id } as unknown as URLSearchParams,
37+
siteId: site.id,
3938
});
4039

4140
const root = uploadResults.pop();

src/commands/storage/add.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { promises as fs, existsSync } from 'node:fs';
22
import { basename } from 'node:path';
33

44
import {
5-
getFleekXyzIpfsGatewayUrl,
65
getPrivateIpfsGatewayUrl,
6+
getWeb3IpfsGatewayUrl,
77
} from '@fleek-platform/utils-ipfs';
88
import cliProgress from 'cli-progress';
99
import { filesFromPaths } from 'files-from-path';
@@ -73,7 +73,7 @@ export const addStorageAction: SdkGuardedFunction<
7373

7474
if (privateGatewayDomains.length === 0) {
7575
output.log(t('visitViaGateway'));
76-
output.link(getFleekXyzIpfsGatewayUrl(hash));
76+
output.link(getWeb3IpfsGatewayUrl(hash));
7777

7878
return;
7979
}

0 commit comments

Comments
 (0)