diff --git a/.circleci/config.yml b/.circleci/config.yml index 6978303b8a2..280e8ae043d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1592,15 +1592,25 @@ jobs: - amplify-ssh-deps-{{ .Branch }} - amplify-ssh-deps - run: - name: 'Post-release steps' + name: 'Update roll-back infrastructure' command: | git config --global user.email $GITHUB_EMAIL git config --global user.name $GITHUB_USER git pull origin release - yarn workspace @aws-amplify/core build - git add ./packages/core/src/Platform/version.ts - git commit -m "chore(release): update version.ts [ci skip]" + PUBLISH_COMMIT_HASH=$(git log -n 1 --pretty=format:"%H") + RELEASE_COMMIT_MESSAGE=$(git log -n 1 --skip 1 --pretty=oneline) + if [[ $RELEASE_COMMIT_MESSAGE = *release\(required\)* ]]; then git tag -f required-release $PUBLISH_COMMIT_HASH; fi + - run: + name: 'Update API documentation' + command: | + yarn run docs + git add ./docs/api/ + git commit -m "chore(release): update API docs [ci skip]" + - run: + name: 'Push post release changes' + command: | git push origin release + git push -f origin required-release git push --force-with-lease origin release:main # Specifies the branches that can be considered releasable. @@ -2325,16 +2335,18 @@ workflows: - getting-started-smoke-test/web: name: Next.js - latest npx-command: create-next-app + npx-post: --use-npm --ts --tailwind --no-eslint --no-src-dir --no-app --import-alias "@/*"` framework: nextjs - main-file-path: pages/_app.js + main-file-path: pages/_app.tsx dev-start: dev build-dir: build ssr: true - getting-started-smoke-test/web: name: Next.js - next npx-command: create-next-app@canary + npx-post: --use-npm --ts --tailwind --no-eslint --no-src-dir --no-app --import-alias "@/*"` framework: nextjs - main-file-path: pages/_app.js + main-file-path: pages/_app.tsx dev-start: dev build-dir: build ssr: true @@ -2510,7 +2522,10 @@ orbs: no_output_timeout: 2m - run-with-retry: label: Install AmplifyJS - command: npm i -S aws-amplify && npm i -g wait-on serve + command: | + npm i -S aws-amplify + npm i -g wait-on serve + ~/amplify-js/.circleci/duplicates-npm.sh - run: name: Call Amplify library in code command: | diff --git a/.circleci/duplicates-npm.sh b/.circleci/duplicates-npm.sh new file mode 100644 index 00000000000..fb54ab6f690 --- /dev/null +++ b/.circleci/duplicates-npm.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# This script detects duplicated Amplify dependencies in the dependency graph (with NPM) +duplicatedDependencies=$( + npm ls -all 2>/dev/null | \ + grep -o -e '@\?aws-amplify[^ ]*' | \ + sort | uniq | \ + sed -E 's/^(@?[^@]+).*$/\1/g' | \ + uniq -d | sort +) + +if [ ! "$duplicatedDependencies" ]; then + echo "No duplicated Amplify dependencies detected." +else + echo "Duplicated Amplify dependencies detected: $duplicatedDependencies" + false +fi diff --git a/.github/ISSUE_TEMPLATE/1.bug_report.yaml b/.github/ISSUE_TEMPLATE/1.bug_report.yaml index 3e890e53ee9..ec21d2b2b40 100644 --- a/.github/ISSUE_TEMPLATE/1.bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/1.bug_report.yaml @@ -21,10 +21,7 @@ body: | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | `amazon-cognito-identity-js` | [](https://www.npmjs.com/package/amazon-cognito-identity-js) | | `aws-amplify` | [](https://www.npmjs.com/package/aws-amplify) | - | `aws-amplify-angular` | [](https://www.npmjs.com/package/aws-amplify-angular) | - | `aws-amplify-react` | [](https://www.npmjs.com/package/aws-amplify-react) | | `aws-amplify-react-native` | [](https://www.npmjs.com/package/aws-amplify-react-native) | - | `aws-amplify-vue` | [](https://www.npmjs.com/package/aws-amplify-vue) | | `@aws-amplify/analytics` | [](https://www.npmjs.com/package/@aws-amplify/analytics) | | `@aws-amplify/api` | [](https://www.npmjs.com/package/@aws-amplify/api) | | `@aws-amplify/api-graphql` | [](https://www.npmjs.com/package/@aws-amplify/api-graphql) | @@ -38,12 +35,6 @@ body: | `@aws-amplify/pubsub` | [](https://www.npmjs.com/package/@aws-amplify/pubsub) | | `@aws-amplify/pushnotification` | [](https://www.npmjs.com/package/@aws-amplify/pushnotification) | | `@aws-amplify/storage` | [](https://www.npmjs.com/package/@aws-amplify/storage) | - | `@aws-amplify/ui` | [](https://www.npmjs.com/package/@aws-amplify/ui) | - | `@aws-amplify/ui-angular` | [](https://www.npmjs.com/package/@aws-amplify/ui-angular) | - | `@aws-amplify/ui-components` | [](https://www.npmjs.com/package/@aws-amplify/ui-components) | - | `@aws-amplify/ui-react` | [](https://www.npmjs.com/package/@aws-amplify/ui-react) | - | `@aws-amplify/ui-vue` | [](https://www.npmjs.com/package/@aws-amplify/ui-vue) | - | `@aws-amplify/xr` | [](https://www.npmjs.com/package/@aws-amplify/xr) | @@ -118,7 +109,6 @@ body: - notifications - interactions - predictions - - xr - Not applicable - type: textarea attributes: diff --git a/.github/workflows/issue-pending-response.yml b/.github/workflows/issue-pending-response.yml new file mode 100644 index 00000000000..d69cd643bcd --- /dev/null +++ b/.github/workflows/issue-pending-response.yml @@ -0,0 +1,15 @@ +name: issue-pending-response +on: + issue_comment: + types: [created] +permissions: + issues: write +jobs: + issue_commented: + if: ${{ !github.event.issue.pull_request && contains(github.event.issue.labels.*.name, 'pending-response') }} + runs-on: ubuntu-latest + steps: + - uses: siegerts/pending-author-response@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + pending-response-label: pending-response diff --git a/.github/workflows/snyk-security.yml b/.github/workflows/snyk-security.yml new file mode 100644 index 00000000000..c1000a48191 --- /dev/null +++ b/.github/workflows/snyk-security.yml @@ -0,0 +1,36 @@ +name: 'Snyk Security' + +on: + push: + branches: ['release'] + schedule: + - cron: '0 0 * * *' # run daily at midnight GMT + +permissions: + contents: read + +jobs: + snyk: + if: github.repository == 'aws-amplify/amplify-js' + permissions: + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Snyk CLI to check for security issues + uses: snyk/actions/setup@806182742461562b67788a64410098c9d9b96adb + - name: Build + run: yarn install || true + # Using `|| true` to not fail the pipeline + - name: Snyk test + env: + SNYK_TOKEN: ${{secrets.SNYK_TOKEN}} + run: snyk test --sarif | tee snyk-code.sarif # || true + + # Push the Snyk Code results into GitHub Code Scanning tab + - name: Upload result to GitHub Code Scanning + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: snyk-code.sarif diff --git a/.gitignore b/.gitignore index ebf4d950ae4..ea82d0b8e71 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,9 @@ package-lock.json packages/*/.watchmanconfig dual-publish-tmp +### Version file - core build artifact +packages/core/src/Platform/version.ts + ### Gradle ### .gradle/ local.properties diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 1417008e883..bceea9f2f0c 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -13,7 +13,7 @@ GEM execjs coffee-script-source (1.11.1) colorator (1.1.0) - commonmarker (0.23.8) + commonmarker (0.23.9) concurrent-ruby (1.2.2) dnsruby (1.61.9) simpleidn (~> 0.1) @@ -211,7 +211,7 @@ GEM jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) minitest (5.18.0) - nokogiri (1.13.10) + nokogiri (1.14.3) mini_portile2 (~> 2.8.0) racc (~> 1.4) octokit (4.25.1) diff --git a/docs/_config.yml b/docs/_config.yml index 55771997bd8..b848fe11fce 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -9,6 +9,7 @@ # 'bundle exec jekyll serve'. If you change this file, please restart the server process. # Site settings +# # These are used to personalize your new site. If you look in the HTML files, # you will see them accessed via {{ site.title }}, {{ site.email }}, and so on. # You can create any custom variable you would like, and they will be accessible @@ -341,4 +342,4 @@ js_libraries: - title: Ionic url: '?platform=ionic' - title: JavaScript - url: '?platform=purejs' \ No newline at end of file + url: '?platform=purejs' diff --git a/docs/amplify-theme/_includes/site-head.html b/docs/amplify-theme/_includes/site-head.html index f146b3b33ad..243481d5ea3 100755 --- a/docs/amplify-theme/_includes/site-head.html +++ b/docs/amplify-theme/_includes/site-head.html @@ -9,8 +9,8 @@ {% if page.keywords %} {% endif %} - - + + - \ No newline at end of file + diff --git a/docs/amplify-theme/_includes/site-header.html b/docs/amplify-theme/_includes/site-header.html index d3aaffcef26..a2e8b3cfda2 100755 --- a/docs/amplify-theme/_includes/site-header.html +++ b/docs/amplify-theme/_includes/site-header.html @@ -54,13 +54,13 @@ {% if site.amplify.header.logo.text %}
{% elsif site.amplify.header.logo.image %} -