Skip to content

Commit

Permalink
chore: move new function exports to internals
Browse files Browse the repository at this point in the history
  • Loading branch information
erinleigh90 committed Jun 5, 2023
1 parent b86c86b commit 978269a
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 11 deletions.
2 changes: 0 additions & 2 deletions packages/amazon-cognito-identity-js/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ describe('import * keys', () => {
"CookieStorage",
"DateHelper",
"appendToCognitoUserAgent",
"addAuthCategoryToCognitoUserAgent",
"addFrameworkToCognitoUserAgent",
"WordArray",
]
`);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as exported from '../src/internals/index';

describe('import * keys', () => {
it('should match snapshot', () => {
expect(Object.keys(exported)).toMatchInlineSnapshot(`
Array [
"addAuthCategoryToCognitoUserAgent",
"addFrameworkToCognitoUserAgent",
]
`);
});
});
2 changes: 0 additions & 2 deletions packages/amazon-cognito-identity-js/index.d.ts

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

2 changes: 2 additions & 0 deletions packages/amazon-cognito-identity-js/internals/index.d.ts

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

8 changes: 8 additions & 0 deletions packages/amazon-cognito-identity-js/internals/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "amazon-cognito-identity-js/internals",
"types": "./index.d.ts",
"main": "../lib/internals/index.js",
"module": "../es/internals/index.js",
"react-native": "../es/internals/index.js",
"sideEffects": false
}
6 changes: 1 addition & 5 deletions packages/amazon-cognito-identity-js/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,5 @@ export { default as CognitoUserPool } from './CognitoUserPool';
export { default as CognitoUserSession } from './CognitoUserSession';
export { default as CookieStorage } from './CookieStorage';
export { default as DateHelper } from './DateHelper';
export {
appendToCognitoUserAgent,
addAuthCategoryToCognitoUserAgent,
addFrameworkToCognitoUserAgent,
} from './UserAgent';
export { appendToCognitoUserAgent } from './UserAgent';
export { default as WordArray } from './utils/WordArray';
4 changes: 4 additions & 0 deletions packages/amazon-cognito-identity-js/src/internals/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export {
addAuthCategoryToCognitoUserAgent,
addFrameworkToCognitoUserAgent,
} from '../UserAgent';
6 changes: 4 additions & 2 deletions packages/auth/src/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ import {
HubCallback,
} from '@aws-amplify/core';
import {
addAuthCategoryToCognitoUserAgent,
addFrameworkToCognitoUserAgent,
CookieStorage,
CognitoUserPool,
AuthenticationDetails,
Expand All @@ -58,6 +56,10 @@ import {
NodeCallback,
CodeDeliveryDetails,
} from 'amazon-cognito-identity-js';
import {
addAuthCategoryToCognitoUserAgent,
addFrameworkToCognitoUserAgent,
} from 'amazon-cognito-identity-js/internals';

import { parse } from 'url';
import OAuth from './OAuth/OAuth';
Expand Down

0 comments on commit 978269a

Please sign in to comment.