diff --git a/packages/status-js/package.json b/packages/status-js/package.json index 1f5ec0eb..2bfcfecf 100644 --- a/packages/status-js/package.json +++ b/packages/status-js/package.json @@ -3,13 +3,9 @@ "version": "0.1.1", "license": "MIT OR Apache-2.0", "type": "module", - "exports": { - "types": "./dist/types/index.d.ts", - "import": "./dist/index.es.js", - "default": "./dist/index.es.js" - }, - "module": "dist/index.es.js", - "types": "dist/types/index.d.ts", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "types": "./dist/types/index.d.ts", "repository": { "url": "https://github.com/status-im/status-web.git", "directory": "packages/status-js", @@ -54,5 +50,8 @@ ], "publishConfig": { "access": "public" + }, + "browser": { + "./src/utils/encode-url-data": false } } diff --git a/packages/status-js/src/index.ts b/packages/status-js/src/index.ts index 591e9412..0a0ce10e 100644 --- a/packages/status-js/src/index.ts +++ b/packages/status-js/src/index.ts @@ -11,6 +11,7 @@ export { createClient } from './client/client' export type { Community } from './client/community/community' export type { Reaction, Reactions } from './client/community/get-reactions' export type { Member } from './client/member' +export { peers } from './consts/peers' export { EthereumClient } from './ethereum-client/ethereum-client' export type { ChannelInfo } from './request-client/map-channel' export type { CommunityInfo } from './request-client/map-community' @@ -18,10 +19,6 @@ export type { UserInfo } from './request-client/map-user' export { RequestClient } from './request-client/request-client' export { createRequestClient } from './request-client/request-client' export { deserializePublicKey } from './utils/deserialize-public-key' -export { - decodeChannelURLData, - decodeCommunityURLData, - decodeUserURLData, -} from './utils/encode-url-data' +export * from './utils/encode-url-data' export { publicKeyToEmojiHash } from './utils/public-key-to-emoji-hash' export { verifyEncodedURLData } from './utils/sign-url-data' diff --git a/packages/status-js/vite.config.ts b/packages/status-js/vite.config.ts index 3734ccd5..56babaa4 100644 --- a/packages/status-js/vite.config.ts +++ b/packages/status-js/vite.config.ts @@ -1,5 +1,3 @@ -/// - import { defineConfig } from 'vite' import { dependencies } from './package.json' @@ -30,7 +28,7 @@ export default defineConfig(({ mode }) => { lib: { entry: './src/index.ts', fileName: 'index', - formats: ['es'], + formats: ['es', 'cjs'], }, sourcemap: true, emptyOutDir: mode === 'production',