ipfs / helia-verified-fetch

A fetch-like API for obtaining verified & trustless IPFS CIDs on the web
https://npmjs.com/package/@helia/verified-fetch
Other
14 stars 4 forks source link

bug: breaking API change from helia broke build #68

Closed SgtPooki closed 4 months ago

SgtPooki commented 5 months ago

on main:

╰─ ✔ ❯ npm i && npm run build
npm WARN deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm WARN deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm WARN deprecated @babel/plugin-proposal-optional-catch-binding@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead.
npm WARN deprecated read-pkg-up@11.0.0: Renamed to read-package-up
npm WARN deprecated @babel/plugin-proposal-logical-assignment-operators@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-logical-assignment-operators instead.
npm WARN deprecated eslint-config-standard-with-typescript@37.0.0: Please use eslint-config-love, instead.
npm WARN deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm WARN deprecated @babel/plugin-proposal-async-generator-functions@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated @babel/plugin-proposal-object-rest-spread@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
npm WARN deprecated multibase@4.0.6: This module has been superseded by the multiformats module
npm WARN deprecated ipfs-core-utils@0.18.1: js-IPFS has been deprecated in favour of Helia - please see https://github.com/ipfs/js-ipfs/issues/4336 for details
npm WARN deprecated ipfs-core-types@0.14.1: js-IPFS has been deprecated in favour of Helia - please see https://github.com/ipfs/js-ipfs/issues/4336 for details

added 2470 packages, and audited 2680 packages in 35s

372 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

> helia-verified-fetch@1.0.0 build
> aegir run build

@helia/verified-fetch: npm run build
@helia/verified-fetch: > @helia/verified-fetch@1.3.13 build
@helia/verified-fetch: > aegir build
@helia/verified-fetch: [14:11:31] tsc [started]
@helia/verified-fetch: src/index.ts(709,11): error TS2353: Object literal may only specify known properties, and 'gateways' does not exist in type 'TrustlessGatewayBlockBrokerInit'.
@helia/verified-fetch: [14:11:32] tsc [failed]
@helia/verified-fetch: [14:11:32] → Command failed with exit code 1: tsc
@helia/verified-fetch: Command failed with exit code 1: tsc
@helia/verified-fetch: npm error Lifecycle script `build` failed with error:
@helia/verified-fetch: npm error Error: command failed
@helia/verified-fetch: npm error   in workspace: @helia/verified-fetch@1.3.13
@helia/verified-fetch: npm error   at location: /Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/packages/verified-fetch
Command failed with exit code 1: npm run build
Command failed with exit code 1: tsc
npm error Lifecycle script `build` failed with error:
npm error Error: command failed
npm error   in workspace: @helia/verified-fetch@1.3.13
npm error   at location: /Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/packages/verified-fetch

> @helia/verified-fetch@1.3.13 build
> aegir build

[14:11:31] tsc [started]
src/index.ts(709,11): error TS2353: Object literal may only specify known properties, and 'gateways' does not exist in type 'TrustlessGatewayBlockBrokerInit'.
[14:11:32] tsc [failed]
[14:11:32] → Command failed with exit code 1: tsc
SgtPooki commented 5 months ago

FYI this means https://github.com/ipfs/helia/blob/55b96505c4912b61ac87dcd99852176fdc366506/packages/http/README.md?plain=1#L61-L70 is currently broken.. trying to track down where I saw the new way to do this.

SgtPooki commented 5 months ago

we need to consume the new router from @helia/routing and removing the "gateways" config from trustless gateways:

https://github.com/ipfs/helia-verified-fetch/blob/696ed5735b99262e27710fa382d0905a42b6a386/packages/verified-fetch/src/index.ts#L714C85-L714C105

SgtPooki commented 5 months ago

We will be reverting the change that went out as a patch and releasing as new version to "do this the right way"

SgtPooki commented 4 months ago

This was fixed by #50