Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

Commit

Permalink
fix: remove isomorphic fetch (#137)
Browse files Browse the repository at this point in the history
remove isomorphic fetch
  • Loading branch information
menduz authored Aug 9, 2022
1 parent 298e3aa commit 119377a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 35 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ build: ${PBS_TS}
@mkdir -p dist
@./node_modules/.bin/tsc -p tsconfig.json

start: build
npm start

lint:
@node_modules/.bin/eslint . --ext .ts

Expand Down
19 changes: 19 additions & 0 deletions declarations.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
interface TextEncoder {
encode(input?: string): Uint8Array
}
interface TextDecoder {
decode(input?: Uint8Array): string
}
interface WebSocket {
CONNECTING: number;
OPEN: number;
CLOSING: number;
CLOSED: number;
readyState: number;
close(code?: number, data?: string): void;
send(data: any, cb?: (err: Error) => void): void;
send(data: any, options: any, cb?: (err: Error) => void): void;
terminate?(): void;
addEventListener(type: string, listener: (ev: any) => any, options?: any): void;
}
type ResponseInit = string | object
29 changes: 0 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dcl/explorer-bff",
"scripts": {
"build": "tsc -p tsconfig.json",
"build": "make build",
"start": "node --trace-warnings --abort-on-uncaught-exception --unhandled-rejections=strict dist/index.js",
"test": "jest --forceExit --detectOpenHandles --coverage --verbose"
},
Expand Down Expand Up @@ -42,7 +42,6 @@
"@well-known-components/metrics": "^1.1.3",
"@well-known-components/nats-component": "^1.0.0-20220722202432.commit-34395ec",
"google-protobuf": "^3.20.1",
"isomorphic-fetch": "^3.0.0",
"jsonwebtoken": "^8.5.1",
"mitt": "^3.0.0",
"protoc-gen-dcl": "^1.0.0-20220109214200.commit-f45e34a",
Expand Down
4 changes: 2 additions & 2 deletions src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { createServiceDiscoveryComponent } from './ports/service-discovery'
import { createRealmComponent } from './ports/realm'
import { catalystRegistryForProvider } from '@dcl/catalyst-contracts'
import { createStatusComponent } from './ports/status'
import 'isomorphic-fetch'
import { observeBuildInfo } from './logic/build-info'

const DEFAULT_ETH_NETWORK = 'goerli'
Expand Down Expand Up @@ -44,7 +43,8 @@ export async function initComponents(): Promise<AppComponents> {
const nats = await createNatsComponent({ config, logs })
const serviceDiscovery = await createServiceDiscoveryComponent({ nats, logs, config })
const ethereumProvider = new HTTPProvider(
`https://rpc.decentraland.org/${encodeURIComponent(ethNetwork)}?project=explorer-bff`
`https://rpc.decentraland.org/${encodeURIComponent(ethNetwork)}?project=explorer-bff`,
{ fetch: fetch.fetch }
)

const contract = await catalystRegistryForProvider(ethereumProvider)
Expand Down
7 changes: 5 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
"forceConsistentCasingInFileNames": true,
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
"esModuleInterop": true,
"lib": ["ES2020"],
"types": ["node"]
},
"include": [
"src"
"src",
"declarations.d.ts"
]
}

0 comments on commit 119377a

Please sign in to comment.