From a3f07541d8e560c3dce38a621ae2670410054053 Mon Sep 17 00:00:00 2001 From: George Fu Date: Fri, 29 Sep 2023 01:22:18 -0400 Subject: [PATCH] fix(credential-provider-http): use alternate browser entry point (#5277) --- packages/credential-provider-http/package.json | 2 ++ packages/credential-provider-http/src/index.browser.ts | 2 ++ packages/credential-provider-http/src/index.ts | 3 +-- packages/credential-providers/src/index.browser.ts | 7 ++----- 4 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 packages/credential-provider-http/src/index.browser.ts diff --git a/packages/credential-provider-http/package.json b/packages/credential-provider-http/package.json index 814864da589a..ba4873673d42 100644 --- a/packages/credential-provider-http/package.json +++ b/packages/credential-provider-http/package.json @@ -4,6 +4,8 @@ "description": "AWS credential provider for containers and HTTP sources", "main": "./dist-cjs/index.js", "module": "./dist-es/index.js", + "browser": "./dist-es/index.browser.js", + "react-native": "./dist-es/index.browser.js", "scripts": { "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", "build:cjs": "tsc -p tsconfig.cjs.json", diff --git a/packages/credential-provider-http/src/index.browser.ts b/packages/credential-provider-http/src/index.browser.ts new file mode 100644 index 000000000000..7c0d33e9f3de --- /dev/null +++ b/packages/credential-provider-http/src/index.browser.ts @@ -0,0 +1,2 @@ +export { fromHttp } from "./fromHttp/fromHttp.browser"; +export type { FromHttpOptions, HttpProviderCredentials } from "./fromHttp/fromHttpTypes"; \ No newline at end of file diff --git a/packages/credential-provider-http/src/index.ts b/packages/credential-provider-http/src/index.ts index 02fa66353061..b1e99857d7b1 100644 --- a/packages/credential-provider-http/src/index.ts +++ b/packages/credential-provider-http/src/index.ts @@ -1,3 +1,2 @@ -export * from "./fromHttp/fromHttp"; -export { fromHttp as fromHttpForBrowser } from "./fromHttp/fromHttp.browser"; +export { fromHttp } from "./fromHttp/fromHttp"; export type { FromHttpOptions, HttpProviderCredentials } from "./fromHttp/fromHttpTypes"; diff --git a/packages/credential-providers/src/index.browser.ts b/packages/credential-providers/src/index.browser.ts index 642bdcb7a6a4..07d0adff00fb 100644 --- a/packages/credential-providers/src/index.browser.ts +++ b/packages/credential-providers/src/index.browser.ts @@ -1,9 +1,6 @@ export * from "./fromCognitoIdentity"; export * from "./fromCognitoIdentityPool"; -export { - fromHttpForBrowser as fromHttp, - FromHttpOptions, - HttpProviderCredentials, -} from "@aws-sdk/credential-provider-http"; +export { fromHttp } from "@aws-sdk/credential-provider-http"; +export type { FromHttpOptions, HttpProviderCredentials } from "@aws-sdk/credential-provider-http"; export * from "./fromTemporaryCredentials"; export * from "./fromWebToken";