Skip to content

Commit

Permalink
chore: V5 release from main (#10633)
Browse files Browse the repository at this point in the history
  • Loading branch information
stocaaro committed Nov 8, 2022
2 parents ab0e924 + 55e13f5 commit 0fa40e6
Show file tree
Hide file tree
Showing 1,179 changed files with 13,835 additions and 131,655 deletions.
158 changes: 106 additions & 52 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ commands:
name: 'Run cypress test << parameters.spec >>'
command: |
cd ~/amplify-js-samples-staging
yarn cypress run --headless --spec ./cypress/integration/auth/<< parameters.spec >>.spec.js --config baseUrl=https://aws.amazon.com/
~/amplify-js/.circleci/retry-yarn-script.sh -s 'cypress run --headless --spec ./cypress/integration/auth/<< parameters.spec >>.spec.js --config baseUrl=https://aws.amazon.com/' -n 3
- store_artifacts:
path: ~/amplify-js-samples-staging/cypress/videos
- store_artifacts:
Expand Down Expand Up @@ -369,8 +369,7 @@ jobs:
# https://github.com/TryGhost/node-sqlite3#source-install
command: |
cd packages/datastore-storage-adapter
npm install --build-from-source
rm -rf node_modules/@aws-amplify node_modules/@aws-sdk
npm install sqlite3 --build-from-source
- run:
name: 'Run Amplify JS unit tests'
command: |
Expand All @@ -388,6 +387,7 @@ jobs:
echo $SSH_HOST_PUBLIC_KEY >> ~/.ssh/known_hosts
git clone $AMPLIFY_JS_SAMPLES_STAGING_URL
cd amplify-js-samples-staging
git checkout next-major-version/5
yarn
- save_cache:
key: amplify-js-{{ .Branch }}-{{ checksum "amplify-js-samples-staging/yarn.lock" }}
Expand All @@ -398,7 +398,7 @@ jobs:
paths:
- amplify-js-samples-staging

integ_react_auth:
integ_react_auth_1: #break react auth test to 2 sections to save time
parameters:
browser:
type: string
Expand All @@ -407,19 +407,12 @@ jobs:
working_directory: ~/amplify-js-samples-staging/samples
steps:
- prepare_test_env
- integ_test_js:
test_name: 'React Authenticator'
framework: react
category: auth
sample_name: with-authenticator-legacy
spec: authenticator
browser: << parameters.browser >>
- integ_test_js:
test_name: 'React Authenticator'
framework: react
category: auth
sample_name: amplify-authenticator
spec: ui-amplify-authenticator
spec: new-ui-authenticator
browser: << parameters.browser >>
- integ_test_js:
test_name: 'Guest to Authenticated User"'
Expand All @@ -433,21 +426,30 @@ jobs:
framework: react
category: auth
sample_name: typescript-amplify-authenticator
spec: ui-amplify-authenticator
spec: new-ui-authenticator
browser: << parameters.browser >>
integ_react_auth_2:
parameters:
browser:
type: string
executor: js-test-executor
<<: *test_env_vars
working_directory: ~/amplify-js-samples-staging/samples
steps:
- prepare_test_env
- integ_test_js:
test_name: 'React Custom Authenticator'
framework: react
category: auth
sample_name: amplify-authenticator
spec: custom-authenticator
spec: new-ui-custom-authenticator
browser: << parameters.browser >>
- integ_test_js:
test_name: 'React Custom Authenticator'
framework: react
category: auth
sample_name: with-authenticator
spec: ui-amplify-authenticator
spec: new-ui-authenticator
browser: << parameters.browser >>
- integ_test_js:
test_name: 'Sign In after Sign Up'
Expand All @@ -465,13 +467,6 @@ jobs:
working_directory: ~/amplify-js-samples-staging/samples
steps:
- prepare_test_env
- integ_test_js:
test_name: 'Angular Authenticator'
framework: angular
category: auth
sample_name: amplify-authenticator-legacy
spec: authenticator
browser: << parameters.browser >>
- integ_test_js:
test_name: 'Angular Authenticator'
framework: angular
Expand Down Expand Up @@ -502,19 +497,12 @@ jobs:
sample_name: amplify-authenticator-legacy
spec: authenticator
browser: << parameters.browser >>
- integ_test_js:
test_name: 'Vue 2 Authenticator'
framework: vue
category: auth
sample_name: amplify-authenticator
spec: ui-amplify-authenticator
browser: << parameters.browser >>
- integ_test_js:
test_name: 'Vue 3 Authenticator'
framework: vue
category: auth
sample_name: authenticator-vue3
spec: ui-amplify-authenticator
spec: new-ui-authenticator
browser: << parameters.browser >>
- integ_test_js:
test_name: 'Vue Custom Authenticator'
Expand Down Expand Up @@ -930,18 +918,6 @@ jobs:
sample_name: graphql
spec: graphql
browser: << parameters.browser >>
integ_react_storage_ui:
executor: js-test-executor
<<: *test_env_vars
working_directory: ~/amplify-js-samples-staging/samples/react/storage/storageComp
steps:
- prepare_test_env
- integ_test_js:
test_name: 'React Storage UI Components'
framework: react
category: storage
sample_name: storageComp
spec: storage-comp
integ_react_amazon_cognito_identity_js_cookie_storage:
parameters:
browser:
Expand Down Expand Up @@ -1242,6 +1218,53 @@ jobs:
spec: background-process-manager
browser: << parameters.browser >>

integ_react_datastore_related_models:
parameters:
browser:
type: string
executor: js-test-executor
<<: *test_env_vars
working_directory: ~/amplify-js-samples-staging/samples/react/datastore/related-models
steps:
- prepare_test_env
- integ_test_js:
test_name: 'DataStore - Related Models'
framework: react
category: datastore
sample_name: related-models
spec: related-models
browser: << parameters.browser >>

integ_react_iot_reconnect:
executor: js-test-executor
<<: *test_env_vars
working_directory: ~/amplify-js-samples-staging/samples/react/pubsub/reconnection-iot
steps:
- prepare_test_env
- integ_test_js:
test_name: 'PubSub - Reconnection for IoT'
framework: react
category: pubsub
sample_name: reconnection-iot
spec: reconnection
# Firefox doesn't support network state management in cypress
browser: chrome

integ_react_api_reconnect:
executor: js-test-executor
<<: *test_env_vars
working_directory: ~/amplify-js-samples-staging/samples/react/pubsub/reconnection-api
steps:
- prepare_test_env
- integ_test_js:
test_name: 'PubSub - Reconnection for API'
framework: react
category: pubsub
sample_name: reconnection-api
spec: reconnection
# Firefox doesn't support network state management in cypress
browser: chrome

deploy:
executor: macos-executor
working_directory: ~/amplify-js
Expand Down Expand Up @@ -1288,6 +1311,8 @@ releasable_branches: &releasable_branches
- ui-components/main
- 1.0-stable
- geo/main
- in-app-messaging/main
- next-major-version/5

test_browsers: &test_browsers
browser: [chrome, firefox]
Expand Down Expand Up @@ -1326,7 +1351,16 @@ workflows:
- unit_test:
requires:
- build
- integ_react_auth:
- integ_react_auth_1:
requires:
- integ_setup
- build
filters:
<<: *releasable_branches
matrix:
parameters:
<<: *test_browsers
- integ_react_auth_2:
requires:
- integ_setup
- build
Expand Down Expand Up @@ -1566,12 +1600,6 @@ workflows:
matrix:
parameters:
<<: *test_browsers
- integ_react_storage_ui:
requires:
- integ_setup
- build
filters:
<<: *releasable_branches
- integ_react_amazon_cognito_identity_js_cookie_storage:
requires:
- integ_setup
Expand Down Expand Up @@ -1722,6 +1750,7 @@ workflows:
matrix:
parameters:
<<: *test_browsers

- integ_react_datastore_background_process_manager:
requires:
- integ_setup
Expand All @@ -1731,6 +1760,28 @@ workflows:
matrix:
parameters:
<<: *test_browsers
- integ_react_datastore_related_models:
requires:
- integ_setup
- build
filters:
<<: *releasable_branches
matrix:
parameters:
<<: *test_browsers
- integ_react_iot_reconnect:
requires:
- integ_setup
- build
filters:
<<: *releasable_branches
- integ_react_api_reconnect:
requires:
- integ_setup
- build
filters:
<<: *releasable_branches

- deploy:
filters:
<<: *releasable_branches
Expand All @@ -1756,14 +1807,14 @@ workflows:
- integ_react_storage
- integ_react_storage_multipart_progress
- integ_react_storage_copy
- integ_react_storage_ui
- integ_react_interactions
- integ_angular_interactions
- integ_vue_interactions
- integ_react_amazon_cognito_identity_js_cookie_storage
- integ_react_amazon_cognito_identity_js
- integ_node_amazon_cognito_identity_js
- integ_react_auth
- integ_react_auth_1
- integ_react_auth_2
- integ_angular_auth
- integ_vue_auth
- integ_rn_ios_storage
Expand All @@ -1783,6 +1834,9 @@ workflows:
- integ_react_datastore_custom_pk_has_one
- integ_react_datastore_custom_pk_has_many_many_to_many
- integ_react_datastore_background_process_manager
- integ_react_datastore_related_models
- integ_react_iot_reconnect
- integ_react_api_reconnect
- post_release:
filters:
branches:
Expand Down Expand Up @@ -1963,7 +2017,7 @@ orbs:
exit 1
fi
}
eval << parameters.pre-command >>
eval << parameters.pre-command >>
retry "<< parameters.command >>"
no_output_timeout: << parameters.no_output_timeout >>

