Skip to content

Commit 069893e

Browse files
committed
chore: refactor exports
1 parent 8065ea4 commit 069893e

16 files changed

+33
-39
lines changed

packages/auth/__tests__/client/utils/passkey/errors/handlePasskeyAuthenticationError.native.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getIsNativeError } from '@aws-amplify/react-native/internals/utils';
1+
import { getIsNativeError } from '@aws-amplify/react-native';
22

33
import {
44
PasskeyError,
@@ -12,7 +12,7 @@ import { MockNativeError } from '../../../../mockData';
1212
const mockHandlePasskeyError = jest.mocked(handlePasskeyError);
1313
jest.mock('../../../../../src/client/utils/passkey/errors/handlePasskeyError');
1414

15-
jest.mock('@aws-amplify/react-native/internals/utils', () => ({
15+
jest.mock('@aws-amplify/react-native', () => ({
1616
getIsNativeError: jest.fn(() => true),
1717
}));
1818

packages/auth/__tests__/client/utils/passkey/errors/handlePasskeyError.native.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { handlePasskeyError } from '../../../../../src/client/utils/passkey/erro
88
import { passkeyErrorMap } from '../../../../../src/client/utils/passkey/errors/passkeyError';
99
import { MockNativeError } from '../../../../mockData';
1010

11-
jest.mock('@aws-amplify/react-native/internals/utils', () => ({
11+
jest.mock('@aws-amplify/react-native', () => ({
1212
getIsNativeError: jest.fn(() => true),
1313
}));
1414

packages/auth/__tests__/client/utils/passkey/errors/handlePasskeyRegistrationError.native.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getIsNativeError } from '@aws-amplify/react-native/internals/utils';
1+
import { getIsNativeError } from '@aws-amplify/react-native';
22

33
import {
44
PasskeyError,
@@ -12,7 +12,7 @@ import { MockNativeError } from '../../../../mockData';
1212
const mockHandlePasskeyError = jest.mocked(handlePasskeyError);
1313
jest.mock('../../../../../src/client/utils/passkey/errors/handlePasskeyError');
1414

15-
jest.mock('@aws-amplify/react-native/internals/utils', () => ({
15+
jest.mock('@aws-amplify/react-native', () => ({
1616
getIsNativeError: jest.fn(() => true),
1717
}));
1818

@@ -46,6 +46,7 @@ describe('handlePasskeyRegistrationError', () => {
4646
);
4747
expect(mockGetIsNativeError).toHaveBeenCalledWith(err);
4848
});
49+
4950
it('returns new instance of PasskeyError with correct attributes when input error code is DUPLICATE', () => {
5051
const err = new MockNativeError();
5152
err.code = 'DUPLICATE';

packages/auth/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,13 @@
9696
"tslib": "^2.5.0"
9797
},
9898
"peerDependencies": {
99-
"@aws-amplify/core": "^6.1.0"
99+
"@aws-amplify/core": "^6.1.0",
100+
"@aws-amplify/react-native": "^1.1.10"
101+
},
102+
"peerDependenciesMeta": {
103+
"@aws-amplify/react-native": {
104+
"optional": true
105+
}
100106
},
101107
"devDependencies": {
102108
"@aws-amplify/core": "6.11.4",

packages/auth/src/client/utils/passkey/errors/handlePasskeyAuthenticationError.native.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { getIsNativeError } from '@aws-amplify/react-native/internals/utils';
4+
import { getIsNativeError } from '@aws-amplify/react-native';
55

66
import { handlePasskeyError } from './handlePasskeyError';
77
import {

packages/auth/src/client/utils/passkey/errors/handlePasskeyError.native.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import { AmplifyErrorCode } from '@aws-amplify/core/internals/utils';
5-
import { getIsNativeError } from '@aws-amplify/react-native/internals/utils';
5+
import { getIsNativeError } from '@aws-amplify/react-native';
66

77
import {
88
PasskeyError,

packages/auth/src/client/utils/passkey/errors/handlePasskeyRegistrationError.native.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { getIsNativeError } from '@aws-amplify/react-native/internals/utils';
4+
import { getIsNativeError } from '@aws-amplify/react-native';
55

66
import { handlePasskeyError } from './handlePasskeyError';
77
import {

packages/react-native/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> INTERNAL USE ONLY
2+
3+
This package contains AWS Amplify React Native utilities and is intended for internal use only. Please ensure this package is installed alongside [aws-amplify](https://www.npmjs.com/package/aws-amplify). We do not advise using any exports from this package directly.

packages/react-native/internals/utils/package.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/react-native/package.json

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,6 @@
1010
"publishConfig": {
1111
"access": "public"
1212
},
13-
"exports": {
14-
".": {
15-
"react-native": "./dist/cjs/index.js",
16-
"types": "./dist/esm/index.d.ts",
17-
"import": "./dist/esm/index.mjs",
18-
"require": "./dist/cjs/index.js"
19-
},
20-
"./internals/utils": {
21-
"react-native": "./dist/cjs/utils/index.js",
22-
"types": "./dist/esm/utils/index.d.ts",
23-
"import": "./dist/esm/utils/index.mjs",
24-
"require": "./dist/cjs/utils/index.js"
25-
},
26-
"./package.json": "./package.json"
27-
},
2813
"scripts": {
2914
"prepare:ios": "cd example && npx pod-install",
3015
"prepare:android": "echo 'no-op'",
@@ -48,7 +33,13 @@
4833
},
4934
"peerDependencies": {
5035
"react-native": ">=0.70",
51-
"react-native-get-random-values": ">=1.8.0"
36+
"react-native-get-random-values": ">=1.8.0",
37+
"@aws-amplify/rtn-passkeys": "^1.0.0"
38+
},
39+
"peerDependenciesMeta": {
40+
"@aws-amplify/rtn-passkeys": {
41+
"optional": true
42+
}
5243
},
5344
"devDependencies": {
5445
"@aws-amplify/rtn-passkeys": "*",

0 commit comments

Comments
 (0)