From ede387ea1005b6d641f87193ae37cfe9cc5fcadb Mon Sep 17 00:00:00 2001 From: Noisekit Date: Fri, 5 Jul 2024 14:48:06 +1000 Subject: [PATCH] Emit declarations --- .gitignore | 46 ++-------------------------------------------- index.js | 21 --------------------- index.ts | 1 - package.json | 15 ++++++++++----- tsconfig.json | 1 + 5 files changed, 13 insertions(+), 71 deletions(-) delete mode 100644 index.js diff --git a/.gitignore b/.gitignore index 498a11e..327734e 100644 --- a/.gitignore +++ b/.gitignore @@ -57,12 +57,6 @@ web_modules/ # Optional stylelint cache .stylelintcache -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - # Optional REPL history .node_repl_history @@ -79,46 +73,10 @@ web_modules/ .env.production.local .env.local -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - # Next.js build output .next out -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# vuepress v2.x temp and cache directory -.temp -.cache - -# Docusaurus cache and generated files -.docusaurus - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - # Stores VSCode versions used for testing VSCode extensions .vscode-test @@ -130,5 +88,5 @@ dist .pnp.* -*.js -!index.js +/*.js +/*.d.ts diff --git a/index.js b/index.js deleted file mode 100644 index e3babc4..0000000 --- a/index.js +++ /dev/null @@ -1,21 +0,0 @@ -export * from './decodeBuiltinErrors'; -export * from './decodePythErrors'; -export * from './fetchPriceUpdateTxn'; -export * from './importAccountProxy'; -export * from './importAllErrors'; -export * from './importCollateralTokens'; -export * from './importCoreProxy'; -export * from './importExtras'; -export * from './importMintableTokens'; -export * from './importMulticall'; -export * from './importPythERC7412Wrapper'; -export * from './importRewardsDistributors'; -export * from './importSpotMarketProxy'; -export * from './importSynthTokens'; -export * from './importSystemToken'; -export * from './index'; -export * from './parseError'; -export * from './useErrorParser'; -export * from './useImports'; -export * from './usePriceUpdateTxn'; -export * from './useSynthetix'; diff --git a/index.ts b/index.ts index e3babc4..16fbb4c 100644 --- a/index.ts +++ b/index.ts @@ -13,7 +13,6 @@ export * from './importRewardsDistributors'; export * from './importSpotMarketProxy'; export * from './importSynthTokens'; export * from './importSystemToken'; -export * from './index'; export * from './parseError'; export * from './useErrorParser'; export * from './useImports'; diff --git a/package.json b/package.json index 207e909..e46fb9c 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,18 @@ "publishConfig": { "access": "public" }, - "type": "module", - "main": "index.js", - "types": "index.ts", + "main": "./index.js", + "types": "./index.d.ts", + "exports": { + ".": { + "module": "./index.js", + "types": "./index.d.ts" + } + }, "repository": "synthetixio/react-sdk", "files": [ - "*.js", - "*.ts" + "./*.ts", + "./*.js" ], "scripts": { "start": "tsc --watch", diff --git a/tsconfig.json b/tsconfig.json index 0f55470..5d2b910 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "declaration": true, "module": "ESNext", "skipLibCheck": true, "moduleResolution": "Bundler",