Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into run-auth-lambdas-on-…
Browse files Browse the repository at this point in the history
…node-18
  • Loading branch information
sobolk committed Jul 26, 2023
2 parents 2d993bc + 7bc0b56 commit 2aed1c7
Show file tree
Hide file tree
Showing 99 changed files with 687 additions and 449 deletions.
8 changes: 8 additions & 0 deletions packages/amplify-app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.0.11](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-24)

**Note:** Version bump only for package @aws-amplify/amplify-app





## [5.0.10](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-20)

**Note:** Version bump only for package @aws-amplify/amplify-app
Expand Down
6 changes: 3 additions & 3 deletions packages/amplify-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-app",
"version": "5.0.10",
"version": "5.0.11",
"description": "Amplify CLI",
"repository": {
"type": "git",
Expand Down Expand Up @@ -28,8 +28,8 @@
"dependencies": {
"@aws-amplify/amplify-frontend-android": "3.5.5",
"@aws-amplify/amplify-frontend-flutter": "1.4.4",
"@aws-amplify/amplify-frontend-ios": "3.6.12",
"@aws-amplify/amplify-frontend-javascript": "3.9.10",
"@aws-amplify/amplify-frontend-ios": "3.6.13",
"@aws-amplify/amplify-frontend-javascript": "3.9.11",
"chalk": "^4.1.1",
"execa": "^5.1.1",
"fs-extra": "^8.1.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/amplify-appsync-simulator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.13.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-24)

**Note:** Version bump only for package @aws-amplify/amplify-appsync-simulator





# [2.13.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-20)


Expand Down
4 changes: 2 additions & 2 deletions packages/amplify-appsync-simulator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-appsync-simulator",
"version": "2.13.0",
"version": "2.13.1",
"description": "An AppSync Simulator to test AppSync API.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -30,7 +30,7 @@
"extract-api": "ts-node ../../scripts/extract-api.ts"
},
"dependencies": {
"@aws-amplify/amplify-cli-core": "4.2.0",
"@aws-amplify/amplify-cli-core": "4.2.1",
"@aws-amplify/amplify-prompts": "2.8.0",
"@graphql-tools/schema": "^8.3.1",
"@graphql-tools/utils": "^8.5.1",
Expand Down
8 changes: 8 additions & 0 deletions packages/amplify-category-analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.0.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-24)

**Note:** Version bump only for package @aws-amplify/amplify-category-analytics





## [5.0.12](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-20)

**Note:** Version bump only for package @aws-amplify/amplify-category-analytics
Expand Down
6 changes: 3 additions & 3 deletions packages/amplify-category-analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-analytics",
"version": "5.0.12",
"version": "5.0.13",
"description": "amplify-cli analytics plugin",
"repository": {
"type": "git",
Expand All @@ -25,8 +25,8 @@
"extract-api": "ts-node ../../scripts/extract-api.ts"
},
"dependencies": {
"@aws-amplify/amplify-cli-core": "4.2.0",
"@aws-amplify/amplify-environment-parameters": "1.7.0",
"@aws-amplify/amplify-cli-core": "4.2.1",
"@aws-amplify/amplify-environment-parameters": "1.7.1",
"@aws-amplify/amplify-prompts": "2.8.0",
"fs-extra": "^8.1.0",
"uuid": "^8.3.2"
Expand Down
8 changes: 8 additions & 0 deletions packages/amplify-category-auth/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.4.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-24)

**Note:** Version bump only for package @aws-amplify/amplify-category-auth





# [3.4.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-20)


Expand Down
11 changes: 5 additions & 6 deletions packages/amplify-category-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-auth",
"version": "3.4.0",
"version": "3.4.1",
"description": "amplify-cli authentication plugin",
"repository": {
"type": "git",
Expand Down Expand Up @@ -28,12 +28,12 @@
"extract-api": "ts-node ../../scripts/extract-api.ts"
},
"dependencies": {
"@aws-amplify/amplify-cli-core": "4.2.0",
"@aws-amplify/amplify-environment-parameters": "1.7.0",
"@aws-amplify/amplify-cli-core": "4.2.1",
"@aws-amplify/amplify-environment-parameters": "1.7.1",
"@aws-amplify/amplify-function-plugin-interface": "1.11.0",
"@aws-amplify/amplify-prompts": "2.8.0",
"@aws-amplify/amplify-util-import": "2.7.0",
"@aws-amplify/cli-extensibility-helper": "3.0.10",
"@aws-amplify/cli-extensibility-helper": "3.0.11",
"amplify-headless-interface": "1.17.4",
"amplify-util-headless-input": "1.9.13",
"aws-cdk-lib": "~2.80.0",
Expand All @@ -49,8 +49,7 @@
"mime-types": "^2.1.26",
"ora": "^4.0.3",
"promise-sequential": "^1.1.1",
"uuid": "^8.3.2",
"vm2": "^3.9.19"
"uuid": "^8.3.2"
},
"devDependencies": {
"@aws-sdk/client-cognito-identity-provider": "^3.303.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
FeatureFlags,
JSONUtilities,
pathManager,
runOverride,
stateManager,
Template,
writeCFNTemplate,
Expand All @@ -20,7 +21,6 @@ import * as cdk from 'aws-cdk-lib';
import * as fs from 'fs-extra';
import _ from 'lodash';
import * as path from 'path';
import * as vm from 'vm2';
import { AuthInputState } from '../auth-inputs-manager/auth-input-state';
import { CognitoCLIInputs } from '../service-walkthrough-types/awsCognito-user-input-types';
import { AuthTriggerConnection, AuthTriggerPermissions, CognitoStackOptions } from '../service-walkthrough-types/cognito-user-input-types';
Expand Down Expand Up @@ -109,26 +109,9 @@ export class AmplifyAuthTransform extends AmplifyCategoryTransform {
const overrideDir = path.join(backendDir, this._category, this.resourceName);
const isBuild = await buildOverrideDir(backendDir, overrideDir);
if (isBuild) {
const overrideCode: string = await fs.readFile(path.join(overrideDir, 'build', 'override.js'), 'utf-8').catch(() => {
formatter.list(['No override File Found', `To override ${this.resourceName} run amplify override auth`]);
return '';
});

const sandboxNode = new vm.NodeVM({
console: 'inherit',
timeout: 5000,
sandbox: {},
require: {
context: 'sandbox',
builtin: ['path'],
external: true,
},
});
const projectInfo = getProjectInfo();
try {
await sandboxNode
.run(overrideCode, path.join(overrideDir, 'build', 'override.js'))
.override(this._authTemplateObj as AmplifyAuthCognitoStack & AmplifyStackTemplate, projectInfo);
await runOverride(overrideDir, this._authTemplateObj, projectInfo);
} catch (err) {
throw new AmplifyError(
'InvalidOverrideError',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import {
CFNTemplateFormat,
JSONUtilities,
pathManager,
runOverride,
Template,
writeCFNTemplate,
} from '@aws-amplify/amplify-cli-core';
import { formatter } from '@aws-amplify/amplify-prompts';
import * as cdk from 'aws-cdk-lib';
import * as fs from 'fs-extra';
import * as path from 'path';
import * as vm from 'vm2';
import { AuthInputState } from '../auth-inputs-manager/auth-input-state';
import { CognitoCLIInputs } from '../service-walkthrough-types/awsCognito-user-input-types';
import { AmplifyUserPoolGroupStack, AmplifyUserPoolGroupStackOutputs } from './index';
Expand Down Expand Up @@ -186,20 +186,9 @@ export class AmplifyUserPoolGroupTransform extends AmplifyCategoryTransform {
const overrideDir = path.join(backendDir, this._category, this._resourceName);
const isBuild = await buildOverrideDir(backendDir, overrideDir);
if (isBuild) {
const overrideCode: string = await fs.readFile(path.join(overrideDir, 'build', 'override.js'), 'utf-8').catch(() => {
formatter.list(['No override File Found', `To override ${this._resourceName} run amplify override auth`]);
return '';
});
const sandboxNode = new vm.NodeVM({
console: 'inherit',
timeout: 5000,
sandbox: {},
});
const projectInfo = getProjectInfo();
try {
await sandboxNode
.run(overrideCode)
.override(this._userPoolGroupTemplateObj as AmplifyUserPoolGroupStack & AmplifyStackTemplate, projectInfo);
await runOverride(overrideDir, this._userPoolGroupTemplateObj, projectInfo);
} catch (err: $TSAny) {
throw new AmplifyError(
'InvalidOverrideError',
Expand Down
11 changes: 11 additions & 0 deletions packages/amplify-category-custom/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.1.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-24)


### Bug Fixes

* skip hooks if flag detected ([a58e13c](https://github.com/aws-amplify/amplify-cli/commit/a58e13c55fb7dfd9e4f4a945e96d429cbecd2f9a))





# [3.1.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-20)


Expand Down
4 changes: 2 additions & 2 deletions packages/amplify-category-custom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-custom",
"version": "3.1.0",
"version": "3.1.1",
"description": "amplify-cli custom resources plugin",
"repository": {
"type": "git",
Expand All @@ -26,7 +26,7 @@
"access": "public"
},
"dependencies": {
"@aws-amplify/amplify-cli-core": "4.2.0",
"@aws-amplify/amplify-cli-core": "4.2.1",
"@aws-amplify/amplify-prompts": "2.8.0",
"aws-cdk-lib": "~2.80.0",
"execa": "^5.1.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { $TSContext } from '@aws-amplify/amplify-cli-core';
import { $TSContext, AmplifyError } from '@aws-amplify/amplify-cli-core';
import execa from 'execa';
import { buildCustomResources } from '../../utils/build-custom-resources';

Expand Down Expand Up @@ -43,6 +43,7 @@ jest.mock('@aws-amplify/amplify-cli-core', () => ({
readJson: jest.fn(),
stringify: jest.fn(),
},
skipHooks: jest.fn().mockReturnValue(false),
}));

describe('build custom resources scenarios', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import * as path from 'path';
import { categoryName, TYPES_DIR_NAME, AMPLIFY_RESOURCES_TYPE_DEF_FILENAME } from './constants';
import { getAllResources } from './dependency-management-utils';
import { generateCloudFormationFromCDK } from './generate-cfn-from-cdk';
import { skipHooks } from '@aws-amplify/amplify-cli-core';

type ResourceMeta = ResourceTuple & {
service: string;
Expand Down Expand Up @@ -69,7 +70,11 @@ export const generateDependentResourcesType = async (): Promise<void> => {

const buildResource = async (resource: ResourceMeta): Promise<void> => {
const targetDir = path.resolve(path.join(pathManager.getBackendDirPath(), categoryName, resource.resourceName));

if (skipHooks()) {
throw new AmplifyError('DeploymentError', {
message: 'A flag to disable custom resources has been detected, please deploy from a different environment.',
}); // should rollback
}
// generate dynamic types for Amplify resources
await generateDependentResourcesType();

Expand Down
8 changes: 8 additions & 0 deletions packages/amplify-category-function/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.4.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-24)

**Note:** Version bump only for package @aws-amplify/amplify-category-function





# [5.4.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-20)


Expand Down
6 changes: 3 additions & 3 deletions packages/amplify-category-function/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-function",
"version": "5.4.0",
"version": "5.4.1",
"description": "amplify-cli function plugin",
"repository": {
"type": "git",
Expand All @@ -26,8 +26,8 @@
"access": "public"
},
"dependencies": {
"@aws-amplify/amplify-cli-core": "4.2.0",
"@aws-amplify/amplify-environment-parameters": "1.7.0",
"@aws-amplify/amplify-cli-core": "4.2.1",
"@aws-amplify/amplify-environment-parameters": "1.7.1",
"@aws-amplify/amplify-function-plugin-interface": "1.11.0",
"@aws-amplify/amplify-prompts": "2.8.0",
"archiver": "^5.3.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/amplify-category-geo/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.3.1](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-24)

**Note:** Version bump only for package @aws-amplify/amplify-category-geo





# [3.3.0](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-20)


Expand Down
4 changes: 2 additions & 2 deletions packages/amplify-category-geo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-geo",
"version": "3.3.0",
"version": "3.3.1",
"description": "Amplify CLI plugin to manage the Geo resources for the project",
"repository": {
"type": "git",
Expand All @@ -26,7 +26,7 @@
"access": "public"
},
"dependencies": {
"@aws-amplify/amplify-cli-core": "4.2.0",
"@aws-amplify/amplify-cli-core": "4.2.1",
"@aws-amplify/amplify-prompts": "2.8.0",
"ajv": "^6.12.6",
"amplify-headless-interface": "1.17.4",
Expand Down
8 changes: 8 additions & 0 deletions packages/amplify-category-hosting/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.5.14](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-24)

**Note:** Version bump only for package @aws-amplify/amplify-category-hosting





## [3.5.13](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/[email protected]...@aws-amplify/[email protected]) (2023-07-20)


Expand Down
4 changes: 2 additions & 2 deletions packages/amplify-category-hosting/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-amplify/amplify-category-hosting",
"version": "3.5.13",
"version": "3.5.14",
"description": "amplify-cli hosting plugin",
"repository": {
"type": "git",
Expand All @@ -21,7 +21,7 @@
"test": "jest --logHeapUsage --coverage"
},
"dependencies": {
"@aws-amplify/amplify-cli-core": "4.2.0",
"@aws-amplify/amplify-cli-core": "4.2.1",
"@aws-amplify/amplify-prompts": "2.8.0",
"chalk": "^4.1.1",
"fs-extra": "^8.1.0",
Expand Down
Loading

0 comments on commit 2aed1c7

Please sign in to comment.