Expand Down
9 changes: 0 additions & 9 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
* @aws-amplify/amplify-js
/packages/amplify-ui @aws-amplify/amplify-js @aws-amplify/amplify-ui
/packages/amplify-ui-angular @aws-amplify/amplify-js @aws-amplify/amplify-ui
/packages/amplify-ui-components @aws-amplify/amplify-js @aws-amplify/amplify-ui
/packages/amplify-ui-react @aws-amplify/amplify-js @aws-amplify/amplify-ui
/packages/amplify-ui-storybook @aws-amplify/amplify-js @aws-amplify/amplify-ui
/packages/amplify-ui-vue @aws-amplify/amplify-js @aws-amplify/amplify-ui
/packages/api @aws-amplify/amplify-js @aws-amplify/amplify-data
/packages/api-graphql @aws-amplify/amplify-data
/packages/api-rest @aws-amplify/amplify-js @aws-amplify/amplify-data
/packages/aws-amplify-angular @aws-amplify/amplify-js @aws-amplify/amplify-ui
/packages/aws-amplify-react @aws-amplify/amplify-js @aws-amplify/amplify-ui
/packages/aws-amplify-react-native @aws-amplify/amplify-js @aws-amplify/amplify-ui
/packages/aws-amplify-vue @aws-amplify/amplify-js @aws-amplify/amplify-ui
/packages/core @aws-amplify/amplify-js @aws-amplify/amplify-data
/packages/datastore @aws-amplify/amplify-data
/packages/datastore-storage-adapter @aws-amplify/amplify-data
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ packages/**/cjs/
packages/**/cypress/videos/
yarn.lock
package-lock.json
packages/*/.watchmanconfig
packages/*/.watchmanconfig
coverage-ts/
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ yarn build --scope @aws-amplify/auth

