diff --git a/bin/cli b/bin/cli index d3bdaae58..443941c48 100755 --- a/bin/cli +++ b/bin/cli @@ -1,16 +1,12 @@ #!/usr/bin/env node -const fs = require("fs"); const path = require("path"); -const project = path.join(__dirname, "../tsconfig.json"); -const dev = fs.existsSync(project); +const project = path.join(__dirname, "../tsconfig.oclif.json"); -if (dev) { - require("ts-node").register({ - project, - compilerOptions: { preserveSymlinks: true }, - }); -} +require("ts-node").register({ + project, + compilerOptions: { preserveSymlinks: true }, +}); require('@oclif/command').run() .catch(require('@oclif/errors/handle')) diff --git a/package.json b/package.json index 0a74674af..4dc0b4f7b 100644 --- a/package.json +++ b/package.json @@ -93,8 +93,8 @@ "typescript": "^4.2.2" }, "files": [ - "build/main", - "build/module", + "build/main/src", + "build/module/src", "!**/*.spec.*", "!**/*.json", "CHANGELOG.md", diff --git a/src/providers/swap-router-provider.ts b/src/providers/swap-router-provider.ts index cd371cd32..f9a545561 100644 --- a/src/providers/swap-router-provider.ts +++ b/src/providers/swap-router-provider.ts @@ -1,6 +1,6 @@ import { ApprovalTypes } from '@uniswap/router-sdk'; import { Currency, CurrencyAmount } from '@uniswap/sdk-core'; -import { SwapRouter02__factory } from '../types/other'; +import { SwapRouter02__factory } from '../types/other/factories/SwapRouter02__factory'; import { log } from '../util'; import { IMulticallProvider } from './multicall-provider'; diff --git a/src/providers/token-provider.ts b/src/providers/token-provider.ts index 6b0324295..7cca57101 100644 --- a/src/providers/token-provider.ts +++ b/src/providers/token-provider.ts @@ -1,6 +1,6 @@ import { Token } from '@uniswap/sdk-core'; import _ from 'lodash'; -import { IERC20Metadata__factory } from '../types/v3'; +import { IERC20Metadata__factory } from '../types/v3/factories/IERC20Metadata__factory'; import { ChainId, log } from '../util'; import { IMulticallProvider } from './multicall-provider'; import { ProviderConfig } from './provider'; diff --git a/src/providers/v2/pool-provider.ts b/src/providers/v2/pool-provider.ts index 746eb2421..8f9aa1483 100644 --- a/src/providers/v2/pool-provider.ts +++ b/src/providers/v2/pool-provider.ts @@ -3,7 +3,7 @@ import { Token } from '@uniswap/sdk-core'; import { Pair } from '@uniswap/v2-sdk'; import retry, { Options as RetryOptions } from 'async-retry'; import _ from 'lodash'; -import { IUniswapV2Pair__factory } from '../../types/v2'; +import { IUniswapV2Pair__factory } from '../../types/v2/factories/IUniswapV2Pair__factory'; import { ChainId, CurrencyAmount } from '../../util'; import { log } from '../../util/log'; import { poolToString } from '../../util/routes'; diff --git a/src/providers/v3/pool-provider.ts b/src/providers/v3/pool-provider.ts index 8fd55370b..dae74f329 100644 --- a/src/providers/v3/pool-provider.ts +++ b/src/providers/v3/pool-provider.ts @@ -3,7 +3,7 @@ import { Token } from '@uniswap/sdk-core'; import { computePoolAddress, FeeAmount, Pool } from '@uniswap/v3-sdk'; import retry, { Options as RetryOptions } from 'async-retry'; import _ from 'lodash'; -import { IUniswapV3PoolState__factory } from '../../types/v3'; +import { IUniswapV3PoolState__factory } from '../../types/v3/factories/IUniswapV3PoolState__factory'; import { ChainId } from '../../util'; import { V3_CORE_FACTORY_ADDRESS } from '../../util/addresses'; import { log } from '../../util/log'; diff --git a/tsconfig.json b/tsconfig.json index ce88956d7..fc21c5147 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -38,10 +38,8 @@ // "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */, "lib": ["es2017", "dom"], - "types": ["node", "jest"], - "typeRoots": ["node_modules/@types", "src/types"] + "types": ["node", "jest"] }, - "include": ["src/**/*.ts", "cli/**/*.ts"], - "exclude": ["node_modules/**"], + "include": ["src/index.ts"], "compileOnSave": false } diff --git a/tsconfig.module.json b/tsconfig.module.json index 0022e189f..1f887f6ec 100644 --- a/tsconfig.module.json +++ b/tsconfig.module.json @@ -4,6 +4,5 @@ "target": "es2018", "outDir": "build/module", "module": "esnext" - }, - "exclude": ["node_modules/**"] + } } diff --git a/tsconfig.oclif.json b/tsconfig.oclif.json new file mode 100644 index 000000000..d17232351 --- /dev/null +++ b/tsconfig.oclif.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig", + "include": ["cli/**/*.ts"] +}