From c7fece4345da439b203fc7f2e525b151bd8ad509 Mon Sep 17 00:00:00 2001 From: DR497 <47689875+dr497@users.noreply.github.com> Date: Fri, 4 Dec 2020 15:38:35 +0800 Subject: [PATCH] Fix tv build (#53) * fix: export USE_MARKETS * fix: update tsconfig to prevent TV charts build issue + update readme --- README.md | 6 ++++++ src/utils/markets.tsx | 2 +- tsconfig.json | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a6e3d2..af13614 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,12 @@ It is possible to add OHLCV candles built from on chain data using [Bonfida's AP 3. Import `TVChartContainer` from `/src/components/TradingView` and add it to your `TradePage.tsx`. The TradingView widget will work out of the box using [Bonfida's](https://bonfida.com) datafeed. +4. Remove the following from the `tsconfig.json` + +```json +"./src/components/TradingView/index.tsx" +``` +

diff --git a/src/utils/markets.tsx b/src/utils/markets.tsx index cf06067..b74f90b 100644 --- a/src/utils/markets.tsx +++ b/src/utils/markets.tsx @@ -45,7 +45,7 @@ import BonfidaApi from './bonfidaConnector'; // Used in debugging, should be false in production const _IGNORE_DEPRECATED = false; -const USE_MARKETS: MarketInfo[] = _IGNORE_DEPRECATED +export const USE_MARKETS: MarketInfo[] = _IGNORE_DEPRECATED ? MARKETS.map((m) => ({ ...m, deprecated: false })) : MARKETS; diff --git a/tsconfig.json b/tsconfig.json index 9e7c255..252e327 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,5 +20,10 @@ "lib": ["dom", "esnext"] }, "include": ["./src/"], - "exclude": ["./src/**/*.test.js", "node_modules", "**/node_modules"] + "exclude": [ + "./src/**/*.test.js", + "node_modules", + "**/node_modules", + "./src/components/TradingView/index.tsx" + ] }