diff --git a/.changeset/grumpy-needles-push.md b/.changeset/grumpy-needles-push.md new file mode 100644 index 00000000000..cd6e519bad9 --- /dev/null +++ b/.changeset/grumpy-needles-push.md @@ -0,0 +1,10 @@ +--- +"@aws-amplify/ui-react-core": patch +"@aws-amplify/ui-react-liveness": patch +"@aws-amplify/ui-react-storage": patch +"@aws-amplify/ui-react": patch +"@aws-amplify/ui": patch +"@aws-amplify/ui-vue": patch +--- + +fix(deps): remove @aws-amplify/core devDep from react-core diff --git a/packages/react-core-auth/package.json b/packages/react-core-auth/package.json index c449320094d..2ede08b4f95 100644 --- a/packages/react-core-auth/package.json +++ b/packages/react-core-auth/package.json @@ -41,7 +41,7 @@ "xstate": "^4.33.6" }, "peerDependencies": { - "@aws-amplify/core": "^6.4.0", + "@aws-amplify/core": "*", "aws-amplify": "^6.6.0", "react": "^16.14.0 || ^17.0 || ^18.0" }, diff --git a/packages/react-core/package.json b/packages/react-core/package.json index 3f9fa4a8cb5..da2c67409e3 100644 --- a/packages/react-core/package.json +++ b/packages/react-core/package.json @@ -46,9 +46,6 @@ "react-hook-form": "^7.43.5", "xstate": "^4.33.6" }, - "devDependencies": { - "@aws-amplify/core": "^6.4.0" - }, "peerDependencies": { "aws-amplify": "^6.6.0", "react": "^16.14.0 || ^17.0 || ^18.0" diff --git a/packages/react-core/src/hooks/__tests__/useSetUserAgent.test.ts b/packages/react-core/src/hooks/__tests__/useSetUserAgent.test.ts index 442eb80a83c..84aa7e00216 100644 --- a/packages/react-core/src/hooks/__tests__/useSetUserAgent.test.ts +++ b/packages/react-core/src/hooks/__tests__/useSetUserAgent.test.ts @@ -1,26 +1,22 @@ -import * as UserAgentModule from '@aws-amplify/core/internals/utils'; -import { SetUserAgentOptions } from '@aws-amplify/ui/src/utils/setUserAgent/setUserAgent'; import { renderHook } from '@testing-library/react-hooks'; +import * as UserAgentModule from '@aws-amplify/ui'; + import useSetUserAgent from '../useSetUserAgent'; describe('useSetUserAgent', () => { - const setCustomUserAgentSpy = jest.spyOn( - UserAgentModule, - 'setCustomUserAgent' - ); - - beforeEach(() => { - setCustomUserAgentSpy.mockReset(); - }); - it('should call setUserAgent when component mounts', () => { - const details: SetUserAgentOptions = { + const setCustomUserAgentSpy = jest.spyOn(UserAgentModule, 'setUserAgent'); + + const details: UserAgentModule.SetUserAgentOptions = { componentName: 'Authenticator', packageName: 'vue', version: '1.0.0', }; + renderHook(() => useSetUserAgent(details)); + expect(setCustomUserAgentSpy).toHaveBeenCalledTimes(1); + expect(setCustomUserAgentSpy).toHaveBeenCalledWith(details); }); }); diff --git a/packages/react-liveness/package.json b/packages/react-liveness/package.json index 7b40d2462a9..8496c4ce0c6 100644 --- a/packages/react-liveness/package.json +++ b/packages/react-liveness/package.json @@ -42,7 +42,7 @@ "typecheck": "tsc --noEmit" }, "peerDependencies": { - "@aws-amplify/core": "^6.4.0", + "@aws-amplify/core": "*", "aws-amplify": "^6.6.0", "react": "^16.14.0 || ^17.0 || ^18.0", "react-dom": "^16.14.0 || ^17.0 || ^18.0" diff --git a/packages/react-storage/package.json b/packages/react-storage/package.json index abdc5ec2e24..f169c133deb 100644 --- a/packages/react-storage/package.json +++ b/packages/react-storage/package.json @@ -46,7 +46,7 @@ "tslib": "^2.5.2" }, "peerDependencies": { - "@aws-amplify/core": "^6.4.0", + "@aws-amplify/core": "*", "aws-amplify": "^6.6.0", "react": "^16.14.0 || ^17.0 || ^18.0", "react-dom": "^16.14.0 || ^17.0 || ^18.0" diff --git a/packages/react/package.json b/packages/react/package.json index 9a32cff7aaf..f3adad12c3e 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -66,7 +66,7 @@ "tslib": "^2.5.2" }, "peerDependencies": { - "@aws-amplify/core": "^6.4.0", + "@aws-amplify/core": "*", "aws-amplify": "^6.6.0", "react": "^16.14.0 || ^17.0 || ^18.0", "react-dom": "^16.14.0 || ^17.0 || ^18.0" diff --git a/packages/ui/package.json b/packages/ui/package.json index 98c3d4a05e3..55ecee53ae7 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -49,7 +49,7 @@ "tslib": "^2.5.2" }, "peerDependencies": { - "@aws-amplify/core": "^6.4.0", + "@aws-amplify/core": "*", "aws-amplify": "^6.6.0", "xstate": "^4.33.6" }, diff --git a/packages/vue/package.json b/packages/vue/package.json index 17b04178bf1..e8f8dc74d73 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -65,7 +65,7 @@ "vite-jest": "^0.1.4" }, "peerDependencies": { - "@aws-amplify/core": "^6.4.0", + "@aws-amplify/core": "*", "aws-amplify": "^6.6.0", "vue": "^3.0" } diff --git a/yarn.lock b/yarn.lock index 186ef3784e7..b0db81a1864 100644 --- a/yarn.lock +++ b/yarn.lock @@ -665,7 +665,7 @@ "@aws-amplify/platform-core" "^1.0.7" zod "^3.22.2" -"@aws-amplify/core@6.4.2", "@aws-amplify/core@^6.4.0": +"@aws-amplify/core@6.4.2": version "6.4.2" resolved "https://registry.yarnpkg.com/@aws-amplify/core/-/core-6.4.2.tgz#db258b8118ec3eff25bdfb757492008f7dbf8af2" integrity sha512-kumvcxy8dk+L78MBjzfCrd+iVefliTvrbYskNFFbxbKCxUB7QavgALrVi31VXQxBW5YvImjAsS1qS7SY1YkYHQ==