Skip to content

Commit

Permalink
fix(deps): remove @aws-amplify/core devDep from react-core (#5853)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebpollman authored Oct 1, 2024
1 parent 8b4a28b commit 87d74a7
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 22 deletions.
10 changes: 10 additions & 0 deletions .changeset/grumpy-needles-push.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion packages/react-core-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
3 changes: 0 additions & 3 deletions packages/react-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 8 additions & 12 deletions packages/react-core/src/hooks/__tests__/useSetUserAgent.test.ts
Original file line number Diff line number Diff line change
@@ -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);
});
});
2 changes: 1 addition & 1 deletion packages/react-liveness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 87d74a7

Please sign in to comment.