From 565ce981f12436e4789fabf770aba4ee2bae1cef Mon Sep 17 00:00:00 2001 From: sehyunc <41171808+sehyunc@users.noreply.github.com> Date: Sun, 3 Nov 2024 14:45:07 -0800 Subject: [PATCH 1/3] s --- .gitmodules | 3 +++ lib/charts | 1 + package.json | 1 - pnpm-lock.yaml | 8 -------- scripts/tradingview.sh | 14 +++++++++++--- 5 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 .gitmodules create mode 160000 lib/charts diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..019d1a2d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/charts"] + path = lib/charts + url = git@github.com:tradingview/charting_library.git diff --git a/lib/charts b/lib/charts new file mode 160000 index 00000000..a7303f87 --- /dev/null +++ b/lib/charts @@ -0,0 +1 @@ +Subproject commit a7303f87aa7ebd79aba08fd2d71fb2e73e84f510 diff --git a/package.json b/package.json index 4f256c2c..7beaf55c 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ "@radix-ui/react-visually-hidden": "^1.1.0", "@renegade-fi/internal-sdk": "0.0.0-canary-20240829175257", "@renegade-fi/react": "0.4.1", - "@renegade-fi/tradingview-charts": "0.27.6", "@tanstack/react-query": "^5.45.1", "@tanstack/react-table": "^8.17.3", "@vercel/analytics": "^1.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 79bf2c45..78a7ff20 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -89,9 +89,6 @@ importers: '@renegade-fi/react': specifier: 0.4.1 version: 0.4.1(@tanstack/query-core@5.45.0)(@tanstack/react-query@5.45.1(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(viem@2.15.1(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@5.0.10)(zod@3.23.8))(ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)) - '@renegade-fi/tradingview-charts': - specifier: 0.27.6 - version: 0.27.6 '@tanstack/react-query': specifier: ^5.45.1 version: 5.45.1(react@18.3.1) @@ -2503,9 +2500,6 @@ packages: '@tanstack/react-query': '>=5.0.0' react: '>=18' - '@renegade-fi/tradingview-charts@0.27.6': - resolution: {integrity: sha512-G4hsbxxTDubarQsgp2j6oumKEi4vwk7YKf7+PulCBB2SBLMhinnbJ1OKzAlEx5BA1yc66CKtad/1kN07/8ESaQ==, tarball: https://npm.pkg.github.com/download/@renegade-fi/tradingview-charts/0.27.6/0d39f464ce268bec6cf2c0b1ff9303a51f4db26d} - '@rnx-kit/chromium-edge-launcher@1.0.0': resolution: {integrity: sha512-lzD84av1ZQhYUS+jsGqJiCMaJO2dn9u+RTT9n9q6D3SaKVwWqv+7AoRKqBu19bkwyE+iFRl1ymr40QS90jVFYg==} engines: {node: '>=14.15'} @@ -9614,8 +9608,6 @@ snapshots: - viem - ws - '@renegade-fi/tradingview-charts@0.27.6': {} - '@rnx-kit/chromium-edge-launcher@1.0.0': dependencies: '@types/node': 18.19.42 diff --git a/scripts/tradingview.sh b/scripts/tradingview.sh index f7d5ecea..4a5b9801 100644 --- a/scripts/tradingview.sh +++ b/scripts/tradingview.sh @@ -1,6 +1,14 @@ #!/bin/bash -PACKAGE_NAME="@renegade-fi/tradingview-charts" +SUBMODULE_PATH="./lib/charts" + +# Check if submodule exists +if [ ! -d "$SUBMODULE_PATH" ]; then + echo "Error: TradingView submodule not found at $SUBMODULE_PATH" + echo "Please ensure you've initialized the submodule with:" + echo "git submodule update --init --recursive" + exit 1 +fi # Create necessary directories mkdir -p ./public/static/datafeeds/udf/dist @@ -11,9 +19,9 @@ rm -rf ./public/static/datafeeds/udf/dist/bundle.js rm -rf ./public/static/charting_library # Copy the bundle.js file -cp ./node_modules/$PACKAGE_NAME/datafeeds/udf/dist/bundle.js ./public/static/datafeeds/udf/dist/bundle.js +cp $SUBMODULE_PATH/datafeeds/udf/dist/bundle.js ./public/static/datafeeds/udf/dist/bundle.js # Copy the entire charting_library folder -cp -r ./node_modules/$PACKAGE_NAME/charting_library ./public/static/charting_library +cp -r $SUBMODULE_PATH/charting_library ./public/static/charting_library echo "TradingView files copied successfully." \ No newline at end of file From 7cd916baa197b4b5657bafa5d26448e9777519f1 Mon Sep 17 00:00:00 2001 From: sehyunc <41171808+sehyunc@users.noreply.github.com> Date: Sun, 3 Nov 2024 14:46:36 -0800 Subject: [PATCH 2/3] pin charts to v27 --- lib/charts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/charts b/lib/charts index a7303f87..1cc3ce33 160000 --- a/lib/charts +++ b/lib/charts @@ -1 +1 @@ -Subproject commit a7303f87aa7ebd79aba08fd2d71fb2e73e84f510 +Subproject commit 1cc3ce33a53fd5a8003718c5efe9415dbbd4d97d From 9a4dcfd44729a91d3f66f3c20ffc840f21277913 Mon Sep 17 00:00:00 2001 From: sehyunc <41171808+sehyunc@users.noreply.github.com> Date: Sun, 3 Nov 2024 14:53:58 -0800 Subject: [PATCH 3/3] s --- app/trade/[base]/components/charts/price-chart.tsx | 2 +- app/trade/[base]/components/charts/tradingview/config.ts | 2 +- app/trade/[base]/components/charts/tradingview/datafeed.ts | 2 +- app/trade/[base]/components/charts/tradingview/helpers.ts | 2 +- app/trade/[base]/components/charts/tradingview/index.tsx | 2 +- app/trade/[base]/components/charts/tradingview/streaming.ts | 2 +- hooks/use-ohlc.ts | 2 +- lib/amberdata.ts | 2 +- postinstall.sh | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/trade/[base]/components/charts/price-chart.tsx b/app/trade/[base]/components/charts/price-chart.tsx index 45c30cbb..692a78f1 100644 --- a/app/trade/[base]/components/charts/price-chart.tsx +++ b/app/trade/[base]/components/charts/price-chart.tsx @@ -2,7 +2,7 @@ import React from "react" import Script from "next/script" -import { ChartingLibraryWidgetOptions } from "@renegade-fi/tradingview-charts" +import { ChartingLibraryWidgetOptions } from "@/lib/charts" import TradingViewChart from "@/app/trade/[base]/components/charts/tradingview" diff --git a/app/trade/[base]/components/charts/tradingview/config.ts b/app/trade/[base]/components/charts/tradingview/config.ts index 63d3f718..ff77b403 100644 --- a/app/trade/[base]/components/charts/tradingview/config.ts +++ b/app/trade/[base]/components/charts/tradingview/config.ts @@ -7,7 +7,7 @@ import { DatafeedConfiguration, Favorites, ResolutionString, -} from "@renegade-fi/tradingview-charts" +} from "@/lib/charts" export const datafeedConfig = { supported_resolutions: [ diff --git a/app/trade/[base]/components/charts/tradingview/datafeed.ts b/app/trade/[base]/components/charts/tradingview/datafeed.ts index 11e240fb..fdf5e269 100644 --- a/app/trade/[base]/components/charts/tradingview/datafeed.ts +++ b/app/trade/[base]/components/charts/tradingview/datafeed.ts @@ -2,7 +2,7 @@ import { Bar, IBasicDataFeed, LibrarySymbolInfo, -} from "@renegade-fi/tradingview-charts" +} from "@/lib/charts" import { subscribeOnStream, diff --git a/app/trade/[base]/components/charts/tradingview/helpers.ts b/app/trade/[base]/components/charts/tradingview/helpers.ts index ab790837..60cc9b40 100644 --- a/app/trade/[base]/components/charts/tradingview/helpers.ts +++ b/app/trade/[base]/components/charts/tradingview/helpers.ts @@ -1,4 +1,4 @@ -import { Bar } from "@renegade-fi/tradingview-charts" +import { Bar } from "@/lib/charts" // Amberdata API URL const BASE_URL = "https://api.amberdata.com" diff --git a/app/trade/[base]/components/charts/tradingview/index.tsx b/app/trade/[base]/components/charts/tradingview/index.tsx index c503ccaa..8efa64fd 100644 --- a/app/trade/[base]/components/charts/tradingview/index.tsx +++ b/app/trade/[base]/components/charts/tradingview/index.tsx @@ -7,7 +7,7 @@ import { LanguageCode, ResolutionString, widget, -} from "@renegade-fi/tradingview-charts" +} from "@/lib/charts" import { config } from "@/app/trade/[base]/components/charts/tradingview/config" diff --git a/app/trade/[base]/components/charts/tradingview/streaming.ts b/app/trade/[base]/components/charts/tradingview/streaming.ts index 4a3b1675..e2ac8969 100644 --- a/app/trade/[base]/components/charts/tradingview/streaming.ts +++ b/app/trade/[base]/components/charts/tradingview/streaming.ts @@ -3,7 +3,7 @@ import { LibrarySymbolInfo, ResolutionString, SubscribeBarsCallback, -} from "@renegade-fi/tradingview-charts" +} from "@/lib/charts" interface SubscriptionItem { subscriberUID: string diff --git a/hooks/use-ohlc.ts b/hooks/use-ohlc.ts index 41295434..3239f2a5 100644 --- a/hooks/use-ohlc.ts +++ b/hooks/use-ohlc.ts @@ -1,4 +1,4 @@ -import { Bar } from "@renegade-fi/tradingview-charts" +import { Bar } from "@/lib/charts" import { useQuery, UseQueryResult } from "@tanstack/react-query" import { fetchBars } from "@/lib/amberdata" diff --git a/lib/amberdata.ts b/lib/amberdata.ts index f9038080..f9f413de 100644 --- a/lib/amberdata.ts +++ b/lib/amberdata.ts @@ -1,4 +1,4 @@ -import { Bar } from "@renegade-fi/tradingview-charts" +import { Bar } from "@/lib/charts" import invariant from "tiny-invariant" import { makeAmberApiRequest } from "@/app/trade/[base]/components/charts/tradingview/helpers" diff --git a/postinstall.sh b/postinstall.sh index 77534129..56feaf6d 100755 --- a/postinstall.sh +++ b/postinstall.sh @@ -1,7 +1,7 @@ #!/bin/bash # Set the package name -PACKAGE_NAME="@renegade-fi/tradingview-charts" +PACKAGE_NAME="@/lib/charts" # Create necessary directories mkdir -p ./public/static/datafeeds/udf/dist