shapeshift / lib

MIT License
22 stars 54 forks source link

Export everything correctly from lib #462

Closed 0xdef1cafe closed 2 years ago

0xdef1cafe commented 2 years ago

Overview

Currently, the web repo is consuming imports from this lib repo, but importing directly from the dist directory of bunch of packages. This isn't correct and needs fixing.

Reference

Anything coming from a @shapeshiftoss/* package should be exported correctly in lib, and not imported via the /dist/ folder in web

➜  web git:(develop) rg /dist/
src/pages/TransactionHistory/TransactionHistoryFilter.tsx
16:import { TradeType, TxType } from '@shapeshiftoss/types/dist/chain-adapters'

src/pages/TransactionHistory/DownloadButton.tsx
2:import { TxType } from '@shapeshiftoss/types/dist/chain-adapters'

src/pages/TransactionHistory/components/DatePicker/DatePicker.tsx
1:import 'react-datepicker/dist/react-datepicker.css'

src/components/Modals/Send/views/Address.tsx
13:import { ChainAdapter as EthereumChainAdapter } from '@shapeshiftoss/chain-adapters/dist/ethereum/EthereumChainAdapter'

src/components/TransactionHistoryRows/TransactionRow.tsx
3:import { TradeType, TxType } from '@shapeshiftoss/types/dist/chain-adapters'

src/components/TransactionHistoryRows/TransactionGenericRow.tsx
3:import { TradeType, TxType } from '@shapeshiftoss/types/dist/chain-adapters'

src/components/Transactions/TransactionRow.tsx
3:import { TradeType, TxType } from '@shapeshiftoss/types/dist/chain-adapters'

src/features/defi/helpers/normalizeOpportunity.tsx
2:import { AssetNamespace } from '@shapeshiftoss/caip/dist/caip19/caip19'

src/test/mocks/txs.ts
2:import { TradeType } from '@shapeshiftoss/types/dist/chain-adapters'

src/plugins/cosmos/index.tsx
1:import { ChainAdapter as CosmosChainAdapter } from '@shapeshiftoss/chain-adapters/dist/cosmossdk/cosmos'
2:import { ChainAdapter as OsmosisChainAdapter } from '@shapeshiftoss/chain-adapters/dist/cosmossdk/osmosis'

src/hooks/useBalanceChartData/useBalanceChartData.ts
3:import { TxType } from '@shapeshiftoss/types/dist/chain-adapters'

src/state/slices/txHistorySlice/txHistorySlice.ts
2:import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/dist/query'

src/state/slices/assetsSlice/assetsSlice.ts
2:import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/dist/query/react'

src/state/slices/marketDataSlice/marketDataSlice.tsx
2:import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/dist/query/react'

src/hooks/useTxDetails/useTxDetails.ts
2:import { TradeType, TxTransfer, TxType } from '@shapeshiftoss/types/dist/chain-adapters'

cypress/factories/ethereum/transactions.ts
1:import { TxHistory } from '@shapeshiftoss/unchained-client/dist/generated/ethereum'

cypress/factories/ethereum/account.ts
1:import { EthereumAccount } from '@shapeshiftoss/unchained-client/dist/generated/ethereum'

cypress/factories/bitcoin/account-xpub.ts
1:import { BitcoinAccount } from '@shapeshiftoss/unchained-client/dist/generated/bitcoin'

cypress/factories/bitcoin/account.ts
1:import { BitcoinAccount } from '@shapeshiftoss/unchained-client/dist/generated/bitcoin'

cypress/factories/bitcoin/transactions.ts
1:import { TxHistory } from '@shapeshiftoss/unchained-client/dist/generated/bitcoin'

cypress/fixtures/wallet.ts
1:import { FlattenedJWE } from 'jose/dist/types/types'

Acceptance Criteria

This bounty will require two PRs

Need By Date

No response

Ownership

Bounty Hunters

gitcoinbot commented 2 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 1200.0 FOX (328.03 USD @ $0.27/FOX) attached to it as part of the ShapeShift fund.

gitcoinbot commented 2 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 264 years, 8 months from now. Please review their action plans below:

1) pbteja1998 has been approved to start work.

This bounty looks straightforward to do. I will be able to complete this in a day. I will update all the exports/imports as per the requirement. 2) lolboysg has applied to start work _(Funders only: approve worker | reject worker)_.

I would like to work on this bounty and update every import / exports from shapeshift/lib and shapeshift/web. It should be done by tomorrow 3) naftalimurgor has applied to start work _(Funders only: approve worker | reject worker)_.

Hello,

I'd like to express interest in refactoring the imports with major focus on:

This is also a great way to have a look at the web code as a new contributor I'm readily available to begin work

Best, Naftali 4) nejos97 has applied to start work _(Funders only: approve worker | reject worker)_.

I would like to do this refactoring task and complete it in one day. 5) afenton90 has applied to start work _(Funders only: approve worker | reject worker)_.

I’ve done this kind of refactoring before and could do this in around a day.

JavaScript and TypeScript are my daily drivers for code.

Learn more on the Gitcoin Issue Details page.

gitcoinbot commented 2 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 1200.0 FOX (332.94 USD @ $0.28/FOX) has been submitted by:

  1. @pbteja1998

@0xean please take a look at the submitted work:


shapeshift-ci-bot commented 2 years ago

:tada: This issue has been resolved in version @shapeshiftoss/chain-adapters-v2.7.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

gitcoinbot commented 2 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 1200.0 FOX (342.41 USD @ $0.29/FOX) attached to this issue has been approved & issued to @pbteja1998.