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 #13301

Merged
merged 45 commits into from Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
32990ee
Feat: DownloadData refactor (#13073)
ashika112 Mar 11, 2024
e882c68
Chore: Update Storage deprecation warning (#13107)
ashika112 Mar 12, 2024
1a1e0f4
chore(storage): extract isInputWithPath into separate file (#13114)
ashwinkumar6 Mar 13, 2024
ac87369
Feat: Prefix resolver & Path input validation (#13113)
ashika112 Mar 14, 2024
c8b64e3
Merge branch 'gen2-storage' of github.com:aws-amplify/amplify-js into…
Mar 18, 2024
bc6c8d9
chore: sync gen2 storage with main (#13141)
ashwinkumar6 Mar 18, 2024
301298c
chore: increase downloadData bundle size (#13142)
ashwinkumar6 Mar 18, 2024
1257697
[Fix] Path leading slash validation (#13146)
ashika112 Mar 19, 2024
3e6528d
feat(storage): add path support to copy API (#13104)
ashwinkumar6 Mar 20, 2024
29661a5
Update Path assertion (#13160)
ashika112 Mar 21, 2024
77b2b20
chore: Enable pre-id publication for gen2-storage (#13159)
jimblanc Mar 22, 2024
6456588
feat: add gen2 path parameter to getProperties and getUrl (#13144)
erinleigh90 Mar 25, 2024
bef4777
feat(storage): remove api takes path or key (#13115)
Samaritan1011001 Mar 25, 2024
db028e7
chore: Add validation to ensure key & path not specified at the same …
jimblanc Mar 26, 2024
7da2b89
chore: Update bundle size limit for `getUrl` (#13180)
jimblanc Mar 26, 2024
872a817
feat(storage): list API to accept both prefix and path (#13100)
Samaritan1011001 Mar 26, 2024
68a88bb
feat(storage): uploadData path parameter support (#13099)
jimblanc Mar 27, 2024
6104ab7
Feat: Amplify Outputs parse (#13150)
elorzafe Mar 28, 2024
a94480d
fix(storage): refactor storage API types (#13207)
ashwinkumar6 Apr 2, 2024
58b86bb
[Fix] Update API overload types (#13214)
ashika112 Apr 5, 2024
00224af
Fix: relax config for AmplifyOutputs (#13234)
elorzafe Apr 10, 2024
a81fc29
Fix Overload return types for storage APIs (#13239)
ashika112 Apr 11, 2024
86f9297
Merge branch 'main' of github.com:aws-amplify/amplify-js into gen2-st…
Apr 16, 2024
dd48ddd
chore: fix linter errors in parseGen2 config tests
Apr 17, 2024
f797dc5
fix: Fix SSR & AmplifyOutput types when using Gen2 configuration file…
jimblanc Apr 17, 2024
f6dc1fa
chore: resolve sync with main conflicts
Apr 17, 2024
944d235
chore: fix linter erros and bump bundle
Apr 17, 2024
7f66d06
chore: sync with main (#13256)
ashwinkumar6 Apr 17, 2024
4cb73f6
Merge branch 'main' of github.com:aws-amplify/amplify-js into chore/s…
ashika112 Apr 23, 2024
9bc6ce8
bundle size update
ashika112 Apr 23, 2024
fdc6d9a
Sync `gen2-storage` with `main` (#13282)
ashika112 Apr 23, 2024
e54bfa9
[Fix]: Storage Input/Output types (#13270)
ashika112 Apr 23, 2024
3cca682
fix(geo): update amplify config geo schema (#13290)
ashwinkumar6 Apr 24, 2024
7056343
Merge branch 'main' into gen2-storage
ashika112 Apr 25, 2024
f257c75
bundle size fix
ashika112 Apr 26, 2024
b334158
chore: Merge release into main (#13295)
AllanZhengYP Apr 26, 2024
00bec21
Revert "chore: Enable pre-id publication for gen2-storage (#13159)"
ashika112 Apr 26, 2024
4e4661d
Merge branch 'main' of github.com:aws-amplify/amplify-js into gen2-st…
ashika112 Apr 26, 2024
64acd49
chore: bump to data-schema version ^0.18.0 (#13297)
svidgen Apr 26, 2024
4378e72
Merge branch 'main' into gen2-storage
ashika112 Apr 26, 2024
588289c
[Feat] Storage Path changes Gen 2 (#13294)
ashika112 Apr 26, 2024
a5d176b
feat(api-graphql): alias authMode identityPool -> iam (#13299)
iartemiev Apr 26, 2024
89ecc6d
chore: pin to use macos 12 in gh actions (#13300)
ashwinkumar6 Apr 26, 2024
fa02396
Fix/geo location services config (#13303)
ashwinkumar6 Apr 28, 2024
8fb751a
chore: bump data-schema dep to latest (#13302)
iartemiev Apr 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/integ-config/integ-all.yml
Expand Up @@ -730,6 +730,15 @@ tests:
spec: multi-part-copy
browser: *minimal_browser_list

# GEN2 STORAGE
- test_name: integ_react_storage
desc: 'React Storage Gen2'
framework: react
category: storage
sample_name: [storage-gen2]
spec: storage-gen2
browser: *minimal_browser_list

# INAPPMESSAGING
- test_name: integ_in_app_messaging
desc: 'React InApp Messaging'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/callable-canary-e2e.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
prebuild-macos:
uses: ./.github/workflows/callable-prebuild-amplify-js.yml
with:
runs_on: macos-latest
runs_on: macos-12
prebuild-samples-staging:
secrets: inherit
uses: ./.github/workflows/callable-prebuild-samples-staging.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/callable-e2e-test-detox.yml
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
e2e-test:
name: E2E-Detox ${{ inputs.test_name }}
runs-on: macos-latest
runs-on: macos-12
timeout-minutes: ${{ inputs.timeout_minutes }}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/callable-release-verification.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
prebuild-macos:
uses: ./.github/workflows/callable-prebuild-amplify-js.yml
with:
runs_on: macos-latest
runs_on: macos-12
prebuild-samples-staging:
secrets: inherit
uses: ./.github/workflows/callable-prebuild-samples-staging.yml
Expand Down
@@ -1,13 +1,11 @@
import { ResourcesConfig } from '@aws-amplify/core';
import { parseAmplifyConfig } from '@aws-amplify/core/internals/utils';

import {
generateServerClientUsingCookies,
generateServerClientUsingReqRes,
} from '../../src/api';
import {
createRunWithAmplifyServerContext,
getAmplifyConfig,
} from '../../src/utils';
import { createRunWithAmplifyServerContext } from '../../src/utils';
import { NextApiRequestMock, NextApiResponseMock } from '../mocks/headers';
import { createServerRunnerForAPI } from '../../src/api/createServerRunnerForAPI';

Expand All @@ -34,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/core/internals/utils', () => ({
...jest.requireActual('@aws-amplify/core/internals/utils'),
parseAmplifyConfig: jest.fn(() => mockAmplifyConfig),
}));

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

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

Expand Down Expand Up @@ -77,7 +78,7 @@ describe('generateServerClient', () => {

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

// TODO: figure out proper mocks and unskip
Expand Down
17 changes: 12 additions & 5 deletions packages/adapter-nextjs/__tests__/createServerRunner.test.ts
Expand Up @@ -31,7 +31,7 @@ jest.mock(
describe('createServerRunner', () => {
let createServerRunner: any;

const mockParseAWSExports = jest.fn();
const mockParseAmplifyConfig = jest.fn();
const mockCreateAWSCredentialsAndIdentityIdProvider = jest.fn();
const mockCreateKeyValueStorageFromCookieStorageAdapter = jest.fn();
const mockCreateUserPoolsTokenProvider = jest.fn();
Expand All @@ -48,23 +48,23 @@ describe('createServerRunner', () => {
runWithAmplifyServerContext: mockRunWithAmplifyServerContextCore,
}));
jest.doMock('@aws-amplify/core/internals/utils', () => ({
parseAWSExports: mockParseAWSExports,
parseAmplifyConfig: mockParseAmplifyConfig,
}));

({ createServerRunner } = require('../src'));
});

afterEach(() => {
mockParseAWSExports.mockClear();
mockParseAmplifyConfig.mockClear();
mockCreateAWSCredentialsAndIdentityIdProvider.mockClear();
mockCreateKeyValueStorageFromCookieStorageAdapter.mockClear();
mockCreateUserPoolsTokenProvider.mockClear();
mockRunWithAmplifyServerContextCore.mockClear();
});

it('calls parseAWSExports when the config object is imported from amplify configuration file', () => {
it('calls parseAmplifyConfig when the config object is imported from amplify configuration file', () => {
createServerRunner({ config: { aws_project_region: 'us-west-2' } });
expect(mockParseAWSExports).toHaveBeenCalled();
expect(mockParseAmplifyConfig).toHaveBeenCalled();
});

it('returns runWithAmplifyServerContext function', () => {
Expand All @@ -85,6 +85,9 @@ describe('createServerRunner', () => {
},
},
};

mockParseAmplifyConfig.mockReturnValue(mockAmplifyConfigWithoutAuth);

const { runWithAmplifyServerContext } = createServerRunner({
config: mockAmplifyConfigWithoutAuth,
});
Expand All @@ -99,6 +102,10 @@ describe('createServerRunner', () => {
});

describe('when amplifyConfig.Auth is defined', () => {
beforeEach(() => {
mockParseAmplifyConfig.mockReturnValue(mockAmplifyConfig);
});

describe('when nextServerContext is null (opt-in unauthenticated role)', () => {
it('should create auth providers with sharedInMemoryStorage', () => {
const { runWithAmplifyServerContext } = createServerRunner({
Expand Down

This file was deleted.

5 changes: 3 additions & 2 deletions packages/adapter-nextjs/src/api/createServerRunnerForAPI.ts
Expand Up @@ -2,16 +2,17 @@
// SPDX-License-Identifier: Apache-2.0

import { ResourcesConfig } from '@aws-amplify/core';
import { parseAmplifyConfig } from '@aws-amplify/core/internals/utils';

import { createRunWithAmplifyServerContext, getAmplifyConfig } from '../utils';
import { createRunWithAmplifyServerContext } from '../utils';
import { NextServer } from '../types';

export const createServerRunnerForAPI = ({
config,
}: NextServer.CreateServerRunnerInput): NextServer.CreateServerRunnerOutput & {
resourcesConfig: ResourcesConfig;
} => {
const amplifyConfig = getAmplifyConfig(config);
const amplifyConfig = parseAmplifyConfig(config);

return {
runWithAmplifyServerContext: createRunWithAmplifyServerContext({
Expand Down
8 changes: 5 additions & 3 deletions packages/adapter-nextjs/src/api/generateServerClient.ts
Expand Up @@ -11,10 +11,12 @@ import {
V6ClientSSRCookies,
V6ClientSSRRequest,
} from '@aws-amplify/api-graphql';
import { GraphQLAuthMode } from '@aws-amplify/core/internals/utils';
import {
GraphQLAuthMode,
parseAmplifyConfig,
} from '@aws-amplify/core/internals/utils';

import { NextServer } from '../types';
import { getAmplifyConfig } from '../utils';

import { createServerRunnerForAPI } from './createServerRunnerForAPI';

Expand Down Expand Up @@ -98,7 +100,7 @@ export function generateServerClientUsingCookies<
export function generateServerClientUsingReqRes<
T extends Record<any, any> = never,
>({ config, authMode, authToken }: ReqClientParams): V6ClientSSRRequest<T> {
const amplifyConfig = getAmplifyConfig(config);
const amplifyConfig = parseAmplifyConfig(config);

return generateClient<T>({
config: amplifyConfig,
Expand Down
5 changes: 3 additions & 2 deletions packages/adapter-nextjs/src/createServerRunner.ts
Expand Up @@ -2,8 +2,9 @@
// SPDX-License-Identifier: Apache-2.0

import { ResourcesConfig } from 'aws-amplify';
import { parseAmplifyConfig } from '@aws-amplify/core/internals/utils';

import { createRunWithAmplifyServerContext, getAmplifyConfig } from './utils';
import { createRunWithAmplifyServerContext } from './utils';
import { NextServer } from './types';

/**
Expand All @@ -27,7 +28,7 @@ import { NextServer } from './types';
export const createServerRunner: NextServer.CreateServerRunner = ({
config,
}) => {
const amplifyConfig = getAmplifyConfig(config);
const amplifyConfig = parseAmplifyConfig(config);

return {
runWithAmplifyServerContext: createRunWithAmplifyServerContext({
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-nextjs/src/types/NextServer.ts
Expand Up @@ -4,7 +4,7 @@
import { GetServerSidePropsContext as NextGetServerSidePropsContext } from 'next';
import { NextRequest, NextResponse } from 'next/server.js';
import { cookies } from 'next/headers.js';
import { LegacyConfig } from 'aws-amplify/adapter-core';
import { AmplifyOutputs, LegacyConfig } from 'aws-amplify/adapter-core';
import { AmplifyServer } from '@aws-amplify/core/internals/adapter-core';
import { ResourcesConfig } from '@aws-amplify/core';

Expand Down Expand Up @@ -74,7 +74,7 @@ export declare namespace NextServer {
) => Promise<OperationResult>;

export interface CreateServerRunnerInput {
config: ResourcesConfig | LegacyConfig;
config: ResourcesConfig | LegacyConfig | AmplifyOutputs;
}

export interface CreateServerRunnerOutput {
Expand Down
13 changes: 0 additions & 13 deletions packages/adapter-nextjs/src/utils/getAmplifyConfig.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/adapter-nextjs/src/utils/index.ts
@@ -1,5 +1,4 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

export { getAmplifyConfig } from './getAmplifyConfig';
export { createRunWithAmplifyServerContext } from './createRunWithAmplifyServerContext';