```
yarn run test --scope @aws-amplify/auth
yarn run test --scope @aws-amplify/ui-components
```

> Note: There is a commit hook that will run the tests prior to committing. Please make sure if you are going to provide a pull request to be sure you include unit tests with your functionality and that all tests pass.
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@
"link-all": "yarn unlink-all && lerna exec --no-bail --parallel yarn link",
"unlink-all": "lerna exec --no-bail --parallel -- yarn unlink; exit 0",
"publish:main": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=unstable --preid=unstable --exact --no-verify-access",
"publish:next-major-version/5": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=next --preid=next --exact --no-verify-access",
"publish:beta": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=beta --preid=beta --exact --no-verify-access",
"publish:release": "lerna publish --conventional-commits --yes --message 'chore(release): Publish [ci skip]' --no-verify-access",
"publish:release": "lerna exec npm publish",
"publish:1.0-stable": "lerna publish --conventional-commits --yes --dist-tag=stable-1.0 --message 'chore(release): Publish [ci skip]' --no-verify-access",
"publish:ui-components/main": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=ui-preview --preid=ui-preview --exact --no-verify-access",
"publish:verdaccio": "lerna publish --no-push --canary minor --dist-tag=unstable --preid=unstable --exact --force-publish --yes --no-verify-access",
"publish:geo/main": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=geo --preid=geo --exact --no-verify-access"
"publish:geo/main": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=geo --preid=geo --exact --no-verify-access",
"publish:in-app-messaging/main": "lerna publish --canary --force-publish \"*\" --yes --dist-tag=in-app-messaging --preid=in-app-messaging --exact --no-verify-access",
"ts-coverage": "lerna run ts-coverage"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -89,6 +92,7 @@
"tslint-config-airbnb": "^5.8.0",
"typedoc": "^0.16.9",
"typescript": "~3.8.3",
"typescript-coverage-report": "^0.6.4",
"uglifyjs-webpack-plugin": "^0.4.6",
"uuid-validate": "^0.0.3",
"webpack": "^4.32.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import AuthenticationHelper from '../src/AuthenticationHelper';

import BigInteger from '../src/BigInteger';
import { SHA256 } from 'crypto-js';
import { Sha256 } from '@aws-crypto/sha256-js';
import { promisifyCallback } from './util';
import { bigIntError } from './constants';
const instance = new AuthenticationHelper('TestPoolName');
Expand Down Expand Up @@ -738,8 +738,12 @@ describe('calculateU()', () => {
describe('hexhash() and hash()', () => {
test('Test hexHash function produces a valid hex string with regex', () => {
const regEx = /[0-9a-f]/g;
const hexStr = SHA256('testString').toString();
expect(regEx.test(instance.hexHash(hexStr))).toBe(true);
const awsCryptoHash = new Sha256();
awsCryptoHash.update('testString');
const resultFromAWSCrypto = awsCryptoHash.digestSync();
const hashHex = Buffer.from(resultFromAWSCrypto).toString('hex');

expect(regEx.test(instance.hexHash(hashHex))).toBe(true);
});

test('Hashing a buffer returns a string', () => {
Expand Down

0 comments on commit 0fa40e6

Please sign in to comment.