From d5aa87a0a2d1812fdb40f14b6fa7e9008984ec3c Mon Sep 17 00:00:00 2001 From: Hui Zhao Date: Wed, 1 Nov 2023 16:30:17 -0700 Subject: [PATCH] fix package.json files pointing to mjs --- packages/adapter-nextjs/api/package.json | 4 ++-- packages/adapter-nextjs/internals/package.json | 4 ++-- packages/analytics/kinesis-firehose/package.json | 4 ++-- packages/analytics/kinesis/package.json | 4 ++-- packages/analytics/personalize/package.json | 4 ++-- packages/analytics/pinpoint/package.json | 4 ++-- packages/analytics/rollup.config.mjs | 8 +++++++- .../__tests__/providers/cognito/fetchAuthSession.test.ts | 2 +- packages/aws-amplify/rollup.config.mjs | 1 + packages/aws-amplify/utils/package.json | 4 ++-- packages/core/internals/adapter-core/package.json | 4 ++-- .../internals/aws-client-utils/composers/package.json | 4 ++-- packages/core/internals/aws-client-utils/package.json | 6 +++--- .../internals/aws-clients/cognitoIdentity/package.json | 4 ++-- packages/core/internals/aws-clients/pinpoint/package.json | 6 +++--- packages/core/internals/utils/package.json | 4 ++-- packages/storage/s3/package.json | 4 ++-- packages/storage/s3/server/package.json | 4 ++-- packages/storage/server/package.json | 8 ++++---- 19 files changed, 45 insertions(+), 38 deletions(-) diff --git a/packages/adapter-nextjs/api/package.json b/packages/adapter-nextjs/api/package.json index 513f32bb0d8..7a62c526736 100644 --- a/packages/adapter-nextjs/api/package.json +++ b/packages/adapter-nextjs/api/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/adapter-nextjs/api", "main": "../lib/api/index.js", - "browser": "../lib-esm/api/index.js", - "module": "../lib-esm/api/index.js", + "browser": "../lib-esm/api/index.mjs", + "module": "../lib-esm/api/index.mjs", "typings": "../lib-esm/api/index.d.ts" } diff --git a/packages/adapter-nextjs/internals/package.json b/packages/adapter-nextjs/internals/package.json index 989341b8e6a..87413c496d6 100644 --- a/packages/adapter-nextjs/internals/package.json +++ b/packages/adapter-nextjs/internals/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/adapter-nextjs/internals", "main": "../lib/internals/index.js", - "browser": "../lib-esm/internals/index.js", - "module": "../lib-esm/internals/index.js", + "browser": "../lib-esm/internals/index.mjs", + "module": "../lib-esm/internals/index.mjs", "typings": "../lib-esm/internals/index.d.ts" } diff --git a/packages/analytics/kinesis-firehose/package.json b/packages/analytics/kinesis-firehose/package.json index 5a24371bb4b..c5d82080d11 100644 --- a/packages/analytics/kinesis-firehose/package.json +++ b/packages/analytics/kinesis-firehose/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/analytics/kinesis-firehose", "main": "../lib/providers/kinesis-firehose/index.js", - "browser": "../lib-esm/providers/kinesis-firehose/index.js", - "module": "../lib-esm/providers/kinesis-firehose/index.js", + "browser": "../lib-esm/providers/kinesis-firehose/index.mjs", + "module": "../lib-esm/providers/kinesis-firehose/index.mjs", "typings": "../lib-esm/providers/kinesis-firehose/index.d.ts" } diff --git a/packages/analytics/kinesis/package.json b/packages/analytics/kinesis/package.json index 682df5115a2..5ad2953a9e9 100644 --- a/packages/analytics/kinesis/package.json +++ b/packages/analytics/kinesis/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/analytics/kinesis", "main": "../lib/providers/kinesis/index.js", - "browser": "../lib-esm/providers/kinesis/index.js", - "module": "../lib-esm/providers/kinesis/index.js", + "browser": "../lib-esm/providers/kinesis/index.mjs", + "module": "../lib-esm/providers/kinesis/index.mjs", "typings": "../lib-esm/providers/kinesis/index.d.ts" } diff --git a/packages/analytics/personalize/package.json b/packages/analytics/personalize/package.json index 397b7934fb2..8539ce93e83 100644 --- a/packages/analytics/personalize/package.json +++ b/packages/analytics/personalize/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/analytics/personalize", "main": "../lib/providers/personalize/index.js", - "browser": "../lib-esm/providers/personalize/index.js", - "module": "../lib-esm/providers/personalize/index.js", + "browser": "../lib-esm/providers/personalize/index.mjs", + "module": "../lib-esm/providers/personalize/index.mjs", "typings": "../lib-esm/providers/personalize/index.d.ts" } diff --git a/packages/analytics/pinpoint/package.json b/packages/analytics/pinpoint/package.json index 355c1fdea07..6b8a839e7a0 100644 --- a/packages/analytics/pinpoint/package.json +++ b/packages/analytics/pinpoint/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/analytics/pinpoint", "main": "../lib/providers/pinpoint/index.js", - "browser": "../lib-esm/providers/pinpoint/index.js", - "module": "../lib-esm/providers/pinpoint/index.js", + "browser": "../lib-esm/providers/pinpoint/index.mjs", + "module": "../lib-esm/providers/pinpoint/index.mjs", "typings": "../lib-esm/providers/pinpoint/index.d.ts" } diff --git a/packages/analytics/rollup.config.mjs b/packages/analytics/rollup.config.mjs index 2e08979a8fc..dfc93757aa7 100644 --- a/packages/analytics/rollup.config.mjs +++ b/packages/analytics/rollup.config.mjs @@ -22,7 +22,13 @@ const config = defineConfig([ // }, // ESM config { - input: ['src/index.ts'], + input: [ + 'src/index.ts', + 'src/providers/kinesis/index.ts', + 'src/providers/kinesis-firehose/index.ts', + 'src/providers/personalize/index.ts', + 'src/providers/pinpoint/index.ts', + ], output: { dir: esmOutputDir, format: 'es', diff --git a/packages/auth/__tests__/providers/cognito/fetchAuthSession.test.ts b/packages/auth/__tests__/providers/cognito/fetchAuthSession.test.ts index dbb898e369a..660f075da57 100644 --- a/packages/auth/__tests__/providers/cognito/fetchAuthSession.test.ts +++ b/packages/auth/__tests__/providers/cognito/fetchAuthSession.test.ts @@ -5,7 +5,7 @@ import { CognitoUserPoolsTokenProvider, cognitoCredentialsProvider, } from '../../../src/providers/cognito'; -import { decodeJWT } from '@aws-amplify/core/lib-esm/libraryUtils'; +import { decodeJWT } from '@aws-amplify/core/internals/utils'; describe('fetchAuthSession behavior for IdentityPools only', () => { let credentialsProviderSpy; diff --git a/packages/aws-amplify/rollup.config.mjs b/packages/aws-amplify/rollup.config.mjs index 69d07a2b920..9e66726effc 100644 --- a/packages/aws-amplify/rollup.config.mjs +++ b/packages/aws-amplify/rollup.config.mjs @@ -23,6 +23,7 @@ const config = defineConfig([ // ESM config { input: [ + 'src/utils/index.ts', 'src/index.ts', 'src/adapterCore/index.ts', 'src/analytics/index.ts', diff --git a/packages/aws-amplify/utils/package.json b/packages/aws-amplify/utils/package.json index 05f75bf43e0..07fd3813fca 100644 --- a/packages/aws-amplify/utils/package.json +++ b/packages/aws-amplify/utils/package.json @@ -1,7 +1,7 @@ { "name": "aws-amplify/utils", "main": "../lib/utils/index.js", - "browser": "../lib-esm/utils/index.js", - "module": "../lib-esm/utils/index.js", + "browser": "../lib-esm/utils/index.mjs", + "module": "../lib-esm/utils/index.mjs", "typings": "../lib-esm/utils/index.d.ts" } diff --git a/packages/core/internals/adapter-core/package.json b/packages/core/internals/adapter-core/package.json index c9c39d09a1d..2c86ff3d652 100644 --- a/packages/core/internals/adapter-core/package.json +++ b/packages/core/internals/adapter-core/package.json @@ -2,7 +2,7 @@ "name": "@aws-amplify/core/internals/adapter-core", "types": "../../lib-esm/adapterCore/index.d.ts", "main": "../../lib/adapterCore/index.js", - "module": "../../lib-esm/adapterCore/index.js", - "react-native": "../../lib-esm/adapterCore/index.js", + "module": "../../lib-esm/adapterCore/index.mjs", + "react-native": "../../lib-esm/adapterCore/index.mjs", "sideEffects": false } diff --git a/packages/core/internals/aws-client-utils/composers/package.json b/packages/core/internals/aws-client-utils/composers/package.json index d48d6d2a5ac..66e477c46f5 100644 --- a/packages/core/internals/aws-client-utils/composers/package.json +++ b/packages/core/internals/aws-client-utils/composers/package.json @@ -2,7 +2,7 @@ "name": "@aws-amplify/core/internals/aws-client-utils/composers", "types": "../../../lib-esm/clients/internal/index.d.ts", "main": "../../../lib/clients/internal/index.js", - "module": "../../../lib-esm/clients/internal/index.js", - "react-native": "../../../lib-esm/clients/internal/index.js", + "module": "../../../lib-esm/clients/internal/index.mjs", + "react-native": "../../../lib-esm/clients/internal/index.mjs", "sideEffects": false } diff --git a/packages/core/internals/aws-client-utils/package.json b/packages/core/internals/aws-client-utils/package.json index a174f93783e..2284eb9868a 100644 --- a/packages/core/internals/aws-client-utils/package.json +++ b/packages/core/internals/aws-client-utils/package.json @@ -2,7 +2,7 @@ "name": "@aws-amplify/core/internals/aws-client-utils", "types": "../../lib-esm/clients/index.d.ts", "main": "../../lib/clients/index.js", - "module": "../../lib-esm/clients/index.js", - "react-native": "../../lib-esm/clients/index.js", + "module": "../../lib-esm/clients/index.mjs", + "react-native": "../../lib-esm/clients/index.mjs", "sideEffects": false -} \ No newline at end of file +} diff --git a/packages/core/internals/aws-clients/cognitoIdentity/package.json b/packages/core/internals/aws-clients/cognitoIdentity/package.json index 221c2b67bb2..44376fcbfb2 100644 --- a/packages/core/internals/aws-clients/cognitoIdentity/package.json +++ b/packages/core/internals/aws-clients/cognitoIdentity/package.json @@ -2,7 +2,7 @@ "name": "@aws-amplify/core/internals/aws-clients/cognitoIdentity", "types": "../../../lib-esm/awsClients/cognitoIdentity/index.d.ts", "main": "../../../lib/awsClients/cognitoIdentity/index.js", - "module": "../../../lib-esm/awsClients/cognitoIdentity/index.js", - "react-native": "../../../lib-esm/awsClients/cognitoIdentity/index.js", + "module": "../../../lib-esm/awsClients/cognitoIdentity/index.mjs", + "react-native": "../../../lib-esm/awsClients/cognitoIdentity/index.mjs", "sideEffects": false } diff --git a/packages/core/internals/aws-clients/pinpoint/package.json b/packages/core/internals/aws-clients/pinpoint/package.json index 321819a9c6d..0a7ec928b04 100644 --- a/packages/core/internals/aws-clients/pinpoint/package.json +++ b/packages/core/internals/aws-clients/pinpoint/package.json @@ -2,7 +2,7 @@ "name": "@aws-amplify/core/internals/aws-clients/pinpoint", "types": "../../../lib-esm/awsClients/pinpoint/index.d.ts", "main": "../../../lib/awsClients/pinpoint/index.js", - "module": "../../../lib-esm/awsClients/pinpoint/index.js", - "react-native": "../../../lib-esm/awsClients/pinpoint/index.js", + "module": "../../../lib-esm/awsClients/pinpoint/index.mjs", + "react-native": "../../../lib-esm/awsClients/pinpoint/index.mjs", "sideEffects": false -} \ No newline at end of file +} diff --git a/packages/core/internals/utils/package.json b/packages/core/internals/utils/package.json index 97a667e2288..ef9beb1097f 100644 --- a/packages/core/internals/utils/package.json +++ b/packages/core/internals/utils/package.json @@ -2,6 +2,6 @@ "name": "@aws-amplify/core/internals/utils", "types": "../../lib-esm/libraryUtils.d.ts", "main": "../../lib/libraryUtils.js", - "module": "../../lib-esm/libraryUtils.js", - "react-native": "../../lib-esm/libraryUtils.js" + "module": "../../lib-esm/libraryUtils.mjs", + "react-native": "../../lib-esm/libraryUtils.mjs" } diff --git a/packages/storage/s3/package.json b/packages/storage/s3/package.json index d45ec7e8290..7c6dcb4f1b9 100644 --- a/packages/storage/s3/package.json +++ b/packages/storage/s3/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/storage/s3", "main": "../lib/providers/s3/index.js", - "browser": "../lib-esm/providers/s3/index.js", - "module": "../lib-esm/providers/s3/index.js", + "browser": "../lib-esm/providers/s3/index.mjs", + "module": "../lib-esm/providers/s3/index.mjs", "typings": "../lib-esm/providers/s3/index.d.ts" } diff --git a/packages/storage/s3/server/package.json b/packages/storage/s3/server/package.json index f00e619da0b..dd1d62fca53 100644 --- a/packages/storage/s3/server/package.json +++ b/packages/storage/s3/server/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/storage/s3/server", "main": "../../lib/providers/s3/server.js", - "browser": "../../lib-esm/providers/s3/server.js", - "module": "../../lib-esm/providers/s3/server.js", + "browser": "../../lib-esm/providers/s3/server.mjs", + "module": "../../lib-esm/providers/s3/server.mjs", "typings": "../../lib-esm/providers/s3/server.d.ts" } diff --git a/packages/storage/server/package.json b/packages/storage/server/package.json index 53044d20ac6..e915cdaa613 100644 --- a/packages/storage/server/package.json +++ b/packages/storage/server/package.json @@ -1,8 +1,8 @@ { "name": "@aws-amplify/storage/server", "types": "../lib-esm/server.d.ts", - "main": "../lib/server.js", - "module": "../lib-esm/server.js", - "react-native": "../lib-esm/server.js", + "main": "../lib/server.mjs", + "module": "../lib-esm/server.mjs", + "react-native": "../lib-esm/server.mjs", "sideEffects": false -} \ No newline at end of file +}