Conversation
- Changed build system to Vite - Modernised PWA icons and manifest
WalkthroughThis update migrates the project from Create React App and Jest to Vite and Vitest, refactoring all environment variable access from Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AppsList
participant loadApps
participant loadApp
participant i18next
User->>AppsList: Mounts component
AppsList->>loadApps: await loadApps(allowed)
loop For each appId in allowed
loadApps->>loadApp: await loadApp(appId)
loadApp->>i18next: Add translations from manifest
loadApp-->>loadApps: AppManifest or null
end
loadApps-->>AppsList: Record<string, AppManifest>
AppsList->>AppsList: setApps state
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Deploying x with
|
| Latest commit: |
432ee67
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4edf2d20.x-e62.pages.dev |
| Branch Preview URL: | https://fix-vite.x-e62.pages.dev |
There was a problem hiding this comment.
Actionable comments posted: 15
🔭 Outside diff range comments (2)
src/components/BottomMenuModal/SendModal/SendModal.test.skip.tsx (1)
167-167: Fix incomplete Jest to Vitest migration.The file still uses
jest.spyOnwhich should be updated tovi.spyOnfor the Vitest migration. This will cause test failures since Jest is no longer available.- jest.spyOn(TransactionKit, 'useEtherspotTransactions').mockReturnValue({ + vi.spyOn(TransactionKit, 'useEtherspotTransactions').mockReturnValue({src/apps/the-exchange/components/EnterAmount/test/EnterAmount.test.tsx (1)
118-118: Fix typo in property name.There's a typo in the property access -
.symbollshould be.symbol.- tokenSymbol={store.getState().swap.swapToken.symboll} + tokenSymbol={store.getState().swap.swapToken.symbol}
🧹 Nitpick comments (2)
src/apps/README.md (1)
32-32: Documentation update is correct with minor grammar improvement needed.The environment variable update from
REACT_APP_PX_DEVELOPMENT_IDtoVITE_PX_DEVELOPMENT_IDaligns perfectly with the Vite migration.Apply this diff to improve grammar:
-5. Modify the `VITE_PX_DEVELOPMENT_ID` property in your `.env` file to match your app identifier i.e. `your-app-identifier`. You may need to run `npm run start` again for the changes in the `.env` file to be picked up. +5. Modify the `VITE_PX_DEVELOPMENT_ID` property in your `.env` file to match your app identifier, i.e., `your-app-identifier`. You may need to run `npm run start` again for the changes in the `.env` file to be picked up.src/apps/leaderboard/components/PointsCards/tests/GasNewDropCard.test.tsx (1)
4-15: Remove commented Jest mock code.The commented Jest mock code should be removed since it's no longer needed after migrating to Vitest.
-// vi.mock('luxon', async () => { -// const actualLuxon = await vi.importMock('luxon').then((m) => m.default || m); - -// return { -// ...actualLuxon, -// DateTime: { -// // ...actualLuxon.DateTime, -// now: () => actualLuxon.DateTime.fromMillis(1750307487101), // fixed mock time (Oct 19, 2025) -// fromMillis: actualLuxon.DateTime.fromMillis, -// }, -// }; -// });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (83)
package-lock.jsonis excluded by!**/package-lock.jsonpublic/apple-touch-icon.pngis excluded by!**/*.pngpublic/favicon-96x96.pngis excluded by!**/*.pngpublic/favicon.icois excluded by!**/*.icopublic/favicon.svgis excluded by!**/*.svgpublic/logo192-maskable.pngis excluded by!**/*.pngpublic/logo192.pngis excluded by!**/*.pngpublic/logo512-maskable.pngis excluded by!**/*.pngpublic/logo512.pngis excluded by!**/*.pngpublic/web-app-manifest-192x192.pngis excluded by!**/*.pngpublic/web-app-manifest-512x512.pngis excluded by!**/*.pngsrc/apps/deposit/components/Asset/test/__snapshots__/Asset.test.tsx.snapis excluded by!**/*.snapsrc/apps/deposit/components/AssetsList/test/__snapshots__/AssetsList.test.tsx.snapis excluded by!**/*.snapsrc/apps/leaderboard/components/LeaderboardTab/test/__snapshots__/LeaderboardTab.test.tsx.snapis excluded by!**/*.snapsrc/apps/leaderboard/components/LeaderboardTabsButton/test/__snapshots__/LeaderboardTabsButton.test.tsx.snapis excluded by!**/*.snapsrc/apps/leaderboard/components/PointsCards/tests/__snapshots__/GasNewDropCard.test.tsx.snapis excluded by!**/*.snapsrc/apps/leaderboard/components/PointsCards/tests/__snapshots__/OverviewPointsCard.test.tsx.snapis excluded by!**/*.snapsrc/apps/leaderboard/components/PointsCards/tests/__snapshots__/PointsCard.test.tsx.snapis excluded by!**/*.snapsrc/apps/leaderboard/components/PxPointsSummary/tests/__snapshots__/PxPointsSummary.test.tsx.snapis excluded by!**/*.snapsrc/apps/leaderboard/components/Typography/tests/__snapshots__/Body.test.tsx.snapis excluded by!**/*.snapsrc/apps/leaderboard/components/Typography/tests/__snapshots__/BodySmall.test.tsx.snapis excluded by!**/*.snapsrc/apps/leaderboard/components/Typography/tests/__snapshots__/H1.test.tsx.snapis excluded by!**/*.snapsrc/apps/leaderboard/components/UserInfo/test/__snapshots__/UserInfo.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/AdvertTile/test/__snapshots__/AdvertTile.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/EditorialTag/test/__snapshots__/EditorialTag.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/EditorialTile/test/__snapshots__/EditorialTile.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/GenericBannerTile/test/__snapshots__/GenericBannerTile.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/HighlightedMediaGridTile/test/__snapshots__/HighlightedMediaGridTile.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/HorizontalToken/test/__snapshots__/HorizontalToken.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/MediaGridCollection/tests/__snapshots__/DisplayCollectionImage.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/MediaGridCollection/tests/__snapshots__/MediaGridCollection.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/PillarXLogo/test/__snapshots__/PillarXLogo.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/PointsInfo/test/__snapshots__/PointsInfo.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/PointsTile/test/__snapshots__/PointsTile.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/PortfolioOverview/test/__snapshots__/PortfolioOverview.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/PrimeTokensBalance/test/__snapshots__/PrimeTokensBalance.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/ReceiveModal/test/__snapshots__/ReceiveModal.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/Tags/test/__snapshots__/Tags.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/TileContainer/test/__snapshots__/TileContainer.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/TokenInfoHorizontal/test/__snapshots__/TokenInfoHorizontal.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/TokenMarketDataRow/tests/__snapshots__/LeftColumnTokenMarketDataRow.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/TokenMarketDataRow/tests/__snapshots__/RightColumnTokenMarketDataRow.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/TokensHorizontalList/test/__snapshots__/TokensHorizontalList.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/TokensHorizontalTile/test/__snapshots__/TokensHorizontalTile.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/TokensPercentage/test/__snapshots__/TokensPercentage.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/TokensVerticalList/test/__snapshots__/TokensVerticalList.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/TokensVerticalTile/test/__snapshots__/TokensVerticalTile.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/TokensWithMarketDataTile/test/__snapshots__/TokensWithMarketDataTile.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/TopTokens/test/__snapshots__/TopTokens.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/Typography/tests/__snapshots__/Body.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/Typography/tests/__snapshots__/BodySmall.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/Typography/tests/__snapshots__/H1.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/WalletAdddressOverview/test/__snapshots__/WalletAddressOverview.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/WalletConnectDropdown/test/__snapshots__/WalletConnectDropdown.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/WalletPortfolioBalance/test/__snapshots__/WalletPortfolioBalance.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/WalletPortfolioGraph/tests/__snapshots__/WalletPortfolioGraph.test.tsx.snapis excluded by!**/*.snapsrc/apps/pillarx-app/components/WalletPortfolioTile/test/__snapshots__/WalletPortfolioTile.test.tsx.snapis excluded by!**/*.snapsrc/apps/the-exchange/components/CardsSwap/test/__snapshots__/CardSwap.test.tsx.snapis excluded by!**/*.snapsrc/apps/the-exchange/components/DropdownTokensList/test/__snapshots__/DropdownTokensList.test.tsx.snapis excluded by!**/*.snapsrc/apps/the-exchange/components/EnterAmount/test/__snapshots__/EnterAmount.test.tsx.snapis excluded by!**/*.snapsrc/apps/the-exchange/components/ExchangeAction/test/__snapshots__/ExchangeAction.test.tsx.snapis excluded by!**/*.snapsrc/apps/the-exchange/components/SelectDropdown/test/__snapshots__/SelectDropdown.test.tsx.snapis excluded by!**/*.snapsrc/apps/the-exchange/components/SelectToken/test/__snapshots__/SelectToken.test.tsx.snapis excluded by!**/*.snapsrc/apps/the-exchange/components/TokenListItem/test/__snapshots__/TokenListItem.test.tsx.snapis excluded by!**/*.snapsrc/apps/the-exchange/components/TokenLogo/test/__snapshots__/TokenLogo.test.tsx.snapis excluded by!**/*.snapsrc/apps/the-exchange/components/Typography/tests/__snapshots__/Body.test.tsx.snapis excluded by!**/*.snapsrc/apps/the-exchange/components/Typography/tests/__snapshots__/BodySmall.test.tsx.snapis excluded by!**/*.snapsrc/apps/the-exchange/components/Typography/tests/__snapshots__/NumberText.test.tsx.snapis excluded by!**/*.snapsrc/apps/token-atlas/components/SearchTokenModal/test/__snapshots__/SearchTokenModal.test.tsx.snapis excluded by!**/*.snapsrc/apps/token-atlas/components/SelectChainDropdown/test/__snapshots__/SelectChainDropdown.test.tsx.snapis excluded by!**/*.snapsrc/apps/token-atlas/components/TokenCard/test/__snapshots__/TokenCard.test.tsx.snapis excluded by!**/*.snapsrc/apps/token-atlas/components/TokenGraph/test/__snapshots__/TokenGraph.test.tsx.snapis excluded by!**/*.snapsrc/apps/token-atlas/components/TokenGraphColumn/test/__snapshots__/TokenGraphColumn.test.tsx.snapis excluded by!**/*.snapsrc/apps/token-atlas/components/TokenInfoColumn/test/__snapshots__/TokenInfoColumn.test.tsx.snapis excluded by!**/*.snapsrc/apps/token-atlas/components/TokenResultCard/test/__snapshots__/TokenResultCard.test.tsx.snapis excluded by!**/*.snapsrc/apps/token-atlas/components/TokensSearchResult/test/__snapshots__/TokensSearchResult.test.tsx.snapis excluded by!**/*.snapsrc/apps/token-atlas/components/TokensSlider/test/__snapshots__/TokenSlider.test.tsx.snapis excluded by!**/*.snapsrc/components/BottomMenu/__snapshots__/BottomMenu.test.tsx.snapis excluded by!**/*.snapsrc/components/Button/__snapshots__/Button.test.tsx.snapis excluded by!**/*.snapsrc/components/Form/Select/__snapshots__/Select.test.tsx.snapis excluded by!**/*.snapsrc/components/Text/Paragraph/__snapshots__/Paragraph.test.tsx.snapis excluded by!**/*.snapsrc/components/Text/Title/__snapshots__/Title.test.tsx.snapis excluded by!**/*.snapsrc/containers/__snapshots__/Main.test.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (77)
.env.example(1 hunks).eslintrc.json(1 hunks).github/workflows/unit-tests.yml(1 hunks)__mocks__/walletConnectMock.ts(1 hunks)index.html(3 hunks)jest.config.json(0 hunks)package.json(5 hunks)public/manifest.json(0 hunks)public/site.webmanifest(1 hunks)src/apps/README.md(1 hunks)src/apps/deposit/components/Asset/test/Asset.test.tsx(1 hunks)src/apps/deposit/index.tsx(1 hunks)src/apps/index.ts(4 hunks)src/apps/leaderboard/components/InfoBanner/InfoBanner.tsx(1 hunks)src/apps/leaderboard/components/LeaderboardTab/test/LeaderboardTab.test.tsx(4 hunks)src/apps/leaderboard/components/LeaderboardTabsButton/test/LeaderboardTabsButton.test.tsx(1 hunks)src/apps/leaderboard/components/Leaderboards/tests/Leaderboards.test.tsx(1 hunks)src/apps/leaderboard/components/PointsCards/tests/GasNewDropCard.test.tsx(1 hunks)src/apps/leaderboard/components/PxPointsSummary/tests/PxPointsSummary.test.tsx(4 hunks)src/apps/leaderboard/components/UserInfo/test/UserInfo.test.tsx(2 hunks)src/apps/pillarx-app/components/GenericBannerTile/test/GenericBannerTile.test.tsx(1 hunks)src/apps/pillarx-app/components/HighlightedMediaGridTile/test/HighlightedMediaGridTile.test.tsx(1 hunks)src/apps/pillarx-app/components/HorizontalToken/HorizontalToken.tsx(1 hunks)src/apps/pillarx-app/components/HorizontalToken/test/HorizontalToken.test.tsx(1 hunks)src/apps/pillarx-app/components/MediaGridCollection/tests/DisplayCollectionImage.test.tsx(1 hunks)src/apps/pillarx-app/components/PrimeTokensBalance/test/PrimeTokensBalance.test.tsx(2 hunks)src/apps/pillarx-app/components/ReceiveModal/test/ReceiveModal.test.tsx(8 hunks)src/apps/pillarx-app/components/TokensVerticalList/test/TokensVerticalList.test.tsx(5 hunks)src/apps/pillarx-app/components/TopTokens/test/TopTokens.test.tsx(5 hunks)src/apps/pillarx-app/components/WalletAdddressOverview/test/WalletAddressOverview.test.tsx(1 hunks)src/apps/pillarx-app/components/WalletConnectDropdown/test/WalletConnectDropdown.test.tsx(6 hunks)src/apps/pillarx-app/components/WalletPortfolioBalance/test/WalletPortfolioBalance.test.tsx(3 hunks)src/apps/pillarx-app/components/WalletPortfolioGraph/tests/WalletPortfolioGraph.test.tsx(3 hunks)src/apps/pillarx-app/components/WalletPortfolioTile/test/WalletPortfolioTile.test.tsx(6 hunks)src/apps/the-exchange/components/CardsSwap/CardsSwap.tsx(1 hunks)src/apps/the-exchange/components/CardsSwap/test/CardSwap.test.tsx(7 hunks)src/apps/the-exchange/components/DropdownTokensList/test/DropdownTokensList.test.tsx(4 hunks)src/apps/the-exchange/components/EnterAmount/test/EnterAmount.test.tsx(1 hunks)src/apps/the-exchange/components/ExchangeAction/test/ExchangeAction.test.tsx(1 hunks)src/apps/the-exchange/components/SelectDropdown/test/SelectDropdown.test.tsx(3 hunks)src/apps/the-exchange/components/SelectToken/test/SelectToken.test.tsx(1 hunks)src/apps/the-exchange/components/TokenListItem/test/TokenListItem.test.tsx(1 hunks)src/apps/the-exchange/index.tsx(1 hunks)src/apps/token-atlas/components/TokenCard/test/TokenCard.test.tsx(2 hunks)src/apps/token-atlas/components/TokenGraphColumn/test/TokenGraphColumn.test.tsx(1 hunks)src/apps/token-atlas/components/TokenResultCard/test/TokenResultCard.test.tsx(1 hunks)src/apps/token-atlas/components/TokensSlider/test/TokenSlider.test.tsx(7 hunks)src/components/AppsList.tsx(1 hunks)src/components/BottomMenu/BottomMenu.test.tsx(4 hunks)src/components/BottomMenuModal/SendModal/SendModal.test.skip.tsx(1 hunks)src/components/BottomMenuModal/SendModal/SendModalTokensTabView.tsx(4 hunks)src/components/Form/Select/Select.test.tsx(1 hunks)src/components/LandingPage/Form/index.jsx(1 hunks)src/components/LandingPage/Popup/index.jsx(1 hunks)src/components/LandingPage/PopupMailChimp/index.jsx(1 hunks)src/containers/Authorized.tsx(1 hunks)src/containers/Main.test.tsx(1 hunks)src/containers/Main.tsx(5 hunks)src/hooks/__tests__/useAccountTransactionHistory.test.tsx(3 hunks)src/hooks/useDeployWallet.tsx(2 hunks)src/main.tsx(1 hunks)src/pages/App/App.test.tsx(3 hunks)src/pages/App/index.tsx(2 hunks)src/pages/WaitList.jsx(1 hunks)src/providers/__tests__/AccountNftsProvider.test.tsx(11 hunks)src/providers/__tests__/AccountTransactionHistoryProvider.test.tsx(8 hunks)src/providers/__tests__/AllowedAppsProvider.test.tsx(3 hunks)src/providers/__tests__/GlobalTransactionsBatchProvider.test.tsx(1 hunks)src/services/gasless.ts(2 hunks)src/services/userOpStatus.ts(1 hunks)src/services/walletConnect.ts(1 hunks)src/test-utils/setupTests.ts(5 hunks)src/utils/__tests__/blockchain.test.ts(1 hunks)src/utils/blockchain.ts(1 hunks)src/vite-env.d.ts(1 hunks)tsconfig.json(1 hunks)vite.config.js(1 hunks)
💤 Files with no reviewable changes (2)
- public/manifest.json
- jest.config.json
🧰 Additional context used
🧠 Learnings (24)
src/apps/pillarx-app/components/HorizontalToken/HorizontalToken.tsx (3)
Learnt from: RanaBug
PR: pillarwallet/x#290
File: src/apps/pillarx-app/components/TileTitle/TitleTitle.tsx:6-10
Timestamp: 2025-04-23T15:04:20.826Z
Learning: In this repository, TileTitleProps and TileTitle are different types that serve different purposes. TileTitleProps is used for the TileTitle component and has optional fields (title?, leftDecorator?, rightDecorator?), while TileTitle in api.ts has a required text field. The TileTitleProps interface aligns with the TokensMarketData.title type in api.ts which also has optional fields.
Learnt from: RanaBug
PR: pillarwallet/x#290
File: src/apps/pillarx-app/components/TileTitle/TitleTitle.tsx:6-10
Timestamp: 2025-04-23T15:04:20.826Z
Learning: In this repository, TileTitleProps and TileTitle are different types that serve different purposes. TileTitleProps is used for the TileTitle component and has optional fields (title?, leftDecorator?, rightDecorator?), while TileTitle in api.ts has a required title field. The TileTitleProps structure aligns with how it's used in the TokensMarketData type in api.ts.
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
src/apps/the-exchange/components/SelectToken/test/SelectToken.test.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
src/apps/leaderboard/components/LeaderboardTab/test/LeaderboardTab.test.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#334
File: src/apps/leaderboard/utils/index.tsx:91-94
Timestamp: 2025-06-17T09:20:44.533Z
Learning: In src/apps/leaderboard/utils/index.tsx, the getLastWeekMigrationData function intentionally uses currentWeek (not lastWeek) for the completedSwapWeek lookup. This is correct business logic - when retrieving last week's migration data, the function should check swap completion against the current week while using lastWeek for points and USD calculations.
src/apps/token-atlas/components/TokenResultCard/test/TokenResultCard.test.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
src/apps/leaderboard/components/InfoBanner/InfoBanner.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#334
File: src/apps/leaderboard/utils/index.tsx:91-94
Timestamp: 2025-06-17T09:20:44.533Z
Learning: In src/apps/leaderboard/utils/index.tsx, the getLastWeekMigrationData function intentionally uses currentWeek (not lastWeek) for the completedSwapWeek lookup. This is correct business logic - when retrieving last week's migration data, the function should check swap completion against the current week while using lastWeek for points and USD calculations.
src/apps/the-exchange/components/CardsSwap/CardsSwap.tsx (2)
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
Learnt from: RanaBug
PR: pillarwallet/x#334
File: src/apps/leaderboard/utils/index.tsx:91-94
Timestamp: 2025-06-17T09:20:44.533Z
Learning: In src/apps/leaderboard/utils/index.tsx, the getLastWeekMigrationData function intentionally uses currentWeek (not lastWeek) for the completedSwapWeek lookup. This is correct business logic - when retrieving last week's migration data, the function should check swap completion against the current week while using lastWeek for points and USD calculations.
src/apps/leaderboard/components/LeaderboardTabsButton/test/LeaderboardTabsButton.test.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#334
File: src/apps/leaderboard/utils/index.tsx:91-94
Timestamp: 2025-06-17T09:20:44.533Z
Learning: In src/apps/leaderboard/utils/index.tsx, the getLastWeekMigrationData function intentionally uses currentWeek (not lastWeek) for the completedSwapWeek lookup. This is correct business logic - when retrieving last week's migration data, the function should check swap completion against the current week while using lastWeek for points and USD calculations.
src/apps/the-exchange/components/DropdownTokensList/test/DropdownTokensList.test.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
src/apps/leaderboard/components/PxPointsSummary/tests/PxPointsSummary.test.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#334
File: src/apps/leaderboard/utils/index.tsx:91-94
Timestamp: 2025-06-17T09:20:44.533Z
Learning: In src/apps/leaderboard/utils/index.tsx, the getLastWeekMigrationData function intentionally uses currentWeek (not lastWeek) for the completedSwapWeek lookup. This is correct business logic - when retrieving last week's migration data, the function should check swap completion against the current week while using lastWeek for points and USD calculations.
src/apps/the-exchange/components/TokenListItem/test/TokenListItem.test.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
src/apps/leaderboard/components/Leaderboards/tests/Leaderboards.test.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#334
File: src/apps/leaderboard/utils/index.tsx:91-94
Timestamp: 2025-06-17T09:20:44.533Z
Learning: In src/apps/leaderboard/utils/index.tsx, the getLastWeekMigrationData function intentionally uses currentWeek (not lastWeek) for the completedSwapWeek lookup. This is correct business logic - when retrieving last week's migration data, the function should check swap completion against the current week while using lastWeek for points and USD calculations.
src/services/gasless.ts (1)
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
src/apps/token-atlas/components/TokenGraphColumn/test/TokenGraphColumn.test.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
src/apps/pillarx-app/components/TopTokens/test/TopTokens.test.tsx (2)
Learnt from: RanaBug
PR: pillarwallet/x#290
File: src/apps/pillarx-app/components/TileTitle/TitleTitle.tsx:6-10
Timestamp: 2025-04-23T15:04:20.826Z
Learning: In this repository, TileTitleProps and TileTitle are different types that serve different purposes. TileTitleProps is used for the TileTitle component and has optional fields (title?, leftDecorator?, rightDecorator?), while TileTitle in api.ts has a required text field. The TileTitleProps interface aligns with the TokensMarketData.title type in api.ts which also has optional fields.
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
src/apps/pillarx-app/components/HorizontalToken/test/HorizontalToken.test.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#290
File: src/apps/pillarx-app/components/TileTitle/TitleTitle.tsx:6-10
Timestamp: 2025-04-23T15:04:20.826Z
Learning: In this repository, TileTitleProps and TileTitle are different types that serve different purposes. TileTitleProps is used for the TileTitle component and has optional fields (title?, leftDecorator?, rightDecorator?), while TileTitle in api.ts has a required text field. The TileTitleProps interface aligns with the TokensMarketData.title type in api.ts which also has optional fields.
src/apps/token-atlas/components/TokensSlider/test/TokenSlider.test.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
src/pages/App/index.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
src/components/AppsList.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
src/apps/leaderboard/components/PointsCards/tests/GasNewDropCard.test.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#334
File: src/apps/leaderboard/utils/index.tsx:91-94
Timestamp: 2025-06-17T09:20:44.533Z
Learning: In src/apps/leaderboard/utils/index.tsx, the getLastWeekMigrationData function intentionally uses currentWeek (not lastWeek) for the completedSwapWeek lookup. This is correct business logic - when retrieving last week's migration data, the function should check swap completion against the current week while using lastWeek for points and USD calculations.
src/apps/the-exchange/components/ExchangeAction/test/ExchangeAction.test.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
src/apps/the-exchange/components/CardsSwap/test/CardSwap.test.tsx (2)
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
Learnt from: RanaBug
PR: pillarwallet/x#334
File: src/apps/leaderboard/utils/index.tsx:91-94
Timestamp: 2025-06-17T09:20:44.533Z
Learning: In src/apps/leaderboard/utils/index.tsx, the getLastWeekMigrationData function intentionally uses currentWeek (not lastWeek) for the completedSwapWeek lookup. This is correct business logic - when retrieving last week's migration data, the function should check swap completion against the current week while using lastWeek for points and USD calculations.
src/components/BottomMenuModal/SendModal/SendModalTokensTabView.tsx (1)
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
src/apps/pillarx-app/components/WalletPortfolioTile/test/WalletPortfolioTile.test.tsx (2)
Learnt from: RanaBug
PR: pillarwallet/x#290
File: src/apps/pillarx-app/components/TileTitle/TitleTitle.tsx:6-10
Timestamp: 2025-04-23T15:04:20.826Z
Learning: In this repository, TileTitleProps and TileTitle are different types that serve different purposes. TileTitleProps is used for the TileTitle component and has optional fields (title?, leftDecorator?, rightDecorator?), while TileTitle in api.ts has a required text field. The TileTitleProps interface aligns with the TokensMarketData.title type in api.ts which also has optional fields.
Learnt from: RanaBug
PR: pillarwallet/x#290
File: src/apps/pillarx-app/components/TileTitle/TitleTitle.tsx:6-10
Timestamp: 2025-04-23T15:04:20.826Z
Learning: In this repository, TileTitleProps and TileTitle are different types that serve different purposes. TileTitleProps is used for the TileTitle component and has optional fields (title?, leftDecorator?, rightDecorator?), while TileTitle in api.ts has a required title field. The TileTitleProps structure aligns with how it's used in the TokensMarketData type in api.ts.
src/apps/pillarx-app/components/TokensVerticalList/test/TokensVerticalList.test.tsx (3)
Learnt from: RanaBug
PR: pillarwallet/x#275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.
Learnt from: RanaBug
PR: pillarwallet/x#290
File: src/apps/pillarx-app/components/TileTitle/TitleTitle.tsx:6-10
Timestamp: 2025-04-23T15:04:20.826Z
Learning: In this repository, TileTitleProps and TileTitle are different types that serve different purposes. TileTitleProps is used for the TileTitle component and has optional fields (title?, leftDecorator?, rightDecorator?), while TileTitle in api.ts has a required text field. The TileTitleProps interface aligns with the TokensMarketData.title type in api.ts which also has optional fields.
Learnt from: RanaBug
PR: pillarwallet/x#290
File: src/apps/pillarx-app/components/TileTitle/TitleTitle.tsx:6-10
Timestamp: 2025-04-23T15:04:20.826Z
Learning: In this repository, TileTitleProps and TileTitle are different types that serve different purposes. TileTitleProps is used for the TileTitle component and has optional fields (title?, leftDecorator?, rightDecorator?), while TileTitle in api.ts has a required title field. The TileTitleProps structure aligns with how it's used in the TokensMarketData type in api.ts.
🧬 Code Graph Analysis (8)
src/components/LandingPage/PopupMailChimp/index.jsx (1)
src/components/LandingPage/Form/index.jsx (1)
domain(31-31)
src/components/LandingPage/Form/index.jsx (1)
src/components/LandingPage/PopupMailChimp/index.jsx (1)
domain(7-7)
src/components/AppsList.tsx (1)
src/apps/index.ts (1)
loadApps(53-92)
src/containers/Main.tsx (2)
src/apps/the-exchange/index.tsx (1)
App(25-76)src/apps/sign-message/index.tsx (1)
App(37-85)
src/components/BottomMenu/BottomMenu.test.tsx (1)
src/store.ts (2)
store(65-77)addMiddleware(50-60)
src/apps/index.ts (1)
src/types/index.ts (1)
AppManifest(6-10)
src/apps/pillarx-app/components/WalletConnectDropdown/test/WalletConnectDropdown.test.tsx (1)
src/services/walletConnect.ts (1)
useWalletConnect(40-722)
src/apps/pillarx-app/components/TokensVerticalList/test/TokensVerticalList.test.tsx (1)
src/store.ts (1)
store(65-77)
🪛 Gitleaks (8.26.0)
.env.example
2-2: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
3-3: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
🪛 LanguageTool
src/apps/README.md
[uncategorized] ~32-~32: Possible missing comma found.
Context: ...y in your .env file to match your app identifier i.e. your-app-identifier. You may nee...
(AI_HYDRA_LEO_MISSING_COMMA)
🔇 Additional comments (118)
.env.example (1)
1-11: LGTM on the VITE_ prefix migration.The environment variable prefix change from
REACT_APP_toVITE_is correct for the Vite migration..eslintrc.json (1)
93-93: LGTM on ignoring setupTests.ts.Adding
setupTests.tsto the ignore patterns is appropriate for the Vitest migration, as test setup files often contain framework-specific patterns that may trigger ESLint warnings.src/utils/__tests__/blockchain.test.ts (1)
18-18: LGTM on the Vitest migration.Correctly updated from
jest.clearAllMocks()tovi.clearAllMocks()for the Vitest testing framework.src/components/BottomMenuModal/SendModal/SendModal.test.skip.tsx (1)
210-210: LGTM on the Vitest cleanup call.Correctly updated to use
vi.clearAllMocks()for Vitest.src/apps/leaderboard/components/InfoBanner/InfoBanner.tsx (1)
5-5: LGTM! Correct Vite SVG import syntax.The SVG import has been properly updated from CRA's
ReactComponentsyntax to Vite's?reactsuffix approach, which works seamlessly with the existing component usage.src/providers/__tests__/GlobalTransactionsBatchProvider.test.tsx (1)
86-86: Globalviis correctly available via Vitest configurationVitest’s
test.globals: trueinvite.config.jsexposesvi(and other test APIs) as globals, so no explicitimport { vi } from 'vitest'is required in your test files.• vite.config.js
test: { globals: true, … }Ignore the prior recommendation to add explicit
viimports.Likely an incorrect or invalid review comment.
src/vite-env.d.ts (1)
1-2: LGTM! Proper Vite TypeScript setup.The reference directives correctly enable TypeScript support for Vite client types and SVGR plugin, which are essential for the migration from CRA to Vite.
src/hooks/useDeployWallet.tsx (1)
51-51: Environment variable migration looks correct.The changes from
process.env.REACT_APP_ETHERSPOT_DATA_API_KEYtoimport.meta.env.VITE_ETHERSPOT_DATA_API_KEYare properly implemented for the Vite migration. Both functions maintain appropriate error handling for missing API keys.Also applies to: 89-89
src/services/userOpStatus.ts (1)
8-8: Environment variable migration is correct.The change from
process.env.REACT_APP_ETHERSPOT_DATA_API_KEYtoimport.meta.env.VITE_ETHERSPOT_DATA_API_KEYis properly implemented for the Vite migration with appropriate error handling.src/apps/deposit/index.tsx (1)
53-53: Environment variable migration with proper fallback.The change from
process.env.REACT_APP_REOWN_PROJECT_IDtoimport.meta.env.VITE_REOWN_PROJECT_IDis correctly implemented for the Vite migration. The fallback to empty string is appropriate for the AppKit configuration.src/apps/pillarx-app/components/HighlightedMediaGridTile/test/HighlightedMediaGridTile.test.tsx (1)
8-10: Jest to Vitest migration is correct.The changes from
jest.mocktovi.mockandjest.fntovi.fnare properly implemented for the Vitest migration. The test logic and structure remain unchanged.src/apps/the-exchange/index.tsx (1)
52-52: Environment variable migration is correct.The change from
process.env.REACT_APP_LIFI_API_KEYtoimport.meta.env.VITE_LIFI_API_KEYis properly implemented for the Vite migration. The LiFi SDK will handle the undefined case appropriately.src/apps/pillarx-app/components/WalletAdddressOverview/test/WalletAddressOverview.test.tsx (1)
15-15: LGTM!The Jest to Vitest migration for
clearAllMocksis correct.src/apps/README.md (1)
35-35: LGTM!Environment variable example correctly updated to use the Vite prefix.
src/apps/the-exchange/components/SelectToken/test/SelectToken.test.tsx (1)
23-23: LGTM!The Jest to Vitest migration for
vi.fn()is correct.src/apps/pillarx-app/components/MediaGridCollection/tests/DisplayCollectionImage.test.tsx (1)
7-7: Vitest migration verified –viglobal is configured
The switch fromjest.fn()/jest.clearAllMocks()tovi.fn()/vi.clearAllMocks()is correct, andtest.globals: trueis set in vite.config.js, ensuring theviglobal is available.src/containers/Authorized.tsx (1)
53-55: Ensure VITE_ETHERSPOT_ vars in actual .env files*I can see
VITE_ETHERSPOT_BUNDLER_API_KEYandVITE_ETHERSPOT_DATA_API_KEYdefined in.env.example, but they don’t appear in any.envfile. Please add them to your local and environment-specific files to avoid runtime errors:
- .env
- .env.local
- .env.development
- .env.production
You can verify with:
grep -R "VITE_ETHERSPOT" . --include ".env*" -nsrc/components/LandingPage/Popup/index.jsx (1)
7-7: Environment variable migration is consistent with Vite conventions.The change from
process.env.REACT_APP_PLAUSIBLE_DOMAINtoimport.meta.env.VITE_PLAUSIBLE_DOMAINis consistent with the broader migration to Vite.src/components/LandingPage/PopupMailChimp/index.jsx (1)
7-7: Environment variable migration maintains consistency.The change to
import.meta.env.VITE_PLAUSIBLE_DOMAINis consistent with the identical change in thePopupcomponent and the broader Vite migration.src/apps/token-atlas/components/TokenGraphColumn/test/TokenGraphColumn.test.tsx (1)
90-90: Jest to Vitest mock migration is correct.The change from
jest.mocktovi.mockfollows the consistent testing framework migration pattern while preserving the mock implementation.src/apps/token-atlas/components/TokenCard/test/TokenCard.test.tsx (1)
9-9: Vitest migration correct and globalviconfirmedThe Jest→Vitest updates (
jest.fn()→vi.fn(),jest.clearAllMocks()→vi.clearAllMocks()) are implemented correctly, and your Vitest config already enables globals. No changes are needed.• vite.config.js (test.globals: true)
• src/apps/token-atlas/components/TokenCard/test/TokenCard.test.tsx (usesvi.fn())src/pages/WaitList.jsx (1)
12-12: LGTM! Environment variable migration correctly implemented.The migration from Create React App environment variable format to Vite format is correctly done.
src/utils/blockchain.ts (1)
32-32: LGTM! Environment variable migration correctly implemented.The migration from Create React App to Vite environment variable format is correctly done while preserving the existing logic.
src/pages/App/App.test.tsx (1)
11-11: LGTM! Comprehensive Jest to Vitest migration correctly implemented.The migration includes proper type imports, mock type annotations, and cleanup functions. All changes align with Vitest API requirements.
Also applies to: 58-58, 101-101
src/apps/the-exchange/components/DropdownTokensList/test/DropdownTokensList.test.tsx (1)
53-107: LGTM! Comprehensive Jest to Vitest mocking migration correctly implemented.The migration systematically updates all Jest mocking functions to their Vitest equivalents while preserving the exact same mock behavior and return values. The implementation is consistent and correct.
src/hooks/__tests__/useAccountTransactionHistory.test.tsx (6)
11-11: LGTM: Jest to Vitest migration correctly implemented.The mock declaration has been properly updated to use Vitest's
vi.mocksyntax.
13-14: Good practice: Clear documentation for skipped tests.The comment clearly explains why tests are being skipped, which is helpful for future maintainers.
33-42: LGTM: Mock functions migrated to Vitest.All
jest.fn()calls have been correctly replaced withvi.fn()in the mock context value.
51-51: LGTM: Cleanup function updated for Vitest.The
vi.clearAllMocks()properly replaces the Jest equivalent for test cleanup.
72-77: LGTM: Test properly skipped with Vitest syntax.The test is correctly skipped using
it.skipand the spy function has been migrated tovi.spyOn.
79-83: LGTM: Consistent migration for second skipped test.Both the skip syntax and mock functions are correctly updated for Vitest.
src/apps/the-exchange/components/SelectDropdown/test/SelectDropdown.test.tsx (3)
55-69: LGTM: Module mock migrated to Vitest.The mock declaration correctly uses
vi.mockandvi.fn()for the tokensData service mock.
73-73: LGTM: Test cleanup updated for Vitest.Proper migration from
jest.clearAllMocks()tovi.clearAllMocks().
92-93: LGTM: Mock functions consistently migrated.Both callback mock functions are correctly updated to use
vi.fn().src/apps/leaderboard/components/Leaderboards/tests/Leaderboards.test.tsx (2)
8-15: LGTM: Proper ES module mocking structure for Vitest.The mocks correctly use
vi.mockwith explicit__esModule: trueanddefaultexport structure, which ensures proper ES module compatibility in Vitest.
19-19: LGTM: Test cleanup migrated to Vitest.Consistent migration from Jest to Vitest cleanup function.
src/containers/Main.test.tsx (1)
7-22: LGTM: Comprehensive Wagmi mock migrated to Vitest.The mock correctly uses:
vi.mockfor module mockingvi.importActualfor preserving actual exportsvi.fn()for mock functionsThe mock structure and behavior are preserved while properly migrating to Vitest.
src/providers/__tests__/AllowedAppsProvider.test.tsx (3)
5-6: LGTM: Type import updated for Vitest.Correctly imports the
Mocktype from Vitest instead of Jest for proper TypeScript support.
28-30: LGTM: Mock casting updated for Vitest.The mock implementation correctly casts to Vitest's
Mocktype instead ofjest.Mock.
54-54: LGTM: Consistent cleanup migration.Proper migration to
vi.clearAllMocks()for test cleanup.src/apps/leaderboard/components/PxPointsSummary/tests/PxPointsSummary.test.tsx (1)
5-5: LGTM! Clean Jest to Vitest migration.The migration from Jest to Vitest has been executed correctly:
- Proper import of
Mocktype from vitest- Consistent replacement of
jest.mockwithvi.mockandjest.fn()withvi.fn()- Correct type casting updates from
jest.MocktoMockAll test logic remains unchanged, focusing only on the testing framework API updates.
Also applies to: 14-16, 19-24, 26-31, 33-38, 40-45, 115-115, 187-187
src/apps/leaderboard/components/LeaderboardTab/test/LeaderboardTab.test.tsx (1)
28-28: LGTM! Consistent Jest to Vitest migration.The migration has been properly executed:
jest.fn()correctly replaced withvi.fn()jest.spyOn()consistently replaced withvi.spyOn()All spying and mocking logic remains intact while adapting to Vitest's API.
Also applies to: 37-37, 75-77, 88-88
src/apps/leaderboard/components/UserInfo/test/UserInfo.test.tsx (1)
10-15: LGTM! Complete Jest to Vitest migration.The migration correctly updates:
- Component mocking from
jest.mocktovi.mock- Timer utilities from
jest.useFakeTimers()/jest.useRealTimers()to their Vitest equivalentsAll test functionality is preserved while adapting to the new testing framework.
Also applies to: 26-26, 30-30
src/apps/pillarx-app/components/HorizontalToken/test/HorizontalToken.test.tsx (1)
12-23: LGTM! Enhanced Jest to Vitest migration with improved mocks.The migration properly updates the mocking approach:
jest.mockcorrectly replaced withvi.mock- Enhanced mock structure with explicit
__esModule: trueandvi.fn()returns- Maintains component isolation while improving mock flexibility
The explicit ES module structure follows Vitest best practices.
src/services/gasless.ts (1)
29-29: LGTM! Correct environment variable migration for Vite.The environment variable access has been properly updated from
process.env.REACT_APP_PAYMASTER_URLtoimport.meta.env.VITE_PAYMASTER_URL, aligning with Vite's environment variable conventions.This change is consistent with the broader migration from Create React App to Vite build tooling.
src/components/LandingPage/Form/index.jsx (1)
31-31: Environment variable migration looks correct.The change from
process.env.REACT_APP_PLAUSIBLE_DOMAINtoimport.meta.env.VITE_PLAUSIBLE_DOMAINproperly aligns with the CRA-to-Vite migration and is consistent with similar updates across the codebase.src/apps/pillarx-app/components/PrimeTokensBalance/test/PrimeTokensBalance.test.tsx (1)
5-5: Jest to Vitest migration implemented correctly.All testing framework changes are properly implemented:
- Type imports updated from Jest to Vitest
- Mock functions (
vi.mock) and spies (vi.spyOn) correctly updated- Mock type casting updated to use Vitest's
Mocktype- Mock clearing updated to
vi.clearAllMocks()The test logic and assertions remain unchanged, which is appropriate for a framework migration.
Also applies to: 20-21, 24-24, 29-29, 32-32
src/apps/pillarx-app/components/TopTokens/test/TopTokens.test.tsx (1)
3-3: Jest to Vitest migration implemented consistently.All testing framework changes are correctly applied:
- Type imports updated to use Vitest's
Mocktype- Mock functions consistently updated to
vi.mock- Mock type casting updated throughout the file
- Mock clearing updated to
vi.clearAllMocks()- Service mocking properly updated with Vitest types
The test logic and assertions remain unchanged, maintaining test integrity during the framework migration.
Also applies to: 14-15, 17-17, 57-57, 136-138, 161-163
src/components/BottomMenu/BottomMenu.test.tsx (1)
11-12: Jest to Vitest migration implemented correctly.All testing framework changes are properly applied:
- Type imports added for Vitest's
Mocktype- Mock clearing consistently updated to
vi.clearAllMocks()- Mock implementations updated to use Vitest types
- Changes applied consistently across both test cases
The test logic and component rendering remain unchanged, preserving test integrity during the framework migration.
Also applies to: 48-48, 54-54, 95-95, 99-99
public/site.webmanifest (1)
1-21: All PWA icons verified – manifest is readyBoth referenced icon files were found in
public/and have the correct filenames and permissions:
- public/web-app-manifest-192x192.png (9 365 bytes)
- public/web-app-manifest-512x512.png (62 937 bytes)
The manifest structure and assets are in place—ready to merge.
src/apps/the-exchange/components/EnterAmount/test/EnterAmount.test.tsx (2)
57-78: LGTM! Correct Jest to Vitest migration pattern.The mock replacements follow the correct Vitest migration pattern, maintaining the same mock structure while using
vi.mockandvi.fn()instead of Jest equivalents.
82-82: LGTM! Correct Vitest mock clearing.The replacement of
jest.clearAllMocks()withvi.clearAllMocks()is correct for the Vitest migration.src/providers/__tests__/AccountNftsProvider.test.tsx (4)
9-11: LGTM! Correct Vitest type import.Proper import of the
Mocktype from Vitest to replace Jest's mock typing.
60-83: LGTM! Comprehensive Jest to Vitest migration.All Jest mocking utilities have been correctly replaced with their Vitest equivalents, maintaining the same mock behavior.
172-172: Good addition of test timeout.The 10-second timeout is appropriate for async operations that might take longer during the testing framework migration.
25-25: Confirm skipped test suites across the codebase are intentionalI’ve found several test files marked with
.skip, including but not limited to:
- src/providers/tests/AccountTransactionHistoryProvider.test.tsx (line 19)
- src/providers/tests/AccountNftsProvider.test.tsx (line 25)
- src/pages/App/App.test.tsx (line 23)
- src/hooks/tests/useAccountTransactionHistory.test.tsx (lines 72, 79)
- src/apps/pillarx-app/components/PointsTile/test/PointsTile.test.tsx (line 44)
- src/apps/pillarx-app/components/MediaGridCollection/tests/DisplayCollectionImage.test.tsx (line 20)
Please verify that skipping all of these suites/tests is intentional (e.g., part of a controlled migration plan). If any should remain active, remove the
.skipand address the underlying failures or add a clarifying comment/TODO with an expected timeline for re-enabling.tsconfig.json (2)
23-24: LGTM! Proper Vite/Vitest TypeScript configuration.The addition of
vite/client,node, andvitest/globalstypes provides necessary type definitions for the Vite build system and Vitest testing framework.
26-26: LGTM! Include Vite configuration in compilation.Adding
vite.config.tsto the include array ensures the Vite configuration file is properly type-checked.src/components/AppsList.tsx (1)
43-48: LGTM! Correct async pattern for useEffect.The implementation properly handles the asynchronous
loadAppsfunction by creating an inner async functionfetchAppsand invoking it immediately. This follows React best practices for async operations in useEffect.src/apps/the-exchange/components/ExchangeAction/test/ExchangeAction.test.tsx (3)
89-104: LGTM! Proper ES module mock pattern.The mock structure correctly uses
__esModule: trueanddefaultexport pattern to ensure ES module compatibility with Vitest. The expandeduseBottomMenuModalmock withopen,close, andisOpenproperties provides better test coverage.
106-130: LGTM! Comprehensive Jest to Vitest migration.All Jest mocking utilities have been systematically replaced with their Vitest equivalents while maintaining the same mock behavior and return values.
134-134: LGTM! Correct Vitest mock clearing.The replacement of
jest.clearAllMocks()withvi.clearAllMocks()is correct for the Vitest migration.src/main.tsx (2)
32-35: Sentry configuration updated correctly.The Sentry DSN and environment configuration properly uses the new Vite environment variables while maintaining the fallback to
process.env.NODE_ENVfor the environment setting.
21-29: Ensure VITE_ environment variables are defined*The migration from
process.env.REACT_APP_*toimport.meta.env.VITE_*insrc/main.tsxis correct, but no.env*files withVITE_variables were found in the repo. Please verify that the following variables are defined in your environment (e.g., appropriate.envfiles or CI secrets):
- VITE_VERSION
- VITE_COMMIT_SHA
- VITE_SENTRY_DSN
- VITE_SENTRY_ENVIRONMENT
src/apps/token-atlas/components/TokensSlider/test/TokenSlider.test.tsx (4)
6-7: Import migration from Jest to Vitest types is correct.
25-27: Mock setup migration is properly implemented.The transition from
jest.mockandjest.fn()tovi.mockandvi.fn()is correct for the Vitest framework.
50-50: Mock cleanup migration is correct.The change from
jest.clearAllMocks()tovi.clearAllMocks()aligns with the Vitest framework migration.
57-57: Mock type casting updated consistently.All instances of
jest.Mockhave been properly replaced with the VitestMocktype throughout the test file.Also applies to: 77-77, 96-96, 115-115, 151-151
vite.config.js (1)
1-19: Confirmed test setup file exists and configured correctly
- Found
src/test-utils/setupTests.tswith comprehensive setup:
- TextEncoder/TextDecoder polyfills at top
- Imports for React, jest-dom, jest-styled-components
- Mocks for Firebase, Axios, Etherspot, Wagmi, Privy, etc.
- Viem and Wagmi client mocks pointing to localhost
- Vite config and test setup align; no further changes needed.
src/apps/pillarx-app/components/ReceiveModal/test/ReceiveModal.test.tsx (6)
4-5: Import migration to Vitest types is correct.
14-24: Module mocking migration is properly implemented.The transition from
jest.requireActualtovi.importActualandjest.fn()tovi.fn()is correct for Vitest.
26-29: Mock setup migration is consistent.The module mocking using
vi.mockandvi.fn()follows Vitest conventions correctly.
32-40: Variable declarations and cleanup updated correctly.The mock type casting and
vi.clearAllMocks()usage aligns with the Vitest framework migration.
51-51: Mock type casting consistently updated throughout.All instances of mock type assertions have been properly updated to use the Vitest
Mocktype.Also applies to: 61-61, 74-74, 87-87, 110-110, 122-122, 143-143
89-92: Spy function migration is correct.The transition from
jest.spyOntovi.spyOnmaintains the same functionality while using the Vitest framework.Also applies to: 124-127, 145-148
src/providers/__tests__/AccountTransactionHistoryProvider.test.tsx (4)
17-19: Test suite appropriately skipped with clear explanation.The skip is justified due to the provider being removed in an upcoming TransactionKit version, preventing potential maintenance overhead.
44-44: Jest to Vitest migration is comprehensive and correct.All Jest utilities have been properly replaced with their Vitest equivalents, including mocks, spies, and functions.
Also applies to: 56-78, 112-112, 125-125
123-123: Timer utilities migration is correct.The transition from
jest.useFakeTimers()andjest.runAllTimers()to theirvi.*equivalents maintains the same testing behavior.Also applies to: 157-157
169-169: Mock cleanup migration is consistent.The change to
vi.clearAllMocks()aligns with the overall Vitest framework migration.src/containers/Main.tsx (4)
3-3: LGTM: Import reordering for consistency.The imports have been reordered to group related imports together, which improves code organization.
Also applies to: 20-20
247-252: LGTM: Environment variable migration to Vite format.The environment variable references have been correctly updated from
process.env.REACT_APP_*toimport.meta.env.VITE_*format, which is consistent with the Vite migration.
337-337: LGTM: WalletConnect project ID updated for Vite.The WalletConnect project ID environment variable has been correctly migrated to the Vite format.
362-362: LGTM: Privy app ID updated for Vite.The Privy app ID environment variable has been correctly migrated to the Vite format.
src/apps/leaderboard/components/PointsCards/tests/GasNewDropCard.test.tsx (1)
17-24: LGTM: Improved time mocking with Vitest fake timers.The migration from Jest module mocking to Vitest fake timers is a cleaner approach. The
vi.useFakeTimers()andvi.setSystemTime()provide better control over time, and the cleanup withvi.useRealTimers()is properly handled.src/apps/pillarx-app/components/WalletPortfolioGraph/tests/WalletPortfolioGraph.test.tsx (4)
4-4: LGTM: Type import updated for Vitest.The Mock type import has been correctly updated from Jest to Vitest.
23-56: LGTM: Module mocks migrated to Vitest.All
jest.mockcalls have been correctly updated tovi.mock, maintaining the same mock implementations while using Vitest's API.
58-59: LGTM: Mock functions and utilities updated.The mock function creation (
vi.fn()) and mock clearing (vi.clearAllMocks()) have been correctly migrated to Vitest, including proper type casting.Also applies to: 63-63
67-75: LGTM: Mock implementation updated for Vitest.The mock implementation casting has been correctly updated to use Vitest's Mock type.
src/pages/App/index.tsx (3)
72-86: LGTM: Improved async app loading.The refactoring to make app loading asynchronous is a good improvement. Moving the spring animation start inside the async function ensures it runs after the app is loaded, which provides better timing control.
96-96: LGTM: Vite ignore comment prevents pre-bundling.The
/* @vite-ignore */comment is correctly added to prevent Vite from pre-bundling or transforming the dynamic import path, which is necessary for runtime module resolution.
100-101: LGTM: Enhanced error handling.The addition of
console.errorprovides better debugging information when app component loading fails, which is a valuable improvement.src/apps/pillarx-app/components/WalletConnectDropdown/test/WalletConnectDropdown.test.tsx (5)
5-5: LGTM: Mock type import updated for Vitest.The Mock type import has been correctly updated from Jest to Vitest.
13-14: LGTM: Mock setup migrated to Vitest.The module mocking and function mocking have been correctly updated to use Vitest's
vi.mock()andvi.fn()APIs.Also applies to: 19-19
26-28: LGTM: Mock interface types updated.The interface has been correctly updated to use
vi.mocktypes instead of Jest mock types.
41-43: LGTM: Test setup functions migrated.The mock function setup and clearing have been correctly updated to use Vitest's API, including proper type casting.
Also applies to: 46-47
83-84: LGTM: Mock implementations updated throughout.All mock implementations and type casting have been consistently updated to use Vitest's Mock type and API.
Also applies to: 99-99, 120-120, 144-144
src/apps/pillarx-app/components/WalletPortfolioBalance/test/WalletPortfolioBalance.test.tsx (1)
4-42: LGTM: Clean Jest to Vitest migrationThe migration from Jest to Vitest is well-executed with proper:
- Vitest Mock type import
- ES module mock structure for image assets
- Consistent vi.mock/vi.fn() usage throughout
- Proper mock clearing in beforeEach
__mocks__/walletConnectMock.ts (1)
3-43: LGTM: Straightforward mock migrationAll Jest mocking utilities correctly migrated to Vitest equivalents while preserving the original mock behavior and structure.
package.json (2)
3-3: Significant version bump to 1.0.0This represents a major version release. Ensure this aligns with your versioning strategy and that breaking changes are properly documented for consumers.
90-142: LGTM: Comprehensive Vite/Vitest dependency migrationThe dependency updates properly support the Vite ecosystem:
- Added vite-plugin-svgr for SVG support
- Added @vitejs/plugin-react for React support
- Updated to latest Vite and Vitest versions
- Maintained necessary testing utilities
src/apps/pillarx-app/components/WalletPortfolioTile/test/WalletPortfolioTile.test.tsx (1)
20-178: LGTM: Comprehensive Jest to Vitest migrationExcellent migration covering all testing utilities:
- Mock components properly updated to vi.mock
- Spy functions converted to vi.spyOn
- Timer utilities correctly migrated (vi.useFakeTimers, vi.advanceTimersByTime, vi.useRealTimers)
- Mock implementations preserve original behavior
The test logic remains intact while fully adopting Vitest framework.
src/apps/pillarx-app/components/TokensVerticalList/test/TokensVerticalList.test.tsx (3)
5-6: LGTM: Improved test setup with Redux ProviderAdding Redux Provider wrapper ensures the component is tested within proper Redux context, which is essential for Redux-connected components.
12-17: LGTM: Clean mock migration to VitestMock implementation properly updated to use vi.fn() while maintaining ES module structure.
51-113: LGTM: Consistent Redux Provider usage across all testsAll test cases now properly wrap components with Redux Provider, ensuring consistent test environment. The assertion adaptations appropriately focus on rendered content rather than direct prop inspection.
src/test-utils/setupTests.ts (3)
5-47: Well-implemented TextEncoder/TextDecoder polyfill.The polyfill implementation correctly wraps Node.js utilities to match the Web API interface. The approach of checking
globalThis.TextEncoderfirst and creating wrapper classes is sound.
61-83: Jest to Vitest migration correctly implemented.All Jest mocking functions have been properly replaced with their Vitest equivalents (
vi.fn(),vi.mock). The mock implementations maintain the same behavior as the original Jest versions.
225-225: Environment variable migration completed correctly.The change from
process.env.REACT_APP_PRIVY_APP_IDtoimport.meta.env.VITE_PRIVY_APP_IDis consistent with the Vite migration pattern used throughout the codebase.src/components/BottomMenuModal/SendModal/SendModalTokensTabView.tsx (1)
136-136: Environment variable migration implemented correctly.The change from
process.env.REACT_APP_PAYMASTER_URLtoimport.meta.env.VITE_PAYMASTER_URLfollows the consistent pattern for the Vite migration. This ensures the paymaster URL is accessible in the Vite environment.index.html (4)
1-1: DOCTYPE normalized to lowercase format.The change to lowercase
<!doctype html>follows modern HTML5 standards and is consistent with Vite's default template.
7-7: Environment variable placeholders updated correctly.The migration from
%REACT_APP_*%to%VITE_*%placeholders is consistent with Vite's environment variable handling. This ensures analytics and tracking scripts receive the correct configuration values.Also applies to: 16-16, 21-21, 26-26
47-47: Asset references updated for Vite build system.The favicon and manifest paths have been updated from CRA's
%PUBLIC_URL%format to direct paths, which is appropriate for Vite's asset handling. The additional icon formats provide better cross-platform compatibility.Also applies to: 55-60
78-78: Vite entry point script added correctly.The module script tag for
/src/main.jsxis the correct entry point format for Vite applications.src/apps/the-exchange/components/CardsSwap/test/CardSwap.test.tsx (3)
54-61: Jest to Vitest migration completed successfully.All Jest mocking functions (
jest.mock,jest.fn,jest.clearAllMocks) have been properly replaced with their Vitest equivalents (vi.mock,vi.fn,vi.clearAllMocks). The mock implementations maintain the same behavior and structure.Also applies to: 63-141, 144-165
94-96: Mock data enhanced with balance and price properties.The addition of
balanceandpriceproperties to the mock token data makes the tests more realistic and comprehensive, better reflecting the actual data structure used in the application.Also applies to: 105-107
183-183: Environment variable access updated for Vite.The change from
process.env.REACT_APP_SWAP_BUTTON_SWITCHtoimport.meta.env.VITE_SWAP_BUTTON_SWITCHis consistent with the Vite migration pattern throughout the codebase.src/apps/index.ts (3)
6-39: Async function implementation and documentation are excellent.The conversion of
loadAppto an async function with proper error handling and comprehensive JSDoc documentation improves code maintainability. The/* @vite-ignore */comment is correctly used to prevent Vite from pre-bundling dynamic imports.
41-92: Async loadApps function properly implemented.The function correctly awaits the
loadAppcalls and maintains the original logic flow. The environment variable migration fromprocess.env.REACT_APP_*toimport.meta.env.VITE_*is consistently applied throughout the function.
78-81: Environment variable migration completed correctly.The updates from
process.env.REACT_APP_PX_DEVELOPMENT_IDtoimport.meta.env.VITE_PX_DEVELOPMENT_IDfollow the consistent migration pattern and ensure proper access to development environment variables in Vite.Also applies to: 86-86
| VITE_ETHERSPOT_BUNDLER_API_KEY="eyJvcmciOiI2NTIzZjY5MzUwOTBmNzAwMDFiYjJkZWIiLCJpZCI6IjMxMDZiOGY2NTRhZTRhZTM4MGVjYjJiN2Q2NDMzMjM4IiwiaCI6Im11cm11cjEyOCJ9" | ||
| VITE_ETHERSPOT_DATA_API_KEY="eyJvcmciOiI2NTIzZjY5MzUwOTBmNzAwMDFiYjJkZWIiLCJpZCI6IjI4ZWJiMGQ5YTMxYjQ3MmY4NmU4MWY2YTVhYzBhMzE1IiwiaCI6Im11cm11cjEyOCJ9" |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Consider using placeholder values for API keys in example file.
The values for VITE_ETHERSPOT_BUNDLER_API_KEY and VITE_ETHERSPOT_DATA_API_KEY appear to be actual API keys rather than placeholder examples. Consider replacing them with placeholder values like "your-bundler-api-key-here" to avoid potential credential exposure.
-VITE_ETHERSPOT_BUNDLER_API_KEY="eyJvcmciOiI2NTIzZjY5MzUwOTBmNzAwMDFiYjJkZWIiLCJpZCI6IjMxMDZiOGY2NTRhZTRhZTM4MGVjYjJiN2Q2NDMzMjM4IiwiaCI6Im11cm11cjEyOCJ9"
-VITE_ETHERSPOT_DATA_API_KEY="eyJvcmciOiI2NTIzZjY5MzUwOTBmNzAwMDFiYjJkZWIiLCJpZCI6IjI4ZWJiMGQ5YTMxYjQ3MmY4NmU4MWY2YTVhYzBhMzE1IiwiaCI6Im11cm11cjEyOCJ9"
+VITE_ETHERSPOT_BUNDLER_API_KEY="your-etherspot-bundler-api-key-here"
+VITE_ETHERSPOT_DATA_API_KEY="your-etherspot-data-api-key-here"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| VITE_ETHERSPOT_BUNDLER_API_KEY="eyJvcmciOiI2NTIzZjY5MzUwOTBmNzAwMDFiYjJkZWIiLCJpZCI6IjMxMDZiOGY2NTRhZTRhZTM4MGVjYjJiN2Q2NDMzMjM4IiwiaCI6Im11cm11cjEyOCJ9" | |
| VITE_ETHERSPOT_DATA_API_KEY="eyJvcmciOiI2NTIzZjY5MzUwOTBmNzAwMDFiYjJkZWIiLCJpZCI6IjI4ZWJiMGQ5YTMxYjQ3MmY4NmU4MWY2YTVhYzBhMzE1IiwiaCI6Im11cm11cjEyOCJ9" | |
| VITE_ETHERSPOT_BUNDLER_API_KEY="your-etherspot-bundler-api-key-here" | |
| VITE_ETHERSPOT_DATA_API_KEY="your-etherspot-data-api-key-here" |
🧰 Tools
🪛 Gitleaks (8.26.0)
2-2: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
3-3: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
🤖 Prompt for AI Agents
In the .env.example file at lines 2 to 3, the API key values are actual keys
instead of placeholders. Replace the current API key strings with generic
placeholder values such as "your-bundler-api-key-here" and
"your-data-api-key-here" to prevent exposing real credentials in the example
file.
There was a problem hiding this comment.
Mmm @IAmKio we should remove those API keys from the example file actually...
There was a problem hiding this comment.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
There was a problem hiding this comment.
These are the public API keys - severely rate limited but allows a developer to checkout the code and run immediately
src/apps/pillarx-app/components/HorizontalToken/HorizontalToken.tsx
Outdated
Show resolved
Hide resolved
src/apps/pillarx-app/components/GenericBannerTile/test/GenericBannerTile.test.tsx
Show resolved
Hide resolved
src/apps/the-exchange/components/TokenListItem/test/TokenListItem.test.tsx
Show resolved
Hide resolved
| const initWalletKit = useCallback(async () => { | ||
| const core = new Core({ | ||
| projectId: process.env.REACT_APP_REOWN_PROJECT_ID, | ||
| projectId: import.meta.env.VITE_REOWN_PROJECT_ID, |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Environment variable migration looks correct.
The change from process.env.REACT_APP_REOWN_PROJECT_ID to import.meta.env.VITE_REOWN_PROJECT_ID aligns with the Vite migration. However, verify that this environment variable is consistently updated across all configuration files.
🏁 Script executed:
#!/bin/bash
# Description: Verify all references to REOWN_PROJECT_ID use the new VITE_ prefix
# Expected: All occurrences should use VITE_REOWN_PROJECT_ID, not REACT_APP_REOWN_PROJECT_ID
echo "Searching for any remaining REACT_APP_REOWN_PROJECT_ID references:"
rg "REACT_APP_REOWN_PROJECT_ID"
echo -e "\nSearching for VITE_REOWN_PROJECT_ID references:"
rg "VITE_REOWN_PROJECT_ID"
echo -e "\nChecking .env files for the variable definition:"
fd -t f "\.env" --exec cat {} \; | grep -i "reown_project_id" || echo "No .env files found or variable not defined"Length of output: 758
Ensure VITE_REOWN_PROJECT_ID is defined in your environment files
All code references have been correctly migrated to the Vite pattern:
- src/services/walletConnect.ts
- src/apps/deposit/index.tsx
No instances of REACT_APP_REOWN_PROJECT_ID remain. However, no .env* files were detected in the repo sandbox, so please add the following to your environment config (e.g. .env, .env.local, .env.development, etc.):
VITE_REOWN_PROJECT_ID=<your_project_id>
This will guarantee the variable is available at build time.
🤖 Prompt for AI Agents
In src/services/walletConnect.ts at line 111, ensure that the environment
variable VITE_REOWN_PROJECT_ID is defined in your project's environment
configuration files such as .env, .env.local, or .env.development. Add the line
VITE_REOWN_PROJECT_ID=<your_project_id> to one of these files so that the
variable is available at build time and the
import.meta.env.VITE_REOWN_PROJECT_ID reference works correctly.
src/apps/pillarx-app/components/WalletAdddressOverview/test/WalletAddressOverview.test.tsx
Show resolved
Hide resolved
| {import.meta.env.VITE_SWAP_BUTTON_SWITCH === 'true' && | ||
| !isSwapOpen && | ||
| !isReceiveOpen && <SwitchCardsButton onSwap={swapCardsAction} />} |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Environment variable migration looks correct.
The change from process.env.REACT_APP_SWAP_BUTTON_SWITCH to import.meta.env.VITE_SWAP_BUTTON_SWITCH properly aligns with the Vite migration pattern.
🏁 Script executed:
#!/bin/bash
# Description: Verify all references to SWAP_BUTTON_SWITCH use the new VITE_ prefix
# Expected: All occurrences should use VITE_SWAP_BUTTON_SWITCH, not REACT_APP_SWAP_BUTTON_SWITCH
echo "Searching for any remaining REACT_APP_SWAP_BUTTON_SWITCH references:"
rg "REACT_APP_SWAP_BUTTON_SWITCH"
echo -e "\nSearching for VITE_SWAP_BUTTON_SWITCH references:"
rg "VITE_SWAP_BUTTON_SWITCH"
echo -e "\nChecking .env files for the variable definition:"
fd -t f "\.env" --exec cat {} \; | grep -i "swap_button_switch" || echo "No .env files found or variable not defined"Length of output: 839
Ensure VITE_SWAP_BUTTON_SWITCH Is Defined in Your Env Files
The migration from process.env.REACT_APP_SWAP_BUTTON_SWITCH to import.meta.env.VITE_SWAP_BUTTON_SWITCH is correct, but I couldn’t find any .env* file defining this variable. Without it, the flag will always be undefined (falsy).
Please add VITE_SWAP_BUTTON_SWITCH to your environment definition files (e.g., .env, .env.local, .env.development, or your repo’s .env.example) or provide a fallback in code.
• Files referencing the flag:
src/apps/the-exchange/components/CardsSwap/CardsSwap.tsxsrc/apps/the-exchange/components/CardsSwap/test/CardSwap.test.tsx
Suggested addition to .env.example:
VITE_SWAP_BUTTON_SWITCH=true
If you rely on CI/CD or other means to inject this variable, document its requirement in your README or .env.example.
🤖 Prompt for AI Agents
In src/apps/the-exchange/components/CardsSwap/CardsSwap.tsx around lines 117 to
119, the environment variable VITE_SWAP_BUTTON_SWITCH is used but not defined in
any .env files, causing it to always be undefined and the feature flag to fail.
Add VITE_SWAP_BUTTON_SWITCH=true to your .env.example and other relevant .env
files to ensure it is defined. Additionally, document this requirement in your
README or CI/CD configuration if the variable is injected externally.
package.json
Outdated
| "dev": "vite", | ||
| "build": "VITE_COMMIT_SHA=$CF_PAGES_COMMIT_SHA VITE_VERSION=$npm_package_version vite build", | ||
| "preview": "vite preview", | ||
| "test": "vitest", | ||
| "test:watch": "eslint . && jest --detectOpenHandles --watch", | ||
| "test:update": "eslint . && jest --updateSnapshot --detectOpenHandles", | ||
| "test:update": "vitest -u", | ||
| "test:ci": "jest --detectOpenHandles --silent -u", |
There was a problem hiding this comment.
Fix inconsistent test script commands
The migration to Vitest is incomplete - some test scripts still reference Jest while others use Vitest:
- "test:watch": "eslint . && jest --detectOpenHandles --watch",
+ "test:watch": "eslint . && vitest --watch",
- "test:ci": "jest --detectOpenHandles --silent -u",
+ "test:ci": "vitest run --silent",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "dev": "vite", | |
| "build": "VITE_COMMIT_SHA=$CF_PAGES_COMMIT_SHA VITE_VERSION=$npm_package_version vite build", | |
| "preview": "vite preview", | |
| "test": "vitest", | |
| "test:watch": "eslint . && jest --detectOpenHandles --watch", | |
| "test:update": "eslint . && jest --updateSnapshot --detectOpenHandles", | |
| "test:update": "vitest -u", | |
| "test:ci": "jest --detectOpenHandles --silent -u", | |
| "dev": "vite", | |
| "build": "VITE_COMMIT_SHA=$CF_PAGES_COMMIT_SHA VITE_VERSION=$npm_package_version vite build", | |
| "preview": "vite preview", | |
| "test": "vitest", | |
| "test:watch": "eslint . && vitest --watch", | |
| "test:update": "vitest -u", | |
| "test:ci": "vitest run --silent", |
🤖 Prompt for AI Agents
In package.json lines 6 to 12, the test scripts are inconsistent, mixing Jest
and Vitest commands. Update all test scripts to use Vitest exclusively by
replacing any Jest commands with their Vitest equivalents, ensuring consistency
across all test-related scripts.
|
|
||
| // images | ||
| import { ReactComponent as InfoIcon } from '../../images/info-icon.svg'; | ||
| import InfoIcon from '../../images/info-icon.svg?react'; |
| fromMillis: actualLuxon.DateTime.fromMillis, | ||
| }, | ||
| }; | ||
| // vi.mock('luxon', async () => { |
There was a problem hiding this comment.
Why is that commented out?
|
|
||
| jest.mock('../../HorizontalToken/HorizontalToken', () => 'HorizontalToken'); | ||
| jest.mock('../../Typography/Body', () => 'Body'); | ||
| vi.mock('../../Typography/Body', () => { |
|
|
||
| beforeEach(() => { | ||
| jest.clearAllMocks(); | ||
| vi.clearAllMocks(); |
|
|
||
| jest.mock('../../../../../services/walletConnect', () => ({ | ||
| useWalletConnect: jest.fn(), | ||
| vi.mock('../../../../../services/walletConnect', () => ({ |
| vi.mock('../../../../../hooks/useGlobalTransactionsBatch', () => ({ | ||
| _esModule: true, | ||
| default: vi.fn(() => ({ | ||
| addToBatch: vi.fn(), |
There was a problem hiding this comment.
did not need to mock showSend() function?
RanaBug
left a comment
There was a problem hiding this comment.
I've stopped putting the same comment everywhere but I noticed the { vi } in a lot of tests is not being imported (I think the tests files are excluded from eslint. checks as well)
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
package.json (1)
121-138: Redundant Jest toolchain bloats install size
babel-jest,jest*,ts-jest,identity-obj-proxy, etc. are no longer needed after the Vitest move. Retaining them:• Increases install time & node-modules size
• Risks accidental re-introduction of Jest in future scriptsPrune unused devDeps to keep the toolchain lean.
♻️ Duplicate comments (1)
package.json (1)
6-13:test:watchstill runs Jest – migration is incompleteThe PR aims to switch completely to Vitest, yet
test:watchstill invokesjest, which will break parity and CI consistency.- "test:watch": "eslint . && jest --detectOpenHandles --watch", + "test:watch": "eslint . && vitest --watch",Delete any lingering Jest-specific flags (
--detectOpenHandles) unless you add an equivalent Vitest plugin.
🧹 Nitpick comments (3)
package.json (3)
145-150: ESLint config still extends CRA presets
react-app/react-app/jestrely onreact-scripts, which is gone. This may pull in incompatible rules or peer-deps. Consider switching toeslint-config-react-app,eslint-plugin-react, or your own shareable config instead.
163-167:overrides.react-scriptssection is obsoleteWith CRA removed, the override serves no purpose and can be deleted.
88-88:terser-webpack-pluginno longer usedVite bundles via esbuild/rollup; this webpack-specific dependency can be removed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (20)
package.json(6 hunks)src/apps/leaderboard/components/Leaderboards/tests/Leaderboards.test.tsx(1 hunks)src/apps/leaderboard/components/UserInfo/test/UserInfo.test.tsx(2 hunks)src/apps/pillarx-app/components/WalletPortfolioBalance/test/WalletPortfolioBalance.test.tsx(3 hunks)src/apps/pillarx-app/components/WalletPortfolioGraph/tests/WalletPortfolioGraph.test.tsx(3 hunks)src/apps/pillarx-app/components/WalletPortfolioTile/test/WalletPortfolioTile.test.tsx(7 hunks)src/apps/the-exchange/components/CardsSwap/test/CardSwap.test.tsx(8 hunks)src/apps/the-exchange/components/DropdownTokensList/test/DropdownTokensList.test.tsx(5 hunks)src/apps/the-exchange/components/EnterAmount/test/EnterAmount.test.tsx(2 hunks)src/apps/the-exchange/components/SelectDropdown/test/SelectDropdown.test.tsx(4 hunks)src/apps/token-atlas/components/TokenCard/test/TokenCard.test.tsx(2 hunks)src/apps/token-atlas/components/TokenGraphColumn/test/TokenGraphColumn.test.tsx(2 hunks)src/apps/token-atlas/components/TokensSlider/test/TokenSlider.test.tsx(7 hunks)src/components/BottomMenu/BottomMenu.test.tsx(4 hunks)src/containers/Main.test.tsx(1 hunks)src/hooks/__tests__/useAccountTransactionHistory.test.tsx(3 hunks)src/pages/App/App.test.tsx(3 hunks)src/providers/__tests__/AccountNftsProvider.test.tsx(11 hunks)src/providers/__tests__/AccountTransactionHistoryProvider.test.tsx(9 hunks)src/providers/__tests__/AllowedAppsProvider.test.tsx(3 hunks)
✅ Files skipped from review due to trivial changes (5)
- src/apps/token-atlas/components/TokenGraphColumn/test/TokenGraphColumn.test.tsx
- src/apps/token-atlas/components/TokenCard/test/TokenCard.test.tsx
- src/apps/the-exchange/components/SelectDropdown/test/SelectDropdown.test.tsx
- src/pages/App/App.test.tsx
- src/apps/pillarx-app/components/WalletPortfolioTile/test/WalletPortfolioTile.test.tsx
🚧 Files skipped from review as they are similar to previous changes (14)
- src/apps/the-exchange/components/DropdownTokensList/test/DropdownTokensList.test.tsx
- src/apps/token-atlas/components/TokensSlider/test/TokenSlider.test.tsx
- src/providers/tests/AllowedAppsProvider.test.tsx
- src/apps/leaderboard/components/UserInfo/test/UserInfo.test.tsx
- src/apps/the-exchange/components/EnterAmount/test/EnterAmount.test.tsx
- src/containers/Main.test.tsx
- src/apps/leaderboard/components/Leaderboards/tests/Leaderboards.test.tsx
- src/providers/tests/AccountNftsProvider.test.tsx
- src/hooks/tests/useAccountTransactionHistory.test.tsx
- src/components/BottomMenu/BottomMenu.test.tsx
- src/providers/tests/AccountTransactionHistoryProvider.test.tsx
- src/apps/pillarx-app/components/WalletPortfolioGraph/tests/WalletPortfolioGraph.test.tsx
- src/apps/pillarx-app/components/WalletPortfolioBalance/test/WalletPortfolioBalance.test.tsx
- src/apps/the-exchange/components/CardsSwap/test/CardSwap.test.tsx
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: unit-tests
- GitHub Check: build
🔇 Additional comments (2)
package.json (2)
119-119: Verify plugin ↔ Vite major version compatibilityYou pin
vite@^7.0.0but@vitejs/plugin-react@^4.6.0targets Vite ≤ 4. Newer Vite majors typically require a matching major of the plugin (e.g. plugin-react v7 for Vite 7). The same applies tovite-plugin-svgr.Please double-check before CI surprises.
Also applies to: 142-144
13-14:sentry:sourcemapsstill assumes CRA output directory
vite buildoutputs todistby default, yet the script uploads from./build. Update the path or configurebuild.outDirinvite.config.*to keep Sentry uploads working.
RanaBug
left a comment
There was a problem hiding this comment.
LGTM if the unit tests failing check is resolved
Description
How Has This Been Tested?
Types of changes
Summary by CodeRabbit
New Features
VITE_prefix.Bug Fixes
Refactor
Documentation
Chores