Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release(required): Amplify JS release #12539

Merged
merged 47 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9a8f7b4
chore: Merge `release` into `main` (#12462)
jimblanc Oct 30, 2023
47e822d
chore: Switch release back to conventional commits (#12463)
jimblanc Oct 30, 2023
9d6c0b2
chore: Re-enable OSX pre-build (#12460)
jimblanc Oct 30, 2023
661ac60
chore: Restrict staging branch checkout logic (#12465)
jimblanc Oct 30, 2023
feaecfd
feat(adapter-nextjs)!: introduce createServerRunner and remove withAm…
HuiSF Oct 27, 2023
702ee71
chore(adapter-nextjs)!: rename generateServerClient to generateServer…
HuiSF Oct 27, 2023
48c195d
chore(adapter-nextjs): make package public
HuiSF Oct 30, 2023
db86d67
chore: Re-enables SSR tests (#12468)
jimblanc Oct 30, 2023
b63359a
fix: Check for OAuth URLs before splitting (#12469)
jimblanc Oct 30, 2023
c2423a3
chore: Setup v5 LTS CI infrastructure (#12455) (#12459)
jimblanc Oct 30, 2023
bd880d3
chore: Update yarn.lock (#12471)
jimblanc Oct 30, 2023
18f8976
feat(predictions): specify identifyEntity metadata type (#12470)
erinleigh90 Oct 30, 2023
20e9a79
fix(storage): address actionable TODOs (#12414)
AllanZhengYP Oct 30, 2023
5e48cb1
fix: Resolving in-flight OAuth promises when sign-in flow cancelled (…
jimblanc Oct 31, 2023
3b7a1f3
chore(inapp): reduce todos, update error message, update tests and ad…
Samaritan1011001 Oct 31, 2023
4476eba
test: increase tsc-compliance test coverage (#12444)
AllanZhengYP Oct 31, 2023
58d1375
chore: Tweak bundle size limits(increase) (#12480)
jimblanc Oct 31, 2023
aaa7e98
fix(aws-amplify): preserve default auth providers with repetitive cal…
HuiSF Oct 31, 2023
5ce4435
chore(adapter-nextjs): update public APIs inline docs
HuiSF Oct 30, 2023
6b2d06b
fix(adapter-nextjs): add api dir to the distribution list
HuiSF Oct 31, 2023
cfbde4c
chore(api): hide generateClient from api/server subpath
HuiSF Oct 31, 2023
091f681
fix(adapter-nextjs): remove the constraint of calling createServerRun…
HuiSF Oct 31, 2023
ad5c83e
fix: Support tracking multiple inflight OAuth promise resolvers (#12482)
jimblanc Oct 31, 2023
588b76b
chore(adapter-nextjs): bump Next.js version range (#12442)
HuiSF Nov 1, 2023
ecba1ec
chore(amplify-js/utils): expose storage helpers (#12493)
israx Nov 2, 2023
1aa0c2b
test(core): unit validating clockskew offset is updated when client c…
AllanZhengYP Nov 2, 2023
02a91a4
fix(auth): rename type CognitoAuthUser to AuthUser (#12500)
ashwinkumar6 Nov 3, 2023
c4f5983
test(core): fix clock skew unit test (#12509)
AllanZhengYP Nov 3, 2023
2432d39
export connection state type and enum from /api (#12508)
iartemiev Nov 3, 2023
e1d88c2
fix(react-native): Update namespaces to be unique (#12510)
cshfang Nov 3, 2023
3ae78c7
chore(types): expose CodeDeliveryDetails, HubCapsule types (#12501)
ashwinkumar6 Nov 3, 2023
0960fdd
fix(core): remove used symbol and remove usage of Symbol.for
HuiSF Oct 31, 2023
39eacaa
chore(adapter-nextjs): bump the min support version of Next.js
HuiSF Nov 1, 2023
7b514bb
chore(adapter-nextjs): remove unused server-only dep
HuiSF Nov 3, 2023
7dde343
fix: add module loader for web browser native module (#12519)
cshfang Nov 7, 2023
875e28a
fix(auth): vend the helpful types for custom providers (#12497)
Samaritan1011001 Nov 7, 2023
903a012
feat(repo): set up rollup to emit esm and cjs artifacts (#12522)
HuiSF Nov 7, 2023
5f52c64
fix(auth): Do not sign out client if Oauth signout fails (#12520)
cshfang Nov 8, 2023
5b52c3a
fix(analytics): add options for configuring pinpoint event buffer (#1…
Nov 8, 2023
0138c28
Clean up references to ConsoleLogger (#12499)
cshfang Nov 8, 2023
bd73367
chore(auth|aws-amplify): fix instance naming (use camel-case)
HuiSF Nov 8, 2023
36de0bb
fix(auth): refreshToken unawaited async operation caused race condition
HuiSF Nov 9, 2023
eca4b5a
chore: Update release command.
jimblanc Nov 9, 2023
296162c
Publish
jimblanc Nov 9, 2023
250bff8
fix: API GraphQL dependencies on core & auth.
jimblanc Nov 9, 2023
0bf1ad7
chore: Remove auth as DataStore dependency.
jimblanc Nov 9, 2023
ff4e8d7
chore: Prep v6.0.1 release (#12538)
jimblanc Nov 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/actions/setup-samples-staging/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
env:
BRANCH: ${{ github.ref_name }}
run: |
if git ls-remote --exit-code --heads origin $BRANCH >/dev/null 2>&1; then
if git ls-remote origin $BRANCH | grep -q refs/heads/next/$BRANCH$; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep this is correct, synced offline

# Branch exists, checkout and echo success message
git fetch origin $BRANCH
git checkout $BRANCH
Expand Down
32 changes: 16 additions & 16 deletions .github/integ-config/integ-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -492,22 +492,22 @@ tests:
sample_name: [delete-user]
spec: delete-user
browser: *minimal_browser_list
# - test_name: integ_next_auth_authenticator_and_ssr_page
# desc: 'Authenticator and SSR page'
# framework: next
# category: auth
# sample_name: [auth-ssr]
# spec: auth-ssr
# browser: [chrome]
# - test_name: integ_next_auth_authenticator_and_rsc_page
# desc: 'Authenticator and RSC page'
# framework: next
# category: auth
# sample_name: [auth-rsc]
# spec: auth-rsc
# browser: [chrome]
# timeout_minutes: 45
# retry_count: 10
- test_name: integ_next_auth_authenticator_and_ssr_page
desc: 'Authenticator and SSR page'
framework: next
category: auth
sample_name: [auth-ssr]
spec: auth-ssr
browser: [chrome]
- test_name: integ_next_auth_authenticator_and_rsc_page
desc: 'Authenticator and RSC page'
framework: next
category: auth
sample_name: [auth-rsc]
spec: auth-rsc
browser: [chrome]
timeout_minutes: 45
retry_count: 10

# DISABLED Angular/Vue tests:
# TODO: delete tests or add custom ui logic to support them.
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/callable-npm-publish-lts-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release LTS version to npm and update repository

on:
workflow_call:
inputs:
target:
required: true
type: string

jobs:
deploy:
name: Publish to Amplify Package
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f
with:
path: amplify-js
token: ${{ secrets.GH_TOKEN_AMPLIFY_JS_WRITE }}

- name: Setup node and build the repository
uses: ./amplify-js/.github/actions/node-and-build

- name: Run npm publish
uses: ./amplify-js/.github/actions/npm-publish
with:
target: ${{ inputs.target }}
npm_token: ${{ secrets.NPM_TOKEN }}
github_user: ${{ vars.GH_USER}}
github_email: ${{ vars.GH_EMAIL}}

- name: Set github commit user
env:
GITHUB_EMAIL: ${{ vars.GH_EMAIL }}
GITHUB_USER: ${{ vars.GH_USER }}
run: |
git config --global user.email $GITHUB_EMAIL
git config --global user.name $GITHUB_USER
- name: Update API documentation
working-directory: ./amplify-js
run: |
yarn run docs
git add ./docs/api/
git commit -m "chore(release): update API docs [ci skip]"
- name: Push post release changes
working-directory: ./amplify-js
env:
TARGET_BRANCH: ${{ inputs.target }}
run: |
git push origin $TARGET_BRANCH
2 changes: 1 addition & 1 deletion .github/workflows/callable-npm-publish-preid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
ALLOW_PROTECTED_PREIDS: ${{ inputs.allow-protected-preid }}
PREID: ${{ inputs.preid }}
FORBIDDEN_PREIDS: latest
PROTECTED_PREIDS: next unstable
PROTECTED_PREIDS: next unstable stable-5 stable-4
run: |
echo "Testing to see if $PREID is in the forbidden list ($FORBIDDEN_PREIDS)"
for e in $FORBIDDEN_PREIDS; do [[ $PREID == $e ]] && echo "$PREID is forbidden from preid release" && exit 1; done
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/callable-release-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ jobs:
uses: ./.github/workflows/callable-prebuild-amplify-js.yml
with:
runs_on: ubuntu-latest
# prebuild-macos:
# uses: ./.github/workflows/callable-prebuild-amplify-js.yml
# with:
# runs_on: macos-latest
prebuild-macos:
uses: ./.github/workflows/callable-prebuild-amplify-js.yml
with:
runs_on: macos-latest
prebuild-samples-staging:
secrets: inherit
uses: ./.github/workflows/callable-prebuild-samples-staging.yml
e2e:
needs:
# - prebuild-macos
- prebuild-macos
- prebuild-ubuntu
- prebuild-samples-staging
secrets: inherit
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/push-lts-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Push - release from LTS branch to LTS dist tag

concurrency:
# group name unique for push to push-latest-release
group: push-lts-release-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- v5-stable

jobs:
e2e:
secrets: inherit
uses: ./.github/workflows/callable-release-verification.yml
release:
needs:
- e2e
permissions:
contents: write
secrets: inherit
uses: ./.github/workflows/callable-npm-publish-lts-release.yml
with:
target: v5-stable # TODO Update this to support other LTS branches in the future
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ coverage-ts/
**/example/ios/Podfile.lock
**/example/.bundle
**/example/yarn.lock

# rollup
**/.rollup.cache
**/buildMeta
5 changes: 4 additions & 1 deletion license_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
"**/vendor",
"**/__tests__",
"**/__mocks__",
"**/Gemfile"
"**/Gemfile",
"**/.rollup.cache",
"**/rollup.config.mjs",
"rollup"
],
"ignoreFile": ".gitignore",
"license": "license_header.txt",
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test:duplicates": "./scripts/duplicates-yarn.sh",
"test:license": "license-check-and-add check -f license_config.json",
"test:github-actions": "node ./scripts/test-github-actions.js",
"test:tsc-compliance": "yarn workspace tsc-compliance-test test:compliance:ts4.2",
"test:tsc-compliance": "yarn workspace tsc-compliance-test test:compliance",
"coverage": "codecov || exit 0",
"docs": "typedoc packages/**/src --name amplify-js --hideGenerator --excludePrivate --ignoreCompilerErrors --mode file --out docs/api --theme docs/amplify-theme/typedoc/ --readme README.md",
"build": "lerna run build --stream && yarn test:duplicates",
Expand All @@ -30,6 +30,7 @@
"publish:preid": "./scripts/preid-env-vars-exist.sh && lerna publish --canary --force-publish --dist-tag=${PREID_PREFIX} --preid=${PREID_PREFIX}${PREID_HASH_SUFFIX} --yes",
"publish:main": "lerna publish --canary --force-publish --dist-tag=unstable --preid=unstable${PREID_HASH_SUFFIX} --yes",
"publish:release": "lerna publish from-package --dist-tag=v6 --message 'chore(release): Publish [ci skip]' --yes",
"publish:v5-stable": "lerna publish --conventional-commits --yes --dist-tag=stable-5 --message 'chore(release): Publish [ci skip]' --no-verify-access",
"publish:verdaccio": "lerna publish --canary --force-publish --no-push --dist-tag=unstable --preid=unstable --yes",
"ts-coverage": "lerna run ts-coverage",
"prepare": "./scripts/set-preid-versions.sh"
Expand Down Expand Up @@ -94,6 +95,7 @@
"babel-jest": "^24.9.0",
"babel-loader": "^8.3.0",
"codecov": "^3.6.5",
"glob": "^10.3.10",
"husky": "^3.0.5",
"jest": "^24.x.x",
"jest-config": "24.8.0",
Expand Down Expand Up @@ -129,7 +131,8 @@
"@types/babel__traverse": "7.20.0",
"path-scurry": "1.10.0",
"**/glob/minipass": "6.0.2",
"nx": "16.7.0"
"nx": "16.7.0",
"next": "13.5.6"
},
"jest": {
"resetMocks": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { ResourcesConfig } from '@aws-amplify/core';
import {
generateServerClientUsingCookies,
generateServerClient,
generateServerClientUsingReqRes,
} from '../../src/api';
import { runWithAmplifyServerContext } from './../../src';
import { getAmplifyConfig } from '../../src/utils';
import {
getAmplifyConfig,
createRunWithAmplifyServerContext,
} from '../../src/utils';
import { NextApiRequestMock, NextApiResponseMock } from '../mocks/headers';
import { createServerRunnerForAPI } from '../../src/api/createServerRunnerForAPI';

const headers = import('next/headers');
const headers = import('next/headers.js');
(global as any).Headers = jest.requireActual('node-fetch').Headers;

const mockAmplifyConfig: ResourcesConfig = {
Expand All @@ -29,13 +32,16 @@ const mockAmplifyConfig: ResourcesConfig = {
};

jest.mock('../../src/utils', () => ({
createRunWithAmplifyServerContext: jest.fn(() => jest.fn()),
getAmplifyConfig: jest.fn(() => mockAmplifyConfig),
createCookieStorageAdapterFromNextServerContext: jest.fn(),
}));

jest.mock('aws-amplify/adapter-core');

const mockGetAmplifyConfig = getAmplifyConfig as jest.Mock;
const mockCreateRunWithAmplifyServerContext =
createRunWithAmplifyServerContext as jest.Mock;

describe('generateServerClientUsingCookies', () => {
it('should throw error when used with req/res', async () => {
Expand All @@ -52,11 +58,13 @@ describe('generateServerClientUsingCookies', () => {
}).toThrowError();
});

it('should call getAmlifyConfig', async () => {
it('should call createRunWithAmplifyServerContext to create runWithAmplifyServerContext function', async () => {
const cookies = (await headers).cookies;

generateServerClientUsingCookies({ cookies });
expect(mockGetAmplifyConfig).toHaveBeenCalled();
generateServerClientUsingCookies({ config: mockAmplifyConfig, cookies });
expect(mockCreateRunWithAmplifyServerContext).toHaveBeenCalledWith({
config: mockAmplifyConfig,
});
});
});

Expand All @@ -67,12 +75,15 @@ describe('generateServerClient', () => {
});

it('should call getAmlifyConfig', async () => {
generateServerClient();
generateServerClientUsingReqRes({ config: mockAmplifyConfig });
expect(mockGetAmplifyConfig).toHaveBeenCalled();
});

// TODO: figure out proper mocks and unskip
it.skip('wrapped client.graphql should pass context through', async () => {
const { runWithAmplifyServerContext } = createServerRunnerForAPI({
config: mockAmplifyConfig,
});
const mockedReq = new NextApiRequestMock();
const mockedRes = NextApiResponseMock;

Expand All @@ -86,7 +97,9 @@ describe('generateServerClient', () => {
getAmplifyServerContext: () => {},
}));

const client = generateServerClient();
const client = generateServerClientUsingReqRes({
config: mockAmplifyConfig,
});

await runWithAmplifyServerContext({
nextServerContext: {
Expand Down
Loading
Loading