From 931021183ba2d8357cc9ba704a30fb4054e33359 Mon Sep 17 00:00:00 2001 From: Jack Stevenson Date: Fri, 13 Oct 2023 09:13:21 +1100 Subject: [PATCH 01/21] fix(type-safe-api): use lambda region in both parts of function integration uri (#595) The region in the first part of a function invocation uri is also the region of the lambda function itself, rather than the api gateway rest api Fixes #594 --- .../src/construct/integrations/lambda.ts | 4 +- .../src/construct/spec/api-gateway-auth.ts | 4 +- .../type-safe-api/src/construct/spec/utils.ts | 9 +-- .../type-safe-rest-api.test.ts.snap | 59 +++++++++++++++++++ .../test/construct/type-safe-rest-api.test.ts | 30 +++++++++- 5 files changed, 94 insertions(+), 12 deletions(-) diff --git a/packages/type-safe-api/src/construct/integrations/lambda.ts b/packages/type-safe-api/src/construct/integrations/lambda.ts index 13dba66b9..11f4ebe85 100644 --- a/packages/type-safe-api/src/construct/integrations/lambda.ts +++ b/packages/type-safe-api/src/construct/integrations/lambda.ts @@ -24,11 +24,11 @@ export class LambdaIntegration extends Integration { /** * Render the lambda integration as a snippet of OpenAPI */ - public render(props: IntegrationRenderProps): ApiGatewayIntegration { + public render(_props: IntegrationRenderProps): ApiGatewayIntegration { return { type: "AWS_PROXY", httpMethod: "POST", - uri: functionInvocationUri(props.scope, this.lambdaFunction), + uri: functionInvocationUri(this.lambdaFunction), passthroughBehavior: "WHEN_NO_MATCH", }; } diff --git a/packages/type-safe-api/src/construct/spec/api-gateway-auth.ts b/packages/type-safe-api/src/construct/spec/api-gateway-auth.ts index 60402a406..d2940f960 100644 --- a/packages/type-safe-api/src/construct/spec/api-gateway-auth.ts +++ b/packages/type-safe-api/src/construct/spec/api-gateway-auth.ts @@ -179,7 +179,7 @@ const cognitoSecurityScheme = ( * @param authorizer custom authorizer */ const customSecurityScheme = ( - scope: Construct, + _scope: Construct, authorizer: CustomAuthorizer ): CustomSecurityScheme => { const singleHeaderMatch = authorizer.identitySource.match( @@ -205,7 +205,7 @@ const customSecurityScheme = ( "x-amazon-apigateway-authtype": authorizer.authorizationType, "x-amazon-apigateway-authorizer": { type: authorizer.type, - authorizerUri: functionInvocationUri(scope, authorizer.function), + authorizerUri: functionInvocationUri(authorizer.function), authorizerResultTtlInSeconds: authorizer.authorizerResultTtlInSeconds, identitySource: authorizer.identitySource, }, diff --git a/packages/type-safe-api/src/construct/spec/utils.ts b/packages/type-safe-api/src/construct/spec/utils.ts index b302f4470..e2342de10 100644 --- a/packages/type-safe-api/src/construct/spec/utils.ts +++ b/packages/type-safe-api/src/construct/spec/utils.ts @@ -2,17 +2,12 @@ SPDX-License-Identifier: Apache-2.0 */ import { Stack } from "aws-cdk-lib"; import { IFunction } from "aws-cdk-lib/aws-lambda"; -import { Construct } from "constructs"; /** * Generate the lambda function invocation uri for the given lambda within the given scope - * @param scope scope in which the lambda is deployed * @param lambdaFunction the lambda function to be invoked */ -export const functionInvocationUri = ( - scope: Construct, - lambdaFunction: IFunction -): string => { - const stack = Stack.of(scope); +export const functionInvocationUri = (lambdaFunction: IFunction): string => { + const stack = Stack.of(lambdaFunction); return `arn:${stack.partition}:apigateway:${stack.region}:lambda:path/2015-03-31/functions/${lambdaFunction.functionArn}/invocations`; }; diff --git a/packages/type-safe-api/test/construct/__snapshots__/type-safe-rest-api.test.ts.snap b/packages/type-safe-api/test/construct/__snapshots__/type-safe-rest-api.test.ts.snap index 6f59cb71a..85ceaa564 100644 --- a/packages/type-safe-api/test/construct/__snapshots__/type-safe-rest-api.test.ts.snap +++ b/packages/type-safe-api/test/construct/__snapshots__/type-safe-rest-api.test.ts.snap @@ -7045,6 +7045,65 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to } `; +exports[`Type Safe Rest Api Construct Unit Tests Should allow for lambdas in different regions 1`] = ` +{ + "components": { + "securitySchemes": {}, + }, + "info": { + "title": "Test API", + "version": "1.0.0", + }, + "openapi": "3.0.3", + "paths": { + "/test": { + "get": { + "operationId": "testOperation", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string", + }, + }, + "type": "object", + }, + }, + }, + "description": "Successful response", + "headers": {}, + }, + }, + "x-amazon-apigateway-integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": "arn:\${}:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:\${}:lambda:us-east-1:\${}:function:Test/invocations", + }, + }, + }, + }, + "x-amazon-apigateway-gateway-responses": { + "BAD_REQUEST_BODY": { + "responseTemplates": { + "application/json": "{"message": "$context.error.validationErrorString"}", + }, + "statusCode": 400, + }, + }, + "x-amazon-apigateway-request-validator": "all", + "x-amazon-apigateway-request-validators": { + "all": { + "validateRequestBody": true, + "validateRequestParameters": true, + }, + }, +} +`; + exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions for reused lambdas 1`] = ` { "Outputs": { diff --git a/packages/type-safe-api/test/construct/type-safe-rest-api.test.ts b/packages/type-safe-api/test/construct/type-safe-rest-api.test.ts index 31546111a..eb507b1e5 100644 --- a/packages/type-safe-api/test/construct/type-safe-rest-api.test.ts +++ b/packages/type-safe-api/test/construct/type-safe-rest-api.test.ts @@ -3,7 +3,7 @@ SPDX-License-Identifier: Apache-2.0 */ import * as fs from "fs"; import * as path from "path"; import { PDKNag } from "@aws/pdk-nag"; -import { Size, Stack } from "aws-cdk-lib"; +import { App, Size, Stack } from "aws-cdk-lib"; import { Template } from "aws-cdk-lib/assertions"; import { ApiKeySourceType, Cors } from "aws-cdk-lib/aws-apigateway"; import { UserPool } from "aws-cdk-lib/aws-cognito"; @@ -1234,4 +1234,32 @@ describe("Type Safe Rest Api Construct Unit Tests", () => { snapshotExtendedSpec(api); }); }); + + it("Should allow for lambdas in different regions", () => { + const app = new App(); + const usStack = new Stack(app, "USStack", { + env: { + region: "us-east-1", + }, + }); + const auStack = new Stack(app, "AUStack", { + env: { + region: "ap-southeast-2", + }, + }); + const func = Function.fromFunctionName(usStack, "Func", "Test"); + withTempSpec(sampleSpec, (specPath) => { + const api = new TypeSafeRestApi(auStack, "ApiTest", { + specPath, + operationLookup, + integrations: { + testOperation: { + integration: Integrations.lambda(func), + }, + }, + }); + + snapshotExtendedSpec(api); + }); + }); }); From 0eec5efc0c74f967dac9b70a6472a20208a42fef Mon Sep 17 00:00:00 2001 From: Jack Stevenson Date: Fri, 13 Oct 2023 09:16:24 +1100 Subject: [PATCH 02/21] fix(monorepo): ensure local venv is used for all subproject tasks (#587) The poetry env info command will print the parent environment if the VIRTUAL_ENV environment variale is already set to the parent environment. Ensure this gets reset for all subproject tasks to address issues where dependencies would appear to be missing during build. --- .../src/components/nx-configurator.ts | 23 ++++-- .../test/__snapshots__/monorepo.test.ts.snap | 26 +----- .../type-safe-api-project.test.ts.snap | 80 ++++--------------- 3 files changed, 35 insertions(+), 94 deletions(-) diff --git a/packages/monorepo/src/components/nx-configurator.ts b/packages/monorepo/src/components/nx-configurator.ts index 6c24c8ccf..71a4c376d 100644 --- a/packages/monorepo/src/components/nx-configurator.ts +++ b/packages/monorepo/src/components/nx-configurator.ts @@ -4,7 +4,7 @@ import * as path from "path"; import { Component, JsonFile, Project, Task } from "projen"; import { JavaProject } from "projen/lib/java"; import { NodePackageManager, NodeProject } from "projen/lib/javascript"; -import { PythonProject } from "projen/lib/python"; +import { Poetry, PythonProject } from "projen/lib/python"; import { NxProject } from "./nx-project"; import { NxWorkspace } from "./nx-workspace"; import { Nx } from "../nx-types"; @@ -136,19 +136,26 @@ export class NxConfigurator extends Component implements INxProjectCore { this.nx.affected.defaultBase = options?.defaultReleaseBranch ?? "mainline"; } - public patchPoetryInstall(project: PythonProject): void { - const installTask = project.tasks.tryFind("install"); - - if (installTask?.steps[0]?.exec !== "unset VIRTUAL_ENV") { - installTask?.env("VIRTUAL_ENV", ""); - installTask?.prependExec("unset VIRTUAL_ENV"); + public patchPoetryEnv(project: PythonProject): void { + // Since the root monorepo is a poetry project and sets the VIRTUAL_ENV, and poetry env info -p will print + // the virtual env set in the VIRTUAL_ENV variable if set, we need to unset it to ensure the local project's + // env is used. + if (ProjectUtils.isNamedInstanceOf(project.depsManager as any, Poetry)) { + project.tasks.addEnvironment( + "VIRTUAL_ENV", + "$(env -u VIRTUAL_ENV poetry env info -p || echo '')" + ); + project.tasks.addEnvironment( + "PATH", + "$(echo $(env -u VIRTUAL_ENV poetry env info -p || echo '')/bin:$PATH)" + ); } } public patchPythonProjects(projects: Project[]): void { projects.forEach((p) => { if (ProjectUtils.isNamedInstanceOf(p, PythonProject)) { - this.patchPoetryInstall(p); + this.patchPoetryEnv(p); } this.patchPythonProjects(p.subprojects); }); diff --git a/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap b/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap index bd2fea703..6a6546162 100644 --- a/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap +++ b/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap @@ -9006,8 +9006,8 @@ cython_debug/ "packages/consumer/.projen/tasks.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "env": { - "PATH": "$(echo $(poetry env info -p)/bin:$PATH)", - "VIRTUAL_ENV": "$(poetry env info -p)", + "PATH": "$(echo $(env -u VIRTUAL_ENV poetry env info -p || echo '')/bin:$PATH)", + "VIRTUAL_ENV": "$(env -u VIRTUAL_ENV poetry env info -p || echo '')", }, "tasks": { "build": { @@ -9041,14 +9041,8 @@ cython_debug/ }, "install": { "description": "Install and upgrade dependencies", - "env": { - "VIRTUAL_ENV": "", - }, "name": "install", "steps": [ - { - "exec": "unset VIRTUAL_ENV", - }, { "exec": "poetry update", }, @@ -9365,8 +9359,8 @@ cython_debug/ "packages/library/.projen/tasks.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "env": { - "PATH": "$(echo $(poetry env info -p)/bin:$PATH)", - "VIRTUAL_ENV": "$(poetry env info -p)", + "PATH": "$(echo $(env -u VIRTUAL_ENV poetry env info -p || echo '')/bin:$PATH)", + "VIRTUAL_ENV": "$(env -u VIRTUAL_ENV poetry env info -p || echo '')", }, "tasks": { "build": { @@ -9400,14 +9394,8 @@ cython_debug/ }, "install": { "description": "Install and upgrade dependencies", - "env": { - "VIRTUAL_ENV": "", - }, "name": "install", "steps": [ - { - "exec": "unset VIRTUAL_ENV", - }, { "exec": "poetry update", }, @@ -11818,14 +11806,8 @@ cython_debug/ }, "install": { "description": "Install and upgrade dependencies", - "env": { - "VIRTUAL_ENV": "", - }, "name": "install", "steps": [ - { - "exec": "unset VIRTUAL_ENV", - }, { "exec": "pip install --upgrade pip", }, diff --git a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap index f0a4b6955..06c4830ed 100644 --- a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap +++ b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap @@ -5956,8 +5956,8 @@ pyproject.toml "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "env": { "AWS_PDK_VERSION": "0.0.0", - "PATH": "$(echo $(poetry env info -p)/bin:$PATH)", - "VIRTUAL_ENV": "$(poetry env info -p)", + "PATH": "$(echo $(env -u VIRTUAL_ENV poetry env info -p || echo '')/bin:$PATH)", + "VIRTUAL_ENV": "$(env -u VIRTUAL_ENV poetry env info -p || echo '')", }, "tasks": { "build": { @@ -6002,14 +6002,8 @@ pyproject.toml }, "install": { "description": "Install and upgrade dependencies", - "env": { - "VIRTUAL_ENV": "", - }, "name": "install", "steps": [ - { - "exec": "unset VIRTUAL_ENV", - }, { "exec": "mkdir -p openapi_java_python_runtime && touch openapi_java_python_runtime/__init__.py", }, @@ -12033,8 +12027,8 @@ mocks "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "env": { "AWS_PDK_VERSION": "0.0.0", - "PATH": "$(echo $(poetry env info -p)/bin:$PATH)", - "VIRTUAL_ENV": "$(poetry env info -p)", + "PATH": "$(echo $(env -u VIRTUAL_ENV poetry env info -p || echo '')/bin:$PATH)", + "VIRTUAL_ENV": "$(env -u VIRTUAL_ENV poetry env info -p || echo '')", }, "tasks": { "build": { @@ -12082,14 +12076,8 @@ mocks }, "install": { "description": "Install and upgrade dependencies", - "env": { - "VIRTUAL_ENV": "", - }, "name": "install", "steps": [ - { - "exec": "unset VIRTUAL_ENV", - }, { "exec": "mkdir -p openapi_python_python_infra && touch openapi_python_python_infra/__init__.py", }, @@ -13075,8 +13063,8 @@ pyproject.toml "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "env": { "AWS_PDK_VERSION": "0.0.0", - "PATH": "$(echo $(poetry env info -p)/bin:$PATH)", - "VIRTUAL_ENV": "$(poetry env info -p)", + "PATH": "$(echo $(env -u VIRTUAL_ENV poetry env info -p || echo '')/bin:$PATH)", + "VIRTUAL_ENV": "$(env -u VIRTUAL_ENV poetry env info -p || echo '')", }, "tasks": { "build": { @@ -13121,14 +13109,8 @@ pyproject.toml }, "install": { "description": "Install and upgrade dependencies", - "env": { - "VIRTUAL_ENV": "", - }, "name": "install", "steps": [ - { - "exec": "unset VIRTUAL_ENV", - }, { "exec": "mkdir -p openapi_python_python_runtime && touch openapi_python_python_runtime/__init__.py", }, @@ -20783,8 +20765,8 @@ pyproject.toml "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "env": { "AWS_PDK_VERSION": "0.0.0", - "PATH": "$(echo $(poetry env info -p)/bin:$PATH)", - "VIRTUAL_ENV": "$(poetry env info -p)", + "PATH": "$(echo $(env -u VIRTUAL_ENV poetry env info -p || echo '')/bin:$PATH)", + "VIRTUAL_ENV": "$(env -u VIRTUAL_ENV poetry env info -p || echo '')", }, "tasks": { "build": { @@ -20829,14 +20811,8 @@ pyproject.toml }, "install": { "description": "Install and upgrade dependencies", - "env": { - "VIRTUAL_ENV": "", - }, "name": "install", "steps": [ - { - "exec": "unset VIRTUAL_ENV", - }, { "exec": "mkdir -p openapi_typescript_python_runtime && touch openapi_typescript_python_runtime/__init__.py", }, @@ -35370,8 +35346,8 @@ pyproject.toml "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "env": { "AWS_PDK_VERSION": "0.0.0", - "PATH": "$(echo $(poetry env info -p)/bin:$PATH)", - "VIRTUAL_ENV": "$(poetry env info -p)", + "PATH": "$(echo $(env -u VIRTUAL_ENV poetry env info -p || echo '')/bin:$PATH)", + "VIRTUAL_ENV": "$(env -u VIRTUAL_ENV poetry env info -p || echo '')", }, "tasks": { "build": { @@ -35416,14 +35392,8 @@ pyproject.toml }, "install": { "description": "Install and upgrade dependencies", - "env": { - "VIRTUAL_ENV": "", - }, "name": "install", "steps": [ - { - "exec": "unset VIRTUAL_ENV", - }, { "exec": "mkdir -p smithy_java_python_runtime && touch smithy_java_python_runtime/__init__.py", }, @@ -53590,8 +53560,8 @@ mocks "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "env": { "AWS_PDK_VERSION": "0.0.0", - "PATH": "$(echo $(poetry env info -p)/bin:$PATH)", - "VIRTUAL_ENV": "$(poetry env info -p)", + "PATH": "$(echo $(env -u VIRTUAL_ENV poetry env info -p || echo '')/bin:$PATH)", + "VIRTUAL_ENV": "$(env -u VIRTUAL_ENV poetry env info -p || echo '')", }, "tasks": { "build": { @@ -53639,14 +53609,8 @@ mocks }, "install": { "description": "Install and upgrade dependencies", - "env": { - "VIRTUAL_ENV": "", - }, "name": "install", "steps": [ - { - "exec": "unset VIRTUAL_ENV", - }, { "exec": "mkdir -p smithy_python_python_infra && touch smithy_python_python_infra/__init__.py", }, @@ -54632,8 +54596,8 @@ pyproject.toml "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "env": { "AWS_PDK_VERSION": "0.0.0", - "PATH": "$(echo $(poetry env info -p)/bin:$PATH)", - "VIRTUAL_ENV": "$(poetry env info -p)", + "PATH": "$(echo $(env -u VIRTUAL_ENV poetry env info -p || echo '')/bin:$PATH)", + "VIRTUAL_ENV": "$(env -u VIRTUAL_ENV poetry env info -p || echo '')", }, "tasks": { "build": { @@ -54678,14 +54642,8 @@ pyproject.toml }, "install": { "description": "Install and upgrade dependencies", - "env": { - "VIRTUAL_ENV": "", - }, "name": "install", "steps": [ - { - "exec": "unset VIRTUAL_ENV", - }, { "exec": "mkdir -p smithy_python_python_runtime && touch smithy_python_python_runtime/__init__.py", }, @@ -62526,8 +62484,8 @@ pyproject.toml "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "env": { "AWS_PDK_VERSION": "0.0.0", - "PATH": "$(echo $(poetry env info -p)/bin:$PATH)", - "VIRTUAL_ENV": "$(poetry env info -p)", + "PATH": "$(echo $(env -u VIRTUAL_ENV poetry env info -p || echo '')/bin:$PATH)", + "VIRTUAL_ENV": "$(env -u VIRTUAL_ENV poetry env info -p || echo '')", }, "tasks": { "build": { @@ -62572,14 +62530,8 @@ pyproject.toml }, "install": { "description": "Install and upgrade dependencies", - "env": { - "VIRTUAL_ENV": "", - }, "name": "install", "steps": [ - { - "exec": "unset VIRTUAL_ENV", - }, { "exec": "mkdir -p smithy_typescript_python_runtime && touch smithy_typescript_python_runtime/__init__.py", }, From 3b73debff1310be83333e52dd66646173969509b Mon Sep 17 00:00:00 2001 From: Jack Stevenson Date: Mon, 16 Oct 2023 12:24:15 +1100 Subject: [PATCH 03/21] feat(type-safe-api): enable snapstart for java handlers by default and optimise java interceptors (#597) Java handlers now have snapstart enabled by default to improve cold start times. Ensure logger, metrics and tracer perform as much initialisation as possible during the init phase which can therefore be saved from snapstart invocations. Fixes #572 --- .../templates/functions.handlebars | 6 +- .../templates/handlers.handlebars | 7 +- .../java/templates/handlers.mustache | 8 +- .../java/templates/interceptors.mustache | 11 +- .../templates/functions.handlebars | 3 +- .../templates/functions.handlebars | 5 +- .../src/construct/functions/index.ts | 3 + .../functions/snap-start-java-function.ts | 30 +++++ packages/type-safe-api/src/construct/index.ts | 1 + .../src/construct/integrations/lambda.ts | 8 +- .../java-cdk-infrastructure.test.ts.snap | 20 +++- .../java-lambda-handlers.test.ts.snap | 14 ++- .../__snapshots__/java.test.ts.snap | 110 ++++++++++++------ .../python-cdk-infrastructure.test.ts.snap | 5 +- ...typescript-cdk-infrastructure.test.ts.snap | 9 +- 15 files changed, 179 insertions(+), 61 deletions(-) create mode 100644 packages/type-safe-api/src/construct/functions/index.ts create mode 100644 packages/type-safe-api/src/construct/functions/snap-start-java-function.ts diff --git a/packages/type-safe-api/scripts/type-safe-api/generators/java-cdk-infrastructure/templates/functions.handlebars b/packages/type-safe-api/scripts/type-safe-api/generators/java-cdk-infrastructure/templates/functions.handlebars index ff6e799ec..7aa051830 100644 --- a/packages/type-safe-api/scripts/type-safe-api/generators/java-cdk-infrastructure/templates/functions.handlebars +++ b/packages/type-safe-api/scripts/type-safe-api/generators/java-cdk-infrastructure/templates/functions.handlebars @@ -15,12 +15,13 @@ import org.jetbrains.annotations.NotNull; import software.amazon.awscdk.services.lambda.Function; +import software.aws.pdk.type_safe_api.SnapStartFunction; import software.constructs.Construct; /** * Lambda function construct which points to the {{vendorExtensions.x-handler.language}} implementation of {{operationIdCamelCase}} */ -public class {{operationIdCamelCase}}Function extends Function { +public class {{operationIdCamelCase}}Function extends {{#startsWith vendorExtensions.x-handler.language 'java' ~}}SnapStart{{~/startsWith}}Function { public {{operationIdCamelCase}}Function(@NotNull Construct scope, @NotNull String id, @NotNull {{operationIdCamelCase}}FunctionProps props) { super(scope, id, props); } @@ -67,6 +68,7 @@ import software.amazon.awscdk.services.lambda.VersionOptions; import software.amazon.awscdk.services.logs.RetentionDays; import software.amazon.awscdk.services.sns.ITopic; import software.amazon.awscdk.services.sqs.IQueue; +import software.aws.pdk.type_safe_api.SnapStartFunctionProps; import java.io.BufferedReader; import java.io.IOException; @@ -77,7 +79,7 @@ import java.util.List; import java.util.Map; @lombok.Builder @lombok.Getter -public class {{operationIdCamelCase}}FunctionProps implements FunctionProps { +public class {{operationIdCamelCase}}FunctionProps implements {{#startsWith vendorExtensions.x-handler.language 'java' ~}}SnapStart{{~/startsWith}}FunctionProps { private static String infraProjectAbsolutePath; static { diff --git a/packages/type-safe-api/scripts/type-safe-api/generators/java-lambda-handlers/templates/handlers.handlebars b/packages/type-safe-api/scripts/type-safe-api/generators/java-lambda-handlers/templates/handlers.handlebars index 9ca92e6da..70370e911 100644 --- a/packages/type-safe-api/scripts/type-safe-api/generators/java-lambda-handlers/templates/handlers.handlebars +++ b/packages/type-safe-api/scripts/type-safe-api/generators/java-lambda-handlers/templates/handlers.handlebars @@ -31,13 +31,18 @@ import java.util.List; * The {{operationIdCamelCase}} class manages marshalling inputs and outputs. */ public class {{operationIdCamelCase}}Handler extends {{operationIdCamelCase}} { + /** + * Interceptors are initialised once during the lambda "init" phase + */ + private final List> interceptors = DefaultInterceptors.all(); + /** * Return the interceptors for this handler. * You can also use the @Interceptors annotation on the class to add interceptors */ @Override public List> getInterceptors() { - return DefaultInterceptors.all(); + return this.interceptors; } /** diff --git a/packages/type-safe-api/scripts/type-safe-api/generators/java/templates/handlers.mustache b/packages/type-safe-api/scripts/type-safe-api/generators/java/templates/handlers.mustache index a84e206b8..334ce391f 100644 --- a/packages/type-safe-api/scripts/type-safe-api/generators/java/templates/handlers.mustache +++ b/packages/type-safe-api/scripts/type-safe-api/generators/java/templates/handlers.mustache @@ -1023,6 +1023,11 @@ public abstract class {{operationIdCamelCase}} implements RequestHandler> annotationInterceptors = Handlers.getAnnotationInterceptors({{operationIdCamelCase}}.class); + /** * For more complex interceptors that require instantiation with parameters, you may override this method to * return a list of instantiated interceptors. For simple interceptors with no need for constructor arguments, @@ -1055,9 +1060,6 @@ public abstract class {{operationIdCamelCase}} implements RequestHandler> interceptors = new ArrayList<>(); interceptors.addAll(additionalInterceptors); - - List> annotationInterceptors = Handlers.getAnnotationInterceptors(this.getClass()); - interceptors.addAll(annotationInterceptors); interceptors.addAll(this.getInterceptors()); diff --git a/packages/type-safe-api/scripts/type-safe-api/generators/java/templates/interceptors.mustache b/packages/type-safe-api/scripts/type-safe-api/generators/java/templates/interceptors.mustache index 6151031d9..ed20ca6db 100644 --- a/packages/type-safe-api/scripts/type-safe-api/generators/java/templates/interceptors.mustache +++ b/packages/type-safe-api/scripts/type-safe-api/generators/java/templates/interceptors.mustache @@ -123,6 +123,7 @@ import software.amazon.lambda.powertools.logging.LoggingUtils; * See https://docs.powertools.aws.dev/lambda/java/latest/core/logging/ */ public class LoggingInterceptor implements Interceptor { + private Logger logger = LogManager.getLogger(LoggingInterceptor.class); /** * Return the instance of the logger from the interceptor context @@ -161,7 +162,6 @@ public class LoggingInterceptor implements Interceptor { LoggingUtils.appendKey("operationId", operationId); // Add the logger to the interceptor context - Logger logger = LogManager.getLogger(operationId); input.getInterceptorContext().put("logger", logger); Response response = input.getChain().next(input); @@ -202,6 +202,13 @@ import software.amazon.lambda.powertools.tracing.TracingUtils; */ public class TracingInterceptor implements Interceptor { + { + // Create a segment during the lambda init phase to ensure xray emitter + // is warmed up prior to invocation phase + AWSXRay.beginSubsegment("Tracing Interceptor - Init"); + AWSXRay.endSubsegment(); + } + private final boolean captureResponse; public TracingInterceptor(final boolean captureResponse) { @@ -284,6 +291,7 @@ import software.amazon.lambda.powertools.metrics.MetricsUtils; * See: https://docs.powertools.aws.dev/lambda/typescript/latest/core/metrics */ public class MetricsInterceptor implements Interceptor { + private MetricsLogger metrics = MetricsUtils.metricsLogger(); /** * Return the instance of the metrics logger from the interceptor context @@ -298,7 +306,6 @@ public class MetricsInterceptor implements Interceptor { @Override public Response handle(final ChainedRequestInput input) { - MetricsLogger metrics = MetricsUtils.metricsLogger(); metrics.putDimensions(DimensionSet.of("operationId", (String) input.getInterceptorContext().get("operationId"))); input.getInterceptorContext().put("metrics", metrics); diff --git a/packages/type-safe-api/scripts/type-safe-api/generators/python-cdk-infrastructure/templates/functions.handlebars b/packages/type-safe-api/scripts/type-safe-api/generators/python-cdk-infrastructure/templates/functions.handlebars index 4bb231297..a78f6e321 100644 --- a/packages/type-safe-api/scripts/type-safe-api/generators/python-cdk-infrastructure/templates/functions.handlebars +++ b/packages/type-safe-api/scripts/type-safe-api/generators/python-cdk-infrastructure/templates/functions.handlebars @@ -10,6 +10,7 @@ from aws_cdk.aws_lambda import ( Function, Runtime, Tracing, Code ) +from aws_pdk.type_safe_api import SnapStartFunction from os import path from pathlib import Path @@ -19,7 +20,7 @@ from pathlib import Path {{#operation ~}} {{#if vendorExtensions.x-handler}} -class {{operationIdCamelCase}}Function(Function): +class {{operationIdCamelCase}}Function({{#startsWith vendorExtensions.x-handler.language 'java' ~}}SnapStart{{~/startsWith}}Function): """ Lambda function construct which points to the {{vendorExtensions.x-handler.language}} implementation of {{operationIdCamelCase}} """ diff --git a/packages/type-safe-api/scripts/type-safe-api/generators/typescript-cdk-infrastructure/templates/functions.handlebars b/packages/type-safe-api/scripts/type-safe-api/generators/typescript-cdk-infrastructure/templates/functions.handlebars index 825ed10ba..bb9bca4d0 100644 --- a/packages/type-safe-api/scripts/type-safe-api/generators/typescript-cdk-infrastructure/templates/functions.handlebars +++ b/packages/type-safe-api/scripts/type-safe-api/generators/typescript-cdk-infrastructure/templates/functions.handlebars @@ -9,6 +9,7 @@ } ###/TSAPI_WRITE_FILE###import { Construct } from "constructs"; import { Duration } from "aws-cdk-lib"; +import { SnapStartFunction, SnapStartFunctionProps } from "@aws/pdk/type-safe-api"; import { Code, Function, Runtime, Tracing, FunctionProps } from "aws-cdk-lib/aws-lambda"; import * as path from "path"; {{#apiInfo ~}} @@ -20,12 +21,12 @@ import * as path from "path"; /** * Options for the {{operationIdCamelCase}}Function construct */ -export interface {{operationIdCamelCase}}FunctionProps extends Omit {} +export interface {{operationIdCamelCase}}FunctionProps extends Omit<{{#startsWith vendorExtensions.x-handler.language 'java' ~}}SnapStart{{~/startsWith}}FunctionProps, 'code' | 'handler' | 'runtime'> {} /** * Lambda function construct which points to the {{vendorExtensions.x-handler.language}} implementation of {{operationIdCamelCase}} */ -export class {{operationIdCamelCase}}Function extends Function { +export class {{operationIdCamelCase}}Function extends {{#startsWith vendorExtensions.x-handler.language 'java' ~}}SnapStart{{~/startsWith}}Function { constructor(scope: Construct, id: string, props?: {{operationIdCamelCase}}FunctionProps) { super(scope, id, { {{#startsWith vendorExtensions.x-handler.language 'typescript' ~}} diff --git a/packages/type-safe-api/src/construct/functions/index.ts b/packages/type-safe-api/src/construct/functions/index.ts new file mode 100644 index 000000000..d790a4590 --- /dev/null +++ b/packages/type-safe-api/src/construct/functions/index.ts @@ -0,0 +1,3 @@ +/*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 */ +export * from "./snap-start-java-function"; diff --git a/packages/type-safe-api/src/construct/functions/snap-start-java-function.ts b/packages/type-safe-api/src/construct/functions/snap-start-java-function.ts new file mode 100644 index 000000000..6d49b3751 --- /dev/null +++ b/packages/type-safe-api/src/construct/functions/snap-start-java-function.ts @@ -0,0 +1,30 @@ +/*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 */ +import { CfnFunction, Function, FunctionProps } from "aws-cdk-lib/aws-lambda"; +import { Construct } from "constructs"; + +/** + * Options for the SnapStartFunction construct + */ +export interface SnapStartFunctionProps extends FunctionProps { + /** + * When true, disable snap start + * @default false + */ + readonly disableSnapStart?: boolean; +} + +/** + * A lambda function which enables SnapStart on published versions by default + */ +export class SnapStartFunction extends Function { + constructor(scope: Construct, id: string, props: SnapStartFunctionProps) { + super(scope, id, props); + + if (!props.disableSnapStart) { + (this.node.defaultChild as CfnFunction).addPropertyOverride("SnapStart", { + ApplyOn: "PublishedVersions", + }); + } + } +} diff --git a/packages/type-safe-api/src/construct/index.ts b/packages/type-safe-api/src/construct/index.ts index cbd5f2902..bb4d2c50b 100644 --- a/packages/type-safe-api/src/construct/index.ts +++ b/packages/type-safe-api/src/construct/index.ts @@ -5,3 +5,4 @@ export * from "./waf/types"; export * from "./authorizers"; export * from "./integrations"; export * from "./spec"; +export * from "./functions"; diff --git a/packages/type-safe-api/src/construct/integrations/lambda.ts b/packages/type-safe-api/src/construct/integrations/lambda.ts index 11f4ebe85..837ee404c 100644 --- a/packages/type-safe-api/src/construct/integrations/lambda.ts +++ b/packages/type-safe-api/src/construct/integrations/lambda.ts @@ -8,6 +8,7 @@ import { IntegrationGrantProps, IntegrationRenderProps, } from "./integration"; +import { SnapStartFunction } from "../functions/snap-start-java-function"; import { functionInvocationUri } from "../spec/utils"; /** @@ -18,7 +19,12 @@ export class LambdaIntegration extends Integration { constructor(lambdaFunction: IFunction) { super(); - this.lambdaFunction = lambdaFunction; + // Snap Start applies only to versions, so if the function is a SnapStartFunction, we'll reference the current version + if (lambdaFunction instanceof SnapStartFunction) { + this.lambdaFunction = lambdaFunction.currentVersion; + } else { + this.lambdaFunction = lambdaFunction; + } } /** diff --git a/packages/type-safe-api/test/scripts/generators/__snapshots__/java-cdk-infrastructure.test.ts.snap b/packages/type-safe-api/test/scripts/generators/__snapshots__/java-cdk-infrastructure.test.ts.snap index 774f63ea5..1b9d46a7d 100644 --- a/packages/type-safe-api/test/scripts/generators/__snapshots__/java-cdk-infrastructure.test.ts.snap +++ b/packages/type-safe-api/test/scripts/generators/__snapshots__/java-cdk-infrastructure.test.ts.snap @@ -8,12 +8,13 @@ exports[`Java Infrastructure Code Generation Script Unit Tests Generates Functio import org.jetbrains.annotations.NotNull; import software.amazon.awscdk.services.lambda.Function; +import software.aws.pdk.type_safe_api.SnapStartFunction; import software.constructs.Construct; /** * Lambda function construct which points to the java implementation of JavaOne */ -public class JavaOneFunction extends Function { +public class JavaOneFunction extends SnapStartFunction { public JavaOneFunction(@NotNull Construct scope, @NotNull String id, @NotNull JavaOneFunctionProps props) { super(scope, id, props); } @@ -57,6 +58,7 @@ import software.amazon.awscdk.services.lambda.VersionOptions; import software.amazon.awscdk.services.logs.RetentionDays; import software.amazon.awscdk.services.sns.ITopic; import software.amazon.awscdk.services.sqs.IQueue; +import software.aws.pdk.type_safe_api.SnapStartFunctionProps; import java.io.BufferedReader; import java.io.IOException; @@ -67,7 +69,7 @@ import java.util.List; import java.util.Map; @lombok.Builder @lombok.Getter -public class JavaOneFunctionProps implements FunctionProps { +public class JavaOneFunctionProps implements SnapStartFunctionProps { private static String infraProjectAbsolutePath; static { @@ -144,12 +146,13 @@ public class JavaOneFunctionProps implements FunctionProps { import org.jetbrains.annotations.NotNull; import software.amazon.awscdk.services.lambda.Function; +import software.aws.pdk.type_safe_api.SnapStartFunction; import software.constructs.Construct; /** * Lambda function construct which points to the java implementation of JavaTwo */ -public class JavaTwoFunction extends Function { +public class JavaTwoFunction extends SnapStartFunction { public JavaTwoFunction(@NotNull Construct scope, @NotNull String id, @NotNull JavaTwoFunctionProps props) { super(scope, id, props); } @@ -193,6 +196,7 @@ import software.amazon.awscdk.services.lambda.VersionOptions; import software.amazon.awscdk.services.logs.RetentionDays; import software.amazon.awscdk.services.sns.ITopic; import software.amazon.awscdk.services.sqs.IQueue; +import software.aws.pdk.type_safe_api.SnapStartFunctionProps; import java.io.BufferedReader; import java.io.IOException; @@ -203,7 +207,7 @@ import java.util.List; import java.util.Map; @lombok.Builder @lombok.Getter -public class JavaTwoFunctionProps implements FunctionProps { +public class JavaTwoFunctionProps implements SnapStartFunctionProps { private static String infraProjectAbsolutePath; static { @@ -280,6 +284,7 @@ public class JavaTwoFunctionProps implements FunctionProps { import org.jetbrains.annotations.NotNull; import software.amazon.awscdk.services.lambda.Function; +import software.aws.pdk.type_safe_api.SnapStartFunction; import software.constructs.Construct; /** @@ -329,6 +334,7 @@ import software.amazon.awscdk.services.lambda.VersionOptions; import software.amazon.awscdk.services.logs.RetentionDays; import software.amazon.awscdk.services.sns.ITopic; import software.amazon.awscdk.services.sqs.IQueue; +import software.aws.pdk.type_safe_api.SnapStartFunctionProps; import java.io.BufferedReader; import java.io.IOException; @@ -416,6 +422,7 @@ public class PythonOneFunctionProps implements FunctionProps { import org.jetbrains.annotations.NotNull; import software.amazon.awscdk.services.lambda.Function; +import software.aws.pdk.type_safe_api.SnapStartFunction; import software.constructs.Construct; /** @@ -465,6 +472,7 @@ import software.amazon.awscdk.services.lambda.VersionOptions; import software.amazon.awscdk.services.logs.RetentionDays; import software.amazon.awscdk.services.sns.ITopic; import software.amazon.awscdk.services.sqs.IQueue; +import software.aws.pdk.type_safe_api.SnapStartFunctionProps; import java.io.BufferedReader; import java.io.IOException; @@ -552,6 +560,7 @@ public class PythonTwoFunctionProps implements FunctionProps { import org.jetbrains.annotations.NotNull; import software.amazon.awscdk.services.lambda.Function; +import software.aws.pdk.type_safe_api.SnapStartFunction; import software.constructs.Construct; /** @@ -601,6 +610,7 @@ import software.amazon.awscdk.services.lambda.VersionOptions; import software.amazon.awscdk.services.logs.RetentionDays; import software.amazon.awscdk.services.sns.ITopic; import software.amazon.awscdk.services.sqs.IQueue; +import software.aws.pdk.type_safe_api.SnapStartFunctionProps; import java.io.BufferedReader; import java.io.IOException; @@ -688,6 +698,7 @@ public class TypescriptOneFunctionProps implements FunctionProps { import org.jetbrains.annotations.NotNull; import software.amazon.awscdk.services.lambda.Function; +import software.aws.pdk.type_safe_api.SnapStartFunction; import software.constructs.Construct; /** @@ -737,6 +748,7 @@ import software.amazon.awscdk.services.lambda.VersionOptions; import software.amazon.awscdk.services.logs.RetentionDays; import software.amazon.awscdk.services.sns.ITopic; import software.amazon.awscdk.services.sqs.IQueue; +import software.aws.pdk.type_safe_api.SnapStartFunctionProps; import java.io.BufferedReader; import java.io.IOException; diff --git a/packages/type-safe-api/test/scripts/generators/__snapshots__/java-lambda-handlers.test.ts.snap b/packages/type-safe-api/test/scripts/generators/__snapshots__/java-lambda-handlers.test.ts.snap index 64d2d5b1f..3666e375a 100644 --- a/packages/type-safe-api/test/scripts/generators/__snapshots__/java-lambda-handlers.test.ts.snap +++ b/packages/type-safe-api/test/scripts/generators/__snapshots__/java-lambda-handlers.test.ts.snap @@ -20,13 +20,18 @@ import java.util.List; * The JavaOne class manages marshalling inputs and outputs. */ public class JavaOneHandler extends JavaOne { + /** + * Interceptors are initialised once during the lambda "init" phase + */ + private final List> interceptors = DefaultInterceptors.all(); + /** * Return the interceptors for this handler. * You can also use the @Interceptors annotation on the class to add interceptors */ @Override public List> getInterceptors() { - return DefaultInterceptors.all(); + return this.interceptors; } /** @@ -68,13 +73,18 @@ import java.util.List; * The JavaTwo class manages marshalling inputs and outputs. */ public class JavaTwoHandler extends JavaTwo { + /** + * Interceptors are initialised once during the lambda "init" phase + */ + private final List> interceptors = DefaultInterceptors.all(); + /** * Return the interceptors for this handler. * You can also use the @Interceptors annotation on the class to add interceptors */ @Override public List> getInterceptors() { - return DefaultInterceptors.all(); + return this.interceptors; } /** diff --git a/packages/type-safe-api/test/scripts/generators/__snapshots__/java.test.ts.snap b/packages/type-safe-api/test/scripts/generators/__snapshots__/java.test.ts.snap index 43f2f97e8..cd138506c 100644 --- a/packages/type-safe-api/test/scripts/generators/__snapshots__/java.test.ts.snap +++ b/packages/type-safe-api/test/scripts/generators/__snapshots__/java.test.ts.snap @@ -4824,6 +4824,11 @@ public abstract class Both implements RequestHandler> annotationInterceptors = Handlers.getAnnotationInterceptors(Both.class); + /** * For more complex interceptors that require instantiation with parameters, you may override this method to * return a list of instantiated interceptors. For simple interceptors with no need for constructor arguments, @@ -4849,9 +4854,6 @@ public abstract class Both implements RequestHandler> interceptors = new ArrayList<>(); interceptors.addAll(additionalInterceptors); - - List> annotationInterceptors = Handlers.getAnnotationInterceptors(this.getClass()); - interceptors.addAll(annotationInterceptors); interceptors.addAll(this.getInterceptors()); @@ -5144,6 +5146,11 @@ public abstract class Neither implements RequestHandler> annotationInterceptors = Handlers.getAnnotationInterceptors(Neither.class); + /** * For more complex interceptors that require instantiation with parameters, you may override this method to * return a list of instantiated interceptors. For simple interceptors with no need for constructor arguments, @@ -5169,9 +5176,6 @@ public abstract class Neither implements RequestHandler> interceptors = new ArrayList<>(); interceptors.addAll(additionalInterceptors); - - List> annotationInterceptors = Handlers.getAnnotationInterceptors(this.getClass()); - interceptors.addAll(annotationInterceptors); interceptors.addAll(this.getInterceptors()); @@ -5464,6 +5468,11 @@ public abstract class Tag1 implements RequestHandler> annotationInterceptors = Handlers.getAnnotationInterceptors(Tag1.class); + /** * For more complex interceptors that require instantiation with parameters, you may override this method to * return a list of instantiated interceptors. For simple interceptors with no need for constructor arguments, @@ -5489,9 +5498,6 @@ public abstract class Tag1 implements RequestHandler> interceptors = new ArrayList<>(); interceptors.addAll(additionalInterceptors); - - List> annotationInterceptors = Handlers.getAnnotationInterceptors(this.getClass()); - interceptors.addAll(annotationInterceptors); interceptors.addAll(this.getInterceptors()); @@ -5784,6 +5790,11 @@ public abstract class Tag2 implements RequestHandler> annotationInterceptors = Handlers.getAnnotationInterceptors(Tag2.class); + /** * For more complex interceptors that require instantiation with parameters, you may override this method to * return a list of instantiated interceptors. For simple interceptors with no need for constructor arguments, @@ -5809,9 +5820,6 @@ public abstract class Tag2 implements RequestHandler> interceptors = new ArrayList<>(); interceptors.addAll(additionalInterceptors); - - List> annotationInterceptors = Handlers.getAnnotationInterceptors(this.getClass()); - interceptors.addAll(annotationInterceptors); interceptors.addAll(this.getInterceptors()); @@ -6199,6 +6207,7 @@ import software.amazon.lambda.powertools.logging.LoggingUtils; * See https://docs.powertools.aws.dev/lambda/java/latest/core/logging/ */ public class LoggingInterceptor implements Interceptor { + private Logger logger = LogManager.getLogger(LoggingInterceptor.class); /** * Return the instance of the logger from the interceptor context @@ -6237,7 +6246,6 @@ public class LoggingInterceptor implements Interceptor { LoggingUtils.appendKey("operationId", operationId); // Add the logger to the interceptor context - Logger logger = LogManager.getLogger(operationId); input.getInterceptorContext().put("logger", logger); Response response = input.getChain().next(input); @@ -6269,6 +6277,7 @@ import software.amazon.lambda.powertools.metrics.MetricsUtils; * See: https://docs.powertools.aws.dev/lambda/typescript/latest/core/metrics */ public class MetricsInterceptor implements Interceptor { + private MetricsLogger metrics = MetricsUtils.metricsLogger(); /** * Return the instance of the metrics logger from the interceptor context @@ -6283,7 +6292,6 @@ public class MetricsInterceptor implements Interceptor { @Override public Response handle(final ChainedRequestInput input) { - MetricsLogger metrics = MetricsUtils.metricsLogger(); metrics.putDimensions(DimensionSet.of("operationId", (String) input.getInterceptorContext().get("operationId"))); input.getInterceptorContext().put("metrics", metrics); @@ -6326,6 +6334,13 @@ import software.amazon.lambda.powertools.tracing.TracingUtils; */ public class TracingInterceptor implements Interceptor { + { + // Create a segment during the lambda init phase to ensure xray emitter + // is warmed up prior to invocation phase + AWSXRay.beginSubsegment("Tracing Interceptor - Init"); + AWSXRay.endSubsegment(); + } + private final boolean captureResponse; public TracingInterceptor(final boolean captureResponse) { @@ -12683,6 +12698,11 @@ public abstract class AnyRequestResponse implements RequestHandler> annotationInterceptors = Handlers.getAnnotationInterceptors(AnyRequestResponse.class); + /** * For more complex interceptors that require instantiation with parameters, you may override this method to * return a list of instantiated interceptors. For simple interceptors with no need for constructor arguments, @@ -12708,9 +12728,6 @@ public abstract class AnyRequestResponse implements RequestHandler> interceptors = new ArrayList<>(); interceptors.addAll(additionalInterceptors); - - List> annotationInterceptors = Handlers.getAnnotationInterceptors(this.getClass()); - interceptors.addAll(annotationInterceptors); interceptors.addAll(this.getInterceptors()); @@ -13011,6 +13028,11 @@ public abstract class Empty implements RequestHandler> annotationInterceptors = Handlers.getAnnotationInterceptors(Empty.class); + /** * For more complex interceptors that require instantiation with parameters, you may override this method to * return a list of instantiated interceptors. For simple interceptors with no need for constructor arguments, @@ -13036,9 +13058,6 @@ public abstract class Empty implements RequestHandler> interceptors = new ArrayList<>(); interceptors.addAll(additionalInterceptors); - - List> annotationInterceptors = Handlers.getAnnotationInterceptors(this.getClass()); - interceptors.addAll(annotationInterceptors); interceptors.addAll(this.getInterceptors()); @@ -13331,6 +13350,11 @@ public abstract class MapResponse implements RequestHandler> annotationInterceptors = Handlers.getAnnotationInterceptors(MapResponse.class); + /** * For more complex interceptors that require instantiation with parameters, you may override this method to * return a list of instantiated interceptors. For simple interceptors with no need for constructor arguments, @@ -13356,9 +13380,6 @@ public abstract class MapResponse implements RequestHandler> interceptors = new ArrayList<>(); interceptors.addAll(additionalInterceptors); - - List> annotationInterceptors = Handlers.getAnnotationInterceptors(this.getClass()); - interceptors.addAll(annotationInterceptors); interceptors.addAll(this.getInterceptors()); @@ -13654,6 +13675,11 @@ public abstract class MediaTypes implements RequestHandler> annotationInterceptors = Handlers.getAnnotationInterceptors(MediaTypes.class); + /** * For more complex interceptors that require instantiation with parameters, you may override this method to * return a list of instantiated interceptors. For simple interceptors with no need for constructor arguments, @@ -13679,9 +13705,6 @@ public abstract class MediaTypes implements RequestHandler> interceptors = new ArrayList<>(); interceptors.addAll(additionalInterceptors); - - List> annotationInterceptors = Handlers.getAnnotationInterceptors(this.getClass()); - interceptors.addAll(annotationInterceptors); interceptors.addAll(this.getInterceptors()); @@ -13982,6 +14005,11 @@ public abstract class MultipleContentTypes implements RequestHandler> annotationInterceptors = Handlers.getAnnotationInterceptors(MultipleContentTypes.class); + /** * For more complex interceptors that require instantiation with parameters, you may override this method to * return a list of instantiated interceptors. For simple interceptors with no need for constructor arguments, @@ -14007,9 +14035,6 @@ public abstract class MultipleContentTypes implements RequestHandler> interceptors = new ArrayList<>(); interceptors.addAll(additionalInterceptors); - - List> annotationInterceptors = Handlers.getAnnotationInterceptors(this.getClass()); - interceptors.addAll(annotationInterceptors); interceptors.addAll(this.getInterceptors()); @@ -14314,6 +14339,11 @@ public abstract class OperationOne implements RequestHandler> annotationInterceptors = Handlers.getAnnotationInterceptors(OperationOne.class); + /** * For more complex interceptors that require instantiation with parameters, you may override this method to * return a list of instantiated interceptors. For simple interceptors with no need for constructor arguments, @@ -14342,9 +14372,6 @@ public abstract class OperationOne implements RequestHandler> interceptors = new ArrayList<>(); interceptors.addAll(additionalInterceptors); - - List> annotationInterceptors = Handlers.getAnnotationInterceptors(this.getClass()); - interceptors.addAll(annotationInterceptors); interceptors.addAll(this.getInterceptors()); @@ -14746,6 +14773,11 @@ public abstract class WithoutOperationIdDelete implements RequestHandler> annotationInterceptors = Handlers.getAnnotationInterceptors(WithoutOperationIdDelete.class); + /** * For more complex interceptors that require instantiation with parameters, you may override this method to * return a list of instantiated interceptors. For simple interceptors with no need for constructor arguments, @@ -14771,9 +14803,6 @@ public abstract class WithoutOperationIdDelete implements RequestHandler> interceptors = new ArrayList<>(); interceptors.addAll(additionalInterceptors); - - List> annotationInterceptors = Handlers.getAnnotationInterceptors(this.getClass()); - interceptors.addAll(annotationInterceptors); interceptors.addAll(this.getInterceptors()); @@ -15164,6 +15193,7 @@ import software.amazon.lambda.powertools.logging.LoggingUtils; * See https://docs.powertools.aws.dev/lambda/java/latest/core/logging/ */ public class LoggingInterceptor implements Interceptor { + private Logger logger = LogManager.getLogger(LoggingInterceptor.class); /** * Return the instance of the logger from the interceptor context @@ -15202,7 +15232,6 @@ public class LoggingInterceptor implements Interceptor { LoggingUtils.appendKey("operationId", operationId); // Add the logger to the interceptor context - Logger logger = LogManager.getLogger(operationId); input.getInterceptorContext().put("logger", logger); Response response = input.getChain().next(input); @@ -15234,6 +15263,7 @@ import software.amazon.lambda.powertools.metrics.MetricsUtils; * See: https://docs.powertools.aws.dev/lambda/typescript/latest/core/metrics */ public class MetricsInterceptor implements Interceptor { + private MetricsLogger metrics = MetricsUtils.metricsLogger(); /** * Return the instance of the metrics logger from the interceptor context @@ -15248,7 +15278,6 @@ public class MetricsInterceptor implements Interceptor { @Override public Response handle(final ChainedRequestInput input) { - MetricsLogger metrics = MetricsUtils.metricsLogger(); metrics.putDimensions(DimensionSet.of("operationId", (String) input.getInterceptorContext().get("operationId"))); input.getInterceptorContext().put("metrics", metrics); @@ -15291,6 +15320,13 @@ import software.amazon.lambda.powertools.tracing.TracingUtils; */ public class TracingInterceptor implements Interceptor { + { + // Create a segment during the lambda init phase to ensure xray emitter + // is warmed up prior to invocation phase + AWSXRay.beginSubsegment("Tracing Interceptor - Init"); + AWSXRay.endSubsegment(); + } + private final boolean captureResponse; public TracingInterceptor(final boolean captureResponse) { diff --git a/packages/type-safe-api/test/scripts/generators/__snapshots__/python-cdk-infrastructure.test.ts.snap b/packages/type-safe-api/test/scripts/generators/__snapshots__/python-cdk-infrastructure.test.ts.snap index 71e23f76a..d034b31a9 100644 --- a/packages/type-safe-api/test/scripts/generators/__snapshots__/python-cdk-infrastructure.test.ts.snap +++ b/packages/type-safe-api/test/scripts/generators/__snapshots__/python-cdk-infrastructure.test.ts.snap @@ -5,12 +5,13 @@ exports[`Python Infrastructure Code Generation Script Unit Tests Generates Funct from aws_cdk.aws_lambda import ( Function, Runtime, Tracing, Code ) +from aws_pdk.type_safe_api import SnapStartFunction from os import path from pathlib import Path -class JavaOneFunction(Function): +class JavaOneFunction(SnapStartFunction): """ Lambda function construct which points to the java implementation of JavaOne """ @@ -26,7 +27,7 @@ class JavaOneFunction(Function): **kwargs, ) -class JavaTwoFunction(Function): +class JavaTwoFunction(SnapStartFunction): """ Lambda function construct which points to the java implementation of JavaTwo """ diff --git a/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript-cdk-infrastructure.test.ts.snap b/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript-cdk-infrastructure.test.ts.snap index 70649a03f..d3ed2cad5 100644 --- a/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript-cdk-infrastructure.test.ts.snap +++ b/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript-cdk-infrastructure.test.ts.snap @@ -3,6 +3,7 @@ exports[`Typescript Infrastructure Code Generation Script Unit Tests Generates Functions 1`] = ` "import { Construct } from "constructs"; import { Duration } from "aws-cdk-lib"; +import { SnapStartFunction, SnapStartFunctionProps } from "@aws/pdk/type-safe-api"; import { Code, Function, Runtime, Tracing, FunctionProps } from "aws-cdk-lib/aws-lambda"; import * as path from "path"; @@ -10,12 +11,12 @@ import * as path from "path"; /** * Options for the JavaOneFunction construct */ -export interface JavaOneFunctionProps extends Omit {} +export interface JavaOneFunctionProps extends Omit {} /** * Lambda function construct which points to the java implementation of JavaOne */ -export class JavaOneFunction extends Function { +export class JavaOneFunction extends SnapStartFunction { constructor(scope: Construct, id: string, props?: JavaOneFunctionProps) { super(scope, id, { runtime: Runtime.JAVA_17, @@ -33,12 +34,12 @@ export class JavaOneFunction extends Function { /** * Options for the JavaTwoFunction construct */ -export interface JavaTwoFunctionProps extends Omit {} +export interface JavaTwoFunctionProps extends Omit {} /** * Lambda function construct which points to the java implementation of JavaTwo */ -export class JavaTwoFunction extends Function { +export class JavaTwoFunction extends SnapStartFunction { constructor(scope: Construct, id: string, props?: JavaTwoFunctionProps) { super(scope, id, { runtime: Runtime.JAVA_17, From 51b68a934fd16935781b8c1c0568cf8f03bdb5f2 Mon Sep 17 00:00:00 2001 From: Jack Stevenson Date: Mon, 16 Oct 2023 12:24:44 +1100 Subject: [PATCH 04/21] fix(type-safe-api): mock data generation for recursive references (#596) The mock data generation library we were using previously stackoverflowed when recursive references were used (which is perfectly valid in openapi). We replace this library with our own implementation, which additionally better conforms to the spec by taking into account min/max/pattern etc constraints. Fixes #545 --- packages/pdk/.projen/deps.json | 20 ++ packages/pdk/package.json | 4 + packages/type-safe-api/.projen/deps.json | 20 ++ packages/type-safe-api/package.json | 4 + .../scripts/type-safe-api/common/common.sh | 3 +- .../custom/mock-data/generate-mock-data | 17 +- .../custom/mock-data/generate-mock-data.ts | 296 ++++++++++++++++++ .../src/project/codegen/components/utils.ts | 3 +- packages/type-safe-api/src/project/types.ts | 5 + .../test/resources/specs/data-types.yaml | 102 ++++++ .../resources/specs/recursive-required.yaml | 30 ++ .../test/resources/specs/recursive.yaml | 25 ++ .../generate-mock-data.test.ts.snap | 96 ++++-- .../mock-data/generate-mock-data.test.ts | 39 +++ pnpm-lock.yaml | 221 ++++++++++++- projenrc/projects/type-safe-api-project.ts | 4 + 16 files changed, 859 insertions(+), 30 deletions(-) create mode 100644 packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data.ts create mode 100644 packages/type-safe-api/test/resources/specs/data-types.yaml create mode 100644 packages/type-safe-api/test/resources/specs/recursive-required.yaml create mode 100644 packages/type-safe-api/test/resources/specs/recursive.yaml diff --git a/packages/pdk/.projen/deps.json b/packages/pdk/.projen/deps.json index 1d19a3962..cf74efb6d 100644 --- a/packages/pdk/.projen/deps.json +++ b/packages/pdk/.projen/deps.json @@ -1,5 +1,10 @@ { "dependencies": [ + { + "name": "@apidevtools/swagger-parser", + "version": "10.1.0", + "type": "build" + }, { "name": "@aws-cdk/assert", "type": "build" @@ -16,6 +21,11 @@ "name": "@aws-sdk/client-s3", "type": "build" }, + { + "name": "@faker-js/faker", + "version": "8.1.0", + "type": "build" + }, { "name": "@nx/devkit", "type": "build" @@ -252,6 +262,11 @@ "name": "projen", "type": "build" }, + { + "name": "reregexp", + "version": "1.6.1", + "type": "build" + }, { "name": "sharp", "type": "build" @@ -260,6 +275,11 @@ "name": "tree-cli", "type": "build" }, + { + "name": "ts-command-line-args", + "version": "2.4.2", + "type": "build" + }, { "name": "ts-jest", "type": "build" diff --git a/packages/pdk/package.json b/packages/pdk/package.json index 859d822bc..6dd0d2e73 100644 --- a/packages/pdk/package.json +++ b/packages/pdk/package.json @@ -39,10 +39,12 @@ "organization": false }, "devDependencies": { + "@apidevtools/swagger-parser": "10.1.0", "@aws-cdk/assert": "^2.68.0", "@aws-cdk/aws-cognito-identitypool-alpha": "^2.93.0-alpha.0", "@aws-cdk/cfnspec": "^2.72.1", "@aws-sdk/client-s3": "^3.400.0", + "@faker-js/faker": "8.1.0", "@nx/devkit": "^16", "@types/fs-extra": "^11.0.1", "@types/he": "^1.2.0", @@ -100,8 +102,10 @@ "prebuild-install": "^7.1.1", "prettier": "^2.8.8", "projen": "^0.73", + "reregexp": "1.6.1", "sharp": "^0.32.5", "tree-cli": "^0.6.7", + "ts-command-line-args": "2.4.2", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", "typescript": "^5.2.2", diff --git a/packages/type-safe-api/.projen/deps.json b/packages/type-safe-api/.projen/deps.json index 0d6f20ccd..7b1bdcd90 100644 --- a/packages/type-safe-api/.projen/deps.json +++ b/packages/type-safe-api/.projen/deps.json @@ -1,5 +1,10 @@ { "dependencies": [ + { + "name": "@apidevtools/swagger-parser", + "version": "10.1.0", + "type": "build" + }, { "name": "@aws-sdk/client-s3", "type": "build" @@ -9,6 +14,11 @@ "version": "^0.x", "type": "build" }, + { + "name": "@faker-js/faker", + "version": "8.1.0", + "type": "build" + }, { "name": "@types/fs-extra", "type": "build" @@ -114,6 +124,16 @@ "name": "projen", "type": "build" }, + { + "name": "reregexp", + "version": "1.6.1", + "type": "build" + }, + { + "name": "ts-command-line-args", + "version": "2.4.2", + "type": "build" + }, { "name": "ts-jest", "type": "build" diff --git a/packages/type-safe-api/package.json b/packages/type-safe-api/package.json index 901ff6007..ab2d49acd 100644 --- a/packages/type-safe-api/package.json +++ b/packages/type-safe-api/package.json @@ -37,8 +37,10 @@ "organization": false }, "devDependencies": { + "@apidevtools/swagger-parser": "10.1.0", "@aws-sdk/client-s3": "^3.400.0", "@aws/monorepo": "^0.x", + "@faker-js/faker": "8.1.0", "@types/fs-extra": "^11.0.1", "@types/jest": "^29.5.4", "@types/lodash": "^4.14.197", @@ -64,6 +66,8 @@ "jsii-rosetta": "^1.88.0", "prettier": "^2.8.8", "projen": "^0.73", + "reregexp": "1.6.1", + "ts-command-line-args": "2.4.2", "ts-jest": "^29.1.1", "typescript": "^5.2.2" }, diff --git a/packages/type-safe-api/scripts/type-safe-api/common/common.sh b/packages/type-safe-api/scripts/type-safe-api/common/common.sh index 03e392845..5f5d24ee6 100755 --- a/packages/type-safe-api/scripts/type-safe-api/common/common.sh +++ b/packages/type-safe-api/scripts/type-safe-api/common/common.sh @@ -30,7 +30,8 @@ install_packages() { ts-node@10.9.1 \ ts-command-line-args@2.4.2 \ @redocly/cli@1.0.0-beta.126 \ - @7nohe/openapi-mock-json-generator@0.1.1 \ + reregexp@1.6.1 \ + @faker-js/faker@8.1.0 \ @openapitools/openapi-generator-cli@2.6.0 \ lodash@4.17.21 \ @types/lodash@4.14.197 \ diff --git a/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data b/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data index 16dd11515..ff7755089 100755 --- a/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data +++ b/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data @@ -7,11 +7,13 @@ spec_path='' output_path='' locale='en' max_array_length='3' +seed='1337' while [[ "$#" -gt 0 ]]; do case $1 in --spec-path) spec_path="$2"; shift;; --output-path) output_path="$2"; shift;; --locale) locale="$2"; shift;; --max-array-length) max_array_length="$2"; shift;; + --seed) seed="$2"; shift;; esac; shift; done echo "Generating Mock Data..." @@ -28,6 +30,9 @@ cd $tmp_dir log "mock-data :: tmp_dir :: $tmp_dir" +# Copy the script directory into the temp directory +cp -r $script_dir/* . + # Install dependencies install_packages @@ -35,14 +40,16 @@ outdir="$working_dir/$output_path/mocks" log "mock-data :: deleting outdir :: $outdir" rm -rf $outdir +mkdir -p $outdir # Generate log "mock-data :: generate" -run_command openapi-json \ - --input "$working_dir/$spec_path" \ - --output "$working_dir/$output_path/mocks" \ - --locale $locale \ - --max-array-length $max_array_length +run_command ts-node generate-mock-data.ts \ + --specPath="$working_dir/$spec_path" \ + --outputPath="$working_dir/$output_path/mocks" \ + --locale="$locale" \ + --maxArrayLength="$max_array_length" \ + --seed="$seed" echo "Mock data generation done!" diff --git a/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data.ts b/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data.ts new file mode 100644 index 000000000..6c2a257be --- /dev/null +++ b/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data.ts @@ -0,0 +1,296 @@ +/*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 */ +import * as fs from "fs"; +import { allFakers, Faker } from "@faker-js/faker"; +import * as path from "path"; +import { parse } from "ts-command-line-args"; +import SwaggerParser from "@apidevtools/swagger-parser"; +import { OpenAPIV3 } from "openapi-types"; +import ReRegExp from "reregexp"; +import _ from "lodash"; + +interface Arguments { + readonly specPath: string; + readonly outputPath: string; + readonly locale: string; + readonly maxArrayLength: number; + readonly seed: number; +} + +interface GenerateProps { + readonly faker: Faker; + readonly maxArrayLength: number; + readonly maxCircularReferenceDepth: number; +} + +const isRef = (obj: unknown): obj is OpenAPIV3.ReferenceObject => !!obj && typeof obj === "object" && "$ref" in obj; + +const isSchemaObj = (obj: unknown): obj is OpenAPIV3.SchemaObject => !!obj && typeof obj === "object" && ("type" in obj || "allOf" in obj || "oneOf" in obj || "anyOf" in obj || "not" in obj); + +const resolveSchemaRef = (spec: OpenAPIV3.Document, ref: string): OpenAPIV3.SchemaObject => { + const refParts = ref.slice(2).split('/').map(p => p.replace(/~0/g, "~").replace(/~1/g, "/")); + const resolved = _.get(spec, refParts) as unknown; + if (!resolved) { + throw new Error(`Unable to resolve ref ${ref} in spec`); + } + if (!isSchemaObj(resolved)) { + throw new Error(`Expected ref to resolve to a schema ${ref}`); + } + return resolved; +}; + +const generateMockResponse = ( + spec: OpenAPIV3.Document, + args: GenerateProps, + schemaOrRef: OpenAPIV3.SchemaObject | OpenAPIV3.ReferenceObject, + propertyName?: string, +): object | string | number | boolean => { + const faker = args.faker; + + let schema: OpenAPIV3.SchemaObject; + + let maxCircularReferenceDepth = args.maxCircularReferenceDepth; + + // Only circular references remain, so decrement the circular reference depth if we encounter one + if (isRef(schemaOrRef)) { + schema = resolveSchemaRef(spec, schemaOrRef.$ref); + maxCircularReferenceDepth--; + } else { + schema = schemaOrRef; + } + + const nextArgs = { ...args, maxCircularReferenceDepth }; + + // Return examples if specified as they're likely better than any mocks we can generate ourselves + if (schema.example) { + return schema.example; + } + + // For enums, just pick one of the values + if (schema.enum) { + return faker.helpers.arrayElement(schema.enum); + } + + if (schema.not) { + // Not isn't likely to occur in a Smithy-based project, but it could come up in OpenAPI + // To keep this simple we return either an object or a string - since by definition we just need to + // return a type that isn't the specified one. + const notResponse = generateMockResponse(spec, nextArgs, schema.not); + if (typeof notResponse === "object") { + return generateMockResponse(spec, nextArgs, { type: "string" }); + } + return generateMockResponse(spec, nextArgs, { type: "object" }); + } + + if (schema.type === "integer") { + return faker.number.int({ min: schema.minimum, max: schema.maximum }); + } + + if (schema.type === "number") { + return faker.number.float({ min: schema.minimum, max: schema.maximum }); + } + + if (schema.type === "boolean") { + return faker.datatype.boolean(); + } + + if (schema.type === "string") { + return generateMockString(faker, schema, propertyName); + } + + if (schema.type === "array") { + // Hit max circular ref depth, just return an empty list here + if (args.maxCircularReferenceDepth <= 0) { + return []; + } + + // Pick the lower "max items" of the max array length option and the value defined in the schema + let maxItems: number | undefined = undefined; + if (args.maxArrayLength !== undefined && schema.maxItems !== undefined) { + maxItems = Math.min(args.maxArrayLength, schema.maxItems); + } else { + maxItems = args.maxArrayLength ?? schema.maxItems; + } + // Pick the lower minimum number of items (to avoid min > max if max array length is lower than the min in the schema) + let minItems: number | undefined = undefined; + if (maxItems !== undefined && schema.minItems !== undefined) { + minItems = Math.min(maxItems, schema.minItems); + } else { + minItems = schema.minItems; + } + + if (isRef(schema.items) && !minItems) { + // Circular reference, where we're allowed zero items. + return []; + } + + return [...new Array(faker.number.int({ min: minItems, max: maxItems })).keys()].map(() => + generateMockResponse(spec, nextArgs, (schema as OpenAPIV3.ArraySchemaObject).items)); + } + + // Type is an object, or allOf/oneOf/anyOf + + // If we've hit max depth, return an empty object + if (args.maxCircularReferenceDepth <= 0) { + return {}; + } + + if (schema.allOf) { + // For allOf, combine the mocks together + return schema.allOf.map(s => generateMockResponse(spec, nextArgs, s) as object).reduce((allMocks, mock) => ({ + ...allMocks, + ...mock, + }), {}); + } + + if (schema.oneOf || schema.anyOf) { + const firstSubschema = (schema.oneOf || schema.anyOf)![0]; + if (!firstSubschema) { + throw new Error(`oneOf / anyOf must define at least one subschema`); + } + // For oneOf / anyOf pick the first + return generateMockResponse(spec, nextArgs, (schema.oneOf || schema.anyOf)![0]); + } + + if (schema.type === "object") { + // Additional properties that aren't circular refs + if (!schema.properties && typeof schema.additionalProperties === "object" && !isRef(schema.additionalProperties)) { + return Object.fromEntries([...new Array(faker.number.int({ min: 0, max: args.maxArrayLength ?? 0 })).keys()] + .map(i => [`${faker.lorem.slug(1)}-${i}`, generateMockResponse(spec, nextArgs, schema.additionalProperties as OpenAPIV3.SchemaObject)])); + } + + const requiredProperties = new Set(schema.required ?? []); + return Object.fromEntries(Object.entries(schema.properties ?? {}).filter(([k, v]) => { + // Filter out circular references we've seen if they are not required + // If they are required, we'll recursively include them until the max depth is hit + return requiredProperties.has(k) || !isRef(v); + }).map(([k, v]) => [k, generateMockResponse( + spec, + nextArgs, + v, + k, + )])); + } + + // Type is "any" - just return an empty object + return {}; +}; + +const generateStringFromRegex = (pattern: string): string | undefined => { + const random = Math.random; + try { + // Fix random to ensure mocked data is deterministic + Math.random = () => 0.5; + return new ReRegExp(pattern).build(); + } catch { + // Couldn't convert regex to string, don't fail, just be less strict + } finally { + Math.random = random; + } + return undefined; +} + +const generateMockString = (faker: Faker, schema: OpenAPIV3.SchemaObject, inPropertyName?: string): string => { + const propertyName = inPropertyName?.toLowerCase(); + const format = schema.format ?? ""; + + // Regex defines the expected string - try generating something that matches + if (schema.pattern) { + const mockFromPattern = generateStringFromRegex(schema.pattern); + if (mockFromPattern) { + return mockFromPattern; + } + } + + if (["date", "date-time", "datetime"].includes(format)) { + const date = faker.date.anytime().toISOString(); + if (format === "date") { + return date.split('T')[0]; + } + return date; + } + + if (["email", "idn-email"].includes(format) || propertyName?.endsWith("email")) { + return faker.internet.email(); + } + + if (["uri", "url", "uri-reference", "iri", "iri-reference", "uri-template"].includes(format) || propertyName?.endsWith("url")) { + return faker.internet.url(); + } + + if (["hostname", "idn-hostname"].includes(format)) { + return faker.internet.domainName(); + } + + if (format === "ipv4") { + return faker.internet.ipv4(); + } + + if (format === "ipv6") { + return faker.internet.ipv6(); + } + + if (format === "uuid") { + return faker.string.uuid(); + } + + let text = faker.lorem.words(3); + if (schema.minLength !== undefined) { + text = faker.lorem.words(schema.minLength); + } + if (schema.maxLength !== undefined) { + text = text.slice(0, schema.maxLength); + } + + if (format === "byte") { + return Buffer.from(text, "utf-8").toString('base64'); + } + + return text; +}; + +// Entry point +void (async () => { + const args = parse({ + specPath: { type: String }, + outputPath: { type: String }, + locale: { type: String }, + maxArrayLength: { type: Number }, + seed: { type: Number }, + }); + + const faker = allFakers[args.locale as keyof typeof allFakers]; + + if (!faker) { + throw new Error(`Locale ${args.locale} is not supported.`); + } + + faker.seed(args.seed); + faker.setDefaultRefDate(new Date("2021-06-10")); + + let spec = await SwaggerParser.bundle(args.specPath) as OpenAPIV3.Document; + + // Dereference all but circular references + spec = await SwaggerParser.dereference(spec, { dereference: { circular: 'ignore' } }) as OpenAPIV3.Document; + + Object.entries(spec.paths ?? {}).forEach(([p, pathOp]) => { + Object.entries(pathOp ?? {}).forEach(([method, operation]) => { + if (operation && typeof operation === "object" && "responses" in operation) { + Object.entries(operation.responses).forEach(([responseCode, response]) => { + if (!isRef(response)) { + const schema = response?.content?.['application/json']?.schema; + if (schema) { + const mockResponseFilePath = path.join(args.outputPath, `${method.toLowerCase()}${p.replace(/\//g, "-")}-${responseCode}.json`); + const mockResponse = generateMockResponse(spec, { + faker, + maxArrayLength: args.maxArrayLength, + maxCircularReferenceDepth: 2, + }, schema); + fs.writeFileSync(mockResponseFilePath, JSON.stringify(mockResponse, null, 2)); + } + } + }); + } + }); + }); +})(); diff --git a/packages/type-safe-api/src/project/codegen/components/utils.ts b/packages/type-safe-api/src/project/codegen/components/utils.ts index 84bb36c66..f888ac9ae 100644 --- a/packages/type-safe-api/src/project/codegen/components/utils.ts +++ b/packages/type-safe-api/src/project/codegen/components/utils.ts @@ -197,9 +197,10 @@ export const buildInvokeMockDataGeneratorCommand = ( options.maxArrayLength !== undefined ? ` --max-array-length ${options.maxArrayLength}` : ""; + const seed = options.seed !== undefined ? ` --seed ${options.seed}` : ""; return buildTypeSafeApiExecCommand( TypeSafeApiScript.GENERATE_MOCK_DATA, - `--spec-path ${options.specPath} --output-path ${outputPath}${locale}${maxArrayLength}` + `--spec-path ${options.specPath} --output-path ${outputPath}${locale}${maxArrayLength}${seed}` ); }; diff --git a/packages/type-safe-api/src/project/types.ts b/packages/type-safe-api/src/project/types.ts index 3ca71f677..f03792f21 100644 --- a/packages/type-safe-api/src/project/types.ts +++ b/packages/type-safe-api/src/project/types.ts @@ -172,6 +172,11 @@ export interface MockResponseDataGenerationOptions { * @default 3 */ readonly maxArrayLength?: number; + /** + * Seed for faker to generate data with + * @default 1337 + */ + readonly seed?: number; } /** diff --git a/packages/type-safe-api/test/resources/specs/data-types.yaml b/packages/type-safe-api/test/resources/specs/data-types.yaml new file mode 100644 index 000000000..aef66d66c --- /dev/null +++ b/packages/type-safe-api/test/resources/specs/data-types.yaml @@ -0,0 +1,102 @@ +openapi: 3.0.3 +info: + version: 1.0.0 + title: Data Types +paths: + /types: + get: + operationId: dataTypes + responses: + '200': + description: Ok + content: + 'application/json': + schema: + type: object + properties: + myInt: + minimum: 3 + maximum: 7 + type: integer + myString: + type: string + myStringLength: + type: string + minLength: 4 + maxLength: 5 + myLongMinStringLength: + type: string + minLength: 1000 + myBool: + type: boolean + myNumber: + type: number + myDateArray: + type: array + items: + type: string + format: date + myEmail: + type: string + format: email + myUrl: + type: string + format: uri + myHostname: + type: string + format: hostname + myIpv4: + type: string + format: ipv4 + myIpv6: + type: string + format: ipv6 + myUuid: + type: string + format: uuid + myByte: + type: string + format: byte + myDateTime: + type: string + format: date-time + myRegexPattern: + type: string + pattern: ^\d{4}-pattern-[a-z]+$ + myOneOf: + oneOf: + - type: string + - type: number + myAnyOf: + anyOf: + - type: string + - type: number + myAllOf: + allOf: + - type: object + properties: + first: + type: string + - type: object + properties: + second: + type: string + myNot: + not: + type: object + properties: + foo: + type: string + myNotString: + not: + type: string + myAdditionalProperties: + type: object + additionalProperties: + type: array + minItems: 2 + maxItems: 5 + items: + type: integer + minimum: 10 + maximum: 20 \ No newline at end of file diff --git a/packages/type-safe-api/test/resources/specs/recursive-required.yaml b/packages/type-safe-api/test/resources/specs/recursive-required.yaml new file mode 100644 index 000000000..ecd8ea35d --- /dev/null +++ b/packages/type-safe-api/test/resources/specs/recursive-required.yaml @@ -0,0 +1,30 @@ +openapi: 3.0.3 +info: + version: 1.0.0 + title: Recursive schema with required children +paths: + /tree: + get: + operationId: getTree + responses: + '200': + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/Node' +components: + schemas: + Node: + type: object + properties: + next: + $ref: '#/components/schemas/Node' + number: + type: number + minimum: 0 + maximum: 10 + required: + - next + - number + diff --git a/packages/type-safe-api/test/resources/specs/recursive.yaml b/packages/type-safe-api/test/resources/specs/recursive.yaml new file mode 100644 index 000000000..af10bbe45 --- /dev/null +++ b/packages/type-safe-api/test/resources/specs/recursive.yaml @@ -0,0 +1,25 @@ +openapi: 3.0.3 +info: + version: 1.0.0 + title: Recursive schema +paths: + /tree: + get: + operationId: getTree + responses: + '200': + description: Ok + content: + 'application/json': + schema: + $ref: '#/components/schemas/TreeNode' +components: + schemas: + TreeNode: + type: object + properties: + left: + $ref: '#/components/schemas/TreeNode' + right: + $ref: '#/components/schemas/TreeNode' + diff --git a/packages/type-safe-api/test/scripts/custom/mock-data/__snapshots__/generate-mock-data.test.ts.snap b/packages/type-safe-api/test/scripts/custom/mock-data/__snapshots__/generate-mock-data.test.ts.snap index d0362b39b..63c33a7fc 100644 --- a/packages/type-safe-api/test/scripts/custom/mock-data/__snapshots__/generate-mock-data.test.ts.snap +++ b/packages/type-safe-api/test/scripts/custom/mock-data/__snapshots__/generate-mock-data.test.ts.snap @@ -3,38 +3,96 @@ exports[`Generate Mock Data Unit Tests Generates Mock Data 1`] = ` { "mocks/delete-without-operation-id-200.json": { - "messages": [], + "messages": [ + { + "id": 2359372120326144, + "message": "canto eaque omnis", + }, + ], }, "mocks/get-map-response-200.json": { "mapProperty": { - "aliquid-2": { - "a": "qui", - "b": "laboriosam", - }, - "explicabo-0": { - "a": "aliquam", - "b": "repellat", - }, - "fugit-1": { - "a": "consectetur", - "b": "et", + "voluptatibus-0": { + "a": "cerno tabella cohors", + "b": "ancilla thorax creptio", }, }, }, - "mocks/post-different-media-type-200.json": {}, - "mocks/post-multiple-content-types-200.json": "nostrum", + "mocks/post-multiple-content-types-200.json": "allatus quisquam conventus", "mocks/post-path-{pathParam}-200.json": { "messages": [ { - "id": "72032", - "message": "repellat", + "id": 2505140957347840, + "message": "laborum articulus benevolentia", }, ], }, "mocks/post-path-{pathParam}-400.json": { - "errorMessage": "itaque", + "errorMessage": "illo degenero ademptio", + }, + "mocks/put-any-request-response-200.json": {}, +} +`; + +exports[`Generate Mock Data Unit Tests Generates Mock Data For Many Data Types 1`] = ` +{ + "mocks/get-types-200.json": { + "myAdditionalProperties": { + "theatrum-0": [ + 14, + 17, + 10, + ], + "uberrime-1": [ + 10, + 17, + 16, + ], + }, + "myAllOf": { + "first": "arbustum benigne utor", + "second": "decet aureus conculco", + }, + "myAnyOf": "necessitatibus acsi candidus", + "myBool": true, + "myByte": "c3Blcm5vIGFlZ3JlIGFjcXVpcm8=", + "myDateArray": [ + "2020-07-11", + ], + "myDateTime": "2021-09-20T00:25:04.928Z", + "myEmail": "Gunner48@yahoo.com", + "myHostname": "hopeful-pneumonia.org", + "myInt": 4, + "myIpv4": "115.87.166.36", + "myIpv6": "ef26:0b5f:fc73:2969:a0f1:3f5c:4e4d:1feb", + "myLongMinStringLength": "voluptatibus cerno tabella cohors ancilla thorax creptio allatus quisquam conventus ante talio vorago artificiose decipio unus testimonium texo thalassinus abscido contra delectus cupressus creator nulla eius temporibus corpus audeo demonstro civis urbanus spargo cultellus desidero decet atrox aqua cupiditate tracto avarus velit exercitationem vestrum tristis quaerat audax vita vita uxor currus torqueo desparatus stultus dolore suadeo accendo tui suus provident vulgo sono ascisco defungo antepono cupressus corrupti quos suadeo timidus abbas spiritus corporis ubi adsum temporibus testimonium vitium consectetur admoveo subvenio est deprecator spiritus voluptas tamquam tubineus fugit pel celo magni tum vulpes tabesco caterva undique accedo cognomen alienus peior vigor charisma voluptate vacuus deprecator civis confugo dolor supra arca abstergo sto temporibus valetudo speciosus fugiat aufero tener sophismata degero vere sopor arx itaque verbum texo communis utilis subseco universe cena cohaero earum vomer atrocitas supra delibero degenero deduco spectaculum crustulum vae textor denuncio depromo cupio surculus adsum textus studio consequuntur abundans verbera corpus summisse officiis velit denego curia balbus delibero somnus ventito volup recusandae deleo expedita accusantium capio celo vindico eveniet laboriosam arceo templum despecto canto coerceo curtus crapula cruentus vulariter dolorem theatrum antea bonus statua laudantium acsi sollicito canis sui tabgo error victus comprehendo placeat ager cumque corona ultra abundans vulgivagus quod clementia strues cribro tandem subnecto cado consuasor brevis addo cribro conscendo deporto deorsum aveho administratio confido veritas usus surgo demergo ter aranea alo vir adfero surgo caveo clarus antea abbas capio conduco statim tyrannus denique comptus video deficio nobis caelestis audax tres audentia voco confido ademptio damnatio bos aestus certus repellat aegrus adsum degero supra conor solutio complectus absorbeo thymum tenax ullus confido tabella tergeo maiores condico thalassinus nisi aspicio astrum considero tyrannus valens cerno pauci tam tersus magnam quas velut velum infit avaritia acies triduana aggero maxime vis paens defleo triumphus arceo aliquid spero subiungo quia cum inventore velum ventosus sono velociter tabernus celebrer adicio super terebro deorsum tabesco cicuta spiritus adsum cursim bardus enim rerum adhuc circumvenio veniam decipio vitiosus coniuratio cerno desidero vivo sollers decor vir apud ademptio dolorem iure suffoco saepe comitatus articulus cerno sursum ver cras pauci doloremque demergo nesciunt strenuus tutis depromo subvenio tutamen quo peior admoneo creta adipisci vigilo eveniet cervus terra cursus succedo talio auxilium via cernuus coaegresco bibo quidem cumque ademptio sollers provident cerno sumo cicuta vitiosus terminatio articulus ulterius quisquam incidunt paulatim surculus undique damnatio tum tracto pecto tredecim una acceptus est tabella adinventitias sunt atavus super substantia terror defleo viduo administratio solus cedo audeo subito sto suffoco vulariter quaerat vergo alter uredo abutor adipiscor suadeo absens cornu tamquam tonsor tabella verus suggero adeptio aro auditor angustus usque arto ventito trans curis culpo tantum atrox averto quos arto adficio cimentarius alius aestus amoveo nulla strenuus clibanus provident conicio natus temptatio trepide damnatio tamdiu absorbeo calamitas sperno alias cognatus desino corrumpo combibo cruciamentum ceno conduco dolor cauda substantia acceptus venustas sit defetiscor omnis expedita earum tolero cubitum creta vulpes talus ut vorax cura bene cunae nesciunt subiungo suppellex derelinquo appello ver torqueo annus tabula depopulo tam rerum turpis sed tandem unde talio reiciendis sapiente tibi rerum adsuesco tribuo caelum trucido strues brevis timor somniculosus eos attero solium trado ventus addo deficio adeo carpo accusantium nihil similique officiis exercitationem caput acsi ipsam acquiro cum tametsi sed tamisium ratione campana colligo terreo adnuo tutamen conqueror triduana communis itaque beatae stultus suus ter demens tactus quo cum vallum speciosus infit subiungo occaecati tot comparo conscendo adflicto error bestia aureus audentia casus id hic corrigo cogito iusto similique cursim administratio tabesco amo adeo templum corrupti decipio adulatio volubilis stillicidium annus sub contabesco trepide vesica cariosus tubineus repellat volutabrum atrox autus confugo contego cenaculum similique accommodo charisma claustrum adipiscor spargo nobis cognatus audeo deleo testimonium crebro crastinus absens compello caterva soleo tres quibusdam spoliatio color sponte tamisium auxilium culpa vinculum teneo aequitas adinventitias casso verbera via sint comptus defessus cohibeo acerbitas acquiro bellicus caterva placeat validus vestrum in peccatus articulus laudantium dolor cupio conduco tubineus tracto nobis aperte tam beneficium cariosus labore amplus comparo vox impedit adduco adipiscor brevis cernuus cuppedia ascit capto nisi cena adipisci iure auctus pel umquam pectus templum temptatio caelestis bibo deorsum varietas absque solutio volup adipisci adeptio patria depono crapula valeo coniecto taceo avarus earum sumo facere voluptatum caste chirographum verumtamen sollers labore debilito sub damnatio volutabrum amiculum sponte caste dolor ustilo bellum ancilla versus comes aqua sumo eos crastinus vestrum cerno convoco vindico conturbo verbum coerceo pel crastinus vulnus denique vos ancilla utrimque adeo desino tunc tondeo dignissimos theca corrigo atrocitas mollitia pectus adimpleo alter curiositas calco desino arbitro ultio collum ager defessus auditor clibanus corpus laboriosam surculus ut correptius beatae thorax adsuesco atrocitas ver tepesco conforto distinctio turba caterva vicissitudo confido tolero tutamen advenio suspendo culpa est cauda autus sequi verto nam decerno vespillo vergo cruentus quaerat tui ventus statim vereor concido cubitum ciminatio caste sufficio usitas molestias id volup talio bonus clamo canto caritas suasoria coerceo solvo acervus verto suppono vesco temperantia casus arcesso fuga rerum crustulum consectetur aliqua confido certe adiuvo ait incidunt voluptatibus recusandae velum tandem triumphus odit volva video patria crinis sponte summopere brevis ustulo vester adfero adficio stips ratione corrupti adflicto pauper voluptate taedium utique advoco desparatus sol odit tergiversatio cicuta aliquid argumentum demergo tricesimus tabgo apostolus earum apparatus tardus coniecto desidero voveo possimus denuncio statua cohors vigor carus crapula terminatio dolorum arca uterque decens vulgo ustilo vito abutor officia templum conturbo volva casus candidus dolorem taedium explicabo thesaurus tego ut tabernus subito currus bos temporibus aggredior adulescens laboriosam repellendus laboriosam beneficium cubo adfero in thymbra aspernatur cum atavus velit sumo atrox vulnus error thesis ago asperiores comes teres crastinus clamo conitor vestigium aro demergo crapula cubicularis armarium alveus timidus despecto trucido alias suggero stillicidium vehemens apto cimentarius delinquo tamquam carmen nisi xiphias pecto certe virga numquam adflicto accedo antea perferendis carus dolorem commodi denuncio compello culpa expedita valetudo nesciunt auctus ater suadeo callide tergiversatio considero tabernus voluntarius pectus molestiae subseco admoveo caput valde ait vereor verbum spoliatio facilis repellendus carbo cuius turpis benevolentia totam corrigo capitulus vapulus uter adduco", + "myNot": "quidem advoco utpote", + "myNotString": {}, + "myNumber": 0.5658850050531328, + "myOneOf": "victus sto agnosco", + "myRegexPattern": "5555-pattern-nnn", + "myString": "laborum articulus benevolentia", + "myStringLength": "ademp", + "myUrl": "https://incompatible-diner.info/", + "myUuid": "19106449-d1d7-4db3-a05e-9b0ad4a56244", + }, +} +`; + +exports[`Generate Mock Data Unit Tests Generates Mock Data For Recursive Definitions 1`] = ` +{ + "mocks/get-tree-200.json": {}, +} +`; + +exports[`Generate Mock Data Unit Tests Generates Mock Data For Recursive Definitions With Required Recursive Reference 1`] = ` +{ + "mocks/get-tree-200.json": { + "next": { + "next": {}, + "number": 2.620246761944145, + }, + "number": 5.605297528672963, }, - "mocks/put-any-request-response-200.json": null, - "mocks/put-empty-response-204.json": {}, } `; diff --git a/packages/type-safe-api/test/scripts/custom/mock-data/generate-mock-data.test.ts b/packages/type-safe-api/test/scripts/custom/mock-data/generate-mock-data.test.ts index e309e8c90..3a62f7835 100644 --- a/packages/type-safe-api/test/scripts/custom/mock-data/generate-mock-data.test.ts +++ b/packages/type-safe-api/test/scripts/custom/mock-data/generate-mock-data.test.ts @@ -18,4 +18,43 @@ describe("Generate Mock Data Unit Tests", () => { }) ).toMatchSnapshot(); }); + + it("Generates Mock Data For Recursive Definitions", () => { + expect( + withTmpDirSnapshot(os.tmpdir(), (tmpDir) => { + const specPath = "../../../resources/specs/recursive.yaml"; + const outputPath = path.relative(path.resolve(__dirname), tmpDir); + const command = `../../../../scripts/type-safe-api/custom/mock-data/generate-mock-data --spec-path ${specPath} --output-path ${outputPath}`; + exec(command, { + cwd: path.resolve(__dirname), + }); + }) + ).toMatchSnapshot(); + }); + + it("Generates Mock Data For Recursive Definitions With Required Recursive Reference", () => { + expect( + withTmpDirSnapshot(os.tmpdir(), (tmpDir) => { + const specPath = "../../../resources/specs/recursive-required.yaml"; + const outputPath = path.relative(path.resolve(__dirname), tmpDir); + const command = `../../../../scripts/type-safe-api/custom/mock-data/generate-mock-data --spec-path ${specPath} --output-path ${outputPath}`; + exec(command, { + cwd: path.resolve(__dirname), + }); + }) + ).toMatchSnapshot(); + }); + + it("Generates Mock Data For Many Data Types", () => { + expect( + withTmpDirSnapshot(os.tmpdir(), (tmpDir) => { + const specPath = "../../../resources/specs/data-types.yaml"; + const outputPath = path.relative(path.resolve(__dirname), tmpDir); + const command = `../../../../scripts/type-safe-api/custom/mock-data/generate-mock-data --spec-path ${specPath} --output-path ${outputPath}`; + exec(command, { + cwd: path.resolve(__dirname), + }); + }) + ).toMatchSnapshot(); + }); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a77d60aab..cc668be1f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1049,6 +1049,9 @@ importers: specifier: ^1.2.5 version: 1.2.5 devDependencies: + '@apidevtools/swagger-parser': + specifier: 10.1.0 + version: 10.1.0(openapi-types@12.1.3) '@aws-cdk/assert': specifier: ^2.68.0 version: 2.68.0(aws-cdk-lib@2.93.0)(constructs@10.2.70)(jest@29.6.4) @@ -1061,6 +1064,9 @@ importers: '@aws-sdk/client-s3': specifier: ^3.400.0 version: 3.400.0 + '@faker-js/faker': + specifier: 8.1.0 + version: 8.1.0 '@nx/devkit': specifier: ^16 version: 16.7.4(nx@16.0.0) @@ -1220,9 +1226,15 @@ importers: projen: specifier: ^0.73 version: 0.73.2 + reregexp: + specifier: 1.6.1 + version: 1.6.1 tree-cli: specifier: ^0.6.7 version: 0.6.7 + ts-command-line-args: + specifier: 2.4.2 + version: 2.4.2(jest@29.6.4)(typescript@5.2.2) ts-jest: specifier: ^29.1.1 version: 29.1.1(@babel/core@7.21.8)(jest@29.6.4)(typescript@5.2.2) @@ -1520,9 +1532,15 @@ importers: specifier: ^7.0.1 version: 7.0.1 devDependencies: + '@apidevtools/swagger-parser': + specifier: 10.1.0 + version: 10.1.0(openapi-types@12.1.3) '@aws-sdk/client-s3': specifier: ^3.400.0 version: 3.400.0 + '@faker-js/faker': + specifier: 8.1.0 + version: 8.1.0 '@types/fs-extra': specifier: ^11.0.1 version: 11.0.1 @@ -1598,6 +1616,12 @@ importers: projen: specifier: ^0.73 version: 0.73.2 + reregexp: + specifier: 1.6.1 + version: 1.6.1 + ts-command-line-args: + specifier: 2.4.2 + version: 2.4.2(jest@29.6.4)(typescript@5.2.2) ts-jest: specifier: ^29.1.1 version: 29.1.1(@babel/core@7.21.8)(jest@29.6.4)(typescript@5.2.2) @@ -1615,6 +1639,38 @@ packages: '@jridgewell/trace-mapping': 0.3.18 dev: true + /@apidevtools/json-schema-ref-parser@9.0.6: + resolution: {integrity: sha512-M3YgsLjI0lZxvrpeGVk9Ap032W6TPQkH6pRAZz81Ac3WUNF79VQooAFnp8umjvVzUmD93NkogxEwbSce7qMsUg==} + dependencies: + '@jsdevtools/ono': 7.1.3 + call-me-maybe: 1.0.2 + js-yaml: 3.14.1 + dev: true + + /@apidevtools/openapi-schemas@2.1.0: + resolution: {integrity: sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==} + engines: {node: '>=10'} + dev: true + + /@apidevtools/swagger-methods@3.0.2: + resolution: {integrity: sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==} + dev: true + + /@apidevtools/swagger-parser@10.1.0(openapi-types@12.1.3): + resolution: {integrity: sha512-9Kt7EuS/7WbMAUv2gSziqjvxwDbFSg3Xeyfuj5laUODX8o/k/CpsAKiQ8W7/R88eXFTMbJYg6+7uAmOWNKmwnw==} + peerDependencies: + openapi-types: '>=7' + dependencies: + '@apidevtools/json-schema-ref-parser': 9.0.6 + '@apidevtools/openapi-schemas': 2.1.0 + '@apidevtools/swagger-methods': 3.0.2 + '@jsdevtools/ono': 7.1.3 + ajv: 8.12.0 + ajv-draft-04: 1.0.0(ajv@8.12.0) + call-me-maybe: 1.0.2 + openapi-types: 12.1.3 + dev: true + /@aws-cdk/assert@2.68.0(aws-cdk-lib@2.93.0)(constructs@10.2.70)(jest@29.6.4): resolution: {integrity: sha512-bEztvoYdVp17I/ClYRGZa4wlEP/qNNq4Q+Z7EKwRL0cLDmvq4EI1m1N8LhUPAH7B6YXp5d1164gC6Nr0lV8bbA==} engines: {node: '>= 14.15.0'} @@ -2784,6 +2840,11 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@faker-js/faker@8.1.0: + resolution: {integrity: sha512-38DT60rumHfBYynif3lmtxMqMqmsOQIxQgEuPZxCk2yUYN0eqWpTACgxi0VpidvsJB8CRxCpvP7B3anK85FjtQ==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0, npm: '>=6.14.13'} + dev: true + /@gar/promisify@1.1.3: resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==} dev: true @@ -3126,6 +3187,10 @@ packages: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 + /@jsdevtools/ono@7.1.3: + resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} + dev: true + /@jsii/check-node@1.88.0: resolution: {integrity: sha512-AveFyqkJIb8qZvGk5nZal/8mEJB6lWhwqvAQLodHmqE3WzpmZD5+h+aspBVt0El5cEFRJ1k1mrQqhAnJCVpvxg==} engines: {node: '>= 14.17.0'} @@ -3244,6 +3309,24 @@ packages: - supports-color dev: true + /@morgan-stanley/ts-mocking-bird@0.6.4(jest@29.6.4)(typescript@5.2.2): + resolution: {integrity: sha512-57VJIflP8eR2xXa9cD1LUawh+Gh+BVQfVu0n6GALyg/AqV/Nz25kDRvws3i9kIe1PTrbsZZOYpsYp6bXPd6nVA==} + peerDependencies: + jasmine: 2.x || 3.x || 4.x + jest: 26.x || 27.x || 28.x + typescript: '>=4.2' + peerDependenciesMeta: + jasmine: + optional: true + jest: + optional: true + dependencies: + jest: 29.6.4(@types/node@16.18.25)(ts-node@10.9.1) + lodash: 4.17.21 + typescript: 5.2.2 + uuid: 7.0.3 + dev: true + /@mrgrain/jsii-struct-builder@0.5.7(projen@0.73.2): resolution: {integrity: sha512-9UMg6NOh46ha3r62MgKO7mop94vLtFb3abrnSedFI9GZuq0O48ZPd8qfKmVt+WUZnLmr8FbK29CKEUt+MGyrDw==} peerDependencies: @@ -3621,6 +3704,8 @@ packages: /@nx/nx-darwin-arm64@16.0.0: resolution: {integrity: sha512-GtXS0NPENG+s5bsVdsaXTX1jKOw85jHSALhrXXiMXknjwnvyHUelxFDS4fHhIlcOSd56Y5sn1pdg/fi2WPoscw==} engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] requiresBuild: true dev: true optional: true @@ -3628,6 +3713,8 @@ packages: /@nx/nx-darwin-x64@16.0.0: resolution: {integrity: sha512-iZv59vEoHekLahBrENYFtyUxuMwIQG24weluc00N2Edp7AlxVf7wRw6gd/xp3ATQbx/N92UPg6X761uBp2gm+Q==} engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] requiresBuild: true dev: true optional: true @@ -3635,6 +3722,8 @@ packages: /@nx/nx-linux-arm-gnueabihf@16.0.0: resolution: {integrity: sha512-o+ds8HogpkIc+Q8j5KEdiuEvGo6iHSpKSaFxKPIKHgD7xa6Kll966hKiFigeY2FDT2nGQlKZ0n1wNWQ4x2rijw==} engines: {node: '>= 10'} + cpu: [arm] + os: [linux] requiresBuild: true dev: true optional: true @@ -3642,6 +3731,8 @@ packages: /@nx/nx-linux-arm64-gnu@16.0.0: resolution: {integrity: sha512-ue2ravlNusu5xojC37JjgLaUyqm0swL5egVSHBARxOsT7piyk0ac56/j+ZrBckrjLbIplTGpwFGGS9vbKiEeoQ==} engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] requiresBuild: true dev: true optional: true @@ -3649,6 +3740,8 @@ packages: /@nx/nx-linux-arm64-musl@16.0.0: resolution: {integrity: sha512-dSqC3Tp8GfWqOH/jZBkdGtoDoi/A5+LA45nqXRAMawyFv3jODcBsPPuCT8FHk0Yb7X8+MNYx7gk7H14aRIjlQg==} engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] requiresBuild: true dev: true optional: true @@ -3656,6 +3749,8 @@ packages: /@nx/nx-linux-x64-gnu@16.0.0: resolution: {integrity: sha512-xk35VXMp6LfopYFSHy4aEgn1xhFyxDl0xYVcg0nrp0ohppjkYIW2H/XVuuEdYZvRuTPkn3a6dQDoo0LLeY77Cg==} engines: {node: '>= 10'} + cpu: [x64] + os: [linux] requiresBuild: true dev: true optional: true @@ -3663,6 +3758,8 @@ packages: /@nx/nx-linux-x64-musl@16.0.0: resolution: {integrity: sha512-yIdIlggK3WyDGoB7zS2UaiX2Q7ew0De62cNDudHgdg8dzHxa6IzKeFJjVEoNEt5Z+BG8ILaSn/lYxQs8YtV4FA==} engines: {node: '>= 10'} + cpu: [x64] + os: [linux] requiresBuild: true dev: true optional: true @@ -3670,6 +3767,8 @@ packages: /@nx/nx-win32-arm64-msvc@16.0.0: resolution: {integrity: sha512-YgnkVewQgA/RhXcGDbyhIi+WqAdIzjKGF1JPsA8q+6di3hRksvN+Ud4TVM9R8NFCrRclIxt04v+fqM24PmMIUQ==} engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] requiresBuild: true dev: true optional: true @@ -3677,6 +3776,8 @@ packages: /@nx/nx-win32-x64-msvc@16.0.0: resolution: {integrity: sha512-6UXuO3v5rD3ae5jyYZ0cvlLMJ1NzmdLIIQHio/sWno3KJ0+NR/gpkQBl6F4CdZmoXTXZ+ZsDGUNzQtXWkCdSLg==} engines: {node: '>= 10'} + cpu: [x64] + os: [win32] requiresBuild: true dev: true optional: true @@ -5070,6 +5171,17 @@ packages: indent-string: 4.0.0 dev: true + /ajv-draft-04@1.0.0(ajv@8.12.0): + resolution: {integrity: sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==} + peerDependencies: + ajv: ^8.5.0 + peerDependenciesMeta: + ajv: + optional: true + dependencies: + ajv: 8.12.0 + dev: true + /ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} dependencies: @@ -5198,6 +5310,16 @@ packages: dependencies: sprintf-js: 1.0.3 + /array-back@3.1.0: + resolution: {integrity: sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==} + engines: {node: '>=6'} + dev: true + + /array-back@4.0.2: + resolution: {integrity: sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==} + engines: {node: '>=8'} + dev: true + /array-buffer-byte-length@1.0.0: resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} dependencies: @@ -5736,6 +5858,10 @@ packages: get-intrinsic: 1.2.1 dev: true + /call-me-maybe@1.0.2: + resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} + dev: true + /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -6081,6 +6207,26 @@ packages: delayed-stream: 1.0.0 dev: true + /command-line-args@5.2.1: + resolution: {integrity: sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==} + engines: {node: '>=4.0.0'} + dependencies: + array-back: 3.1.0 + find-replace: 3.0.0 + lodash.camelcase: 4.3.0 + typical: 4.0.0 + dev: true + + /command-line-usage@6.1.3: + resolution: {integrity: sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==} + engines: {node: '>=8.0.0'} + dependencies: + array-back: 4.0.2 + chalk: 2.4.2 + table-layout: 1.0.2 + typical: 5.2.0 + dev: true + /commander@10.0.1: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} engines: {node: '>=14'} @@ -6688,7 +6834,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.3.0-dev.20230830 + typescript: 5.3.0-dev.20230927 dev: true /duplexer2@0.0.2: @@ -7396,6 +7542,13 @@ packages: merge: 2.1.1 dev: true + /find-replace@3.0.0: + resolution: {integrity: sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==} + engines: {node: '>=4.0.0'} + dependencies: + array-back: 3.1.0 + dev: true + /find-root@1.1.0: resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==} dev: true @@ -11123,7 +11276,6 @@ packages: /openapi-types@12.1.3: resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==} - dev: false /optionator@0.9.1: resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} @@ -12035,6 +12187,11 @@ packages: strip-indent: 3.0.0 dev: true + /reduce-flatten@2.0.0: + resolution: {integrity: sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==} + engines: {node: '>=6'} + dev: true + /regexp.prototype.flags@1.5.0: resolution: {integrity: sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==} engines: {node: '>= 0.4'} @@ -12107,6 +12264,10 @@ packages: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} + /reregexp@1.6.1: + resolution: {integrity: sha512-DffVGx+LeDxJzY/7RWcmZ8YlJPDKRVi7GddWfef4GZLDd9yH+2e+LmFZ9hTMaTyybu3IYPZcq1f8/ejH214eFQ==} + dev: true + /resolve-alpn@1.2.1: resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} dev: true @@ -12700,6 +12861,10 @@ packages: fast-fifo: 1.3.2 queue-tick: 1.0.1 + /string-format@2.0.0: + resolution: {integrity: sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==} + dev: true + /string-length@4.0.2: resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} engines: {node: '>=10'} @@ -12897,6 +13062,16 @@ packages: zod: 3.21.4 dev: true + /table-layout@1.0.2: + resolution: {integrity: sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==} + engines: {node: '>=8.0.0'} + dependencies: + array-back: 4.0.2 + deep-extend: 0.5.1 + typical: 5.2.0 + wordwrapjs: 4.0.1 + dev: true + /table@6.8.1: resolution: {integrity: sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==} engines: {node: '>=10.0.0'} @@ -13129,6 +13304,21 @@ packages: typescript: 5.2.2 dev: true + /ts-command-line-args@2.4.2(jest@29.6.4)(typescript@5.2.2): + resolution: {integrity: sha512-mJLQQBOdyD4XI/ZWQY44PIdYde47JhV2xl380O7twPkTQ+Y5vFDHsk8LOeXKuz7dVY5aDCfAzRarNfSqtKOkQQ==} + hasBin: true + dependencies: + '@morgan-stanley/ts-mocking-bird': 0.6.4(jest@29.6.4)(typescript@5.2.2) + chalk: 4.1.2 + command-line-args: 5.2.1 + command-line-usage: 6.1.3 + string-format: 2.0.0 + transitivePeerDependencies: + - jasmine + - jest + - typescript + dev: true + /ts-graphviz@1.8.1: resolution: {integrity: sha512-54/fe5iu0Jb6X0pmDmzsA2UHLfyHjUEUwfHtZcEOR0fZ6Myf+dFoO6eNsyL8CBDMJ9u7WWEewduVaiaXlvjSVw==} engines: {node: '>=14.16'} @@ -13383,12 +13573,22 @@ packages: engines: {node: '>=14.17'} hasBin: true - /typescript@5.3.0-dev.20230830: - resolution: {integrity: sha512-Blg+ZXlQ4QmC958EKLuEPr82sxizVZhc70X6mWFQjru8pOgBz1j6rTM7KGQhFdb6/HsdT5BSV+BcUMVO6m7v2w==} + /typescript@5.3.0-dev.20230927: + resolution: {integrity: sha512-FHoT/nbOZjlXfK1yYTtCVT6yOp7Y9Vab/8Do4KiEGl3jI6rxPD7d1ssB/5vlH4ZXZ//0DW96vsvp/OUyjxCqgA==} engines: {node: '>=14.17'} hasBin: true dev: true + /typical@4.0.0: + resolution: {integrity: sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==} + engines: {node: '>=8'} + dev: true + + /typical@5.2.0: + resolution: {integrity: sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==} + engines: {node: '>=8'} + dev: true + /uglify-js@3.17.4: resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} engines: {node: '>=0.8.0'} @@ -13573,6 +13773,11 @@ packages: hasBin: true dev: true + /uuid@7.0.3: + resolution: {integrity: sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==} + hasBin: true + dev: true + /uuid@8.0.0: resolution: {integrity: sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==} hasBin: true @@ -13732,6 +13937,14 @@ packages: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} dev: true + /wordwrapjs@4.0.1: + resolution: {integrity: sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==} + engines: {node: '>=8.0.0'} + dependencies: + reduce-flatten: 2.0.0 + typical: 5.2.0 + dev: true + /workerpool@6.4.2: resolution: {integrity: sha512-MrDWwemtC4xNV22kbbZDQQQmxNX+yLm790sgYl2wVD3CWnK7LJY1youI/11wHorAjHjK+GEjUxUh74XoPU71uQ==} dev: true diff --git a/projenrc/projects/type-safe-api-project.ts b/projenrc/projects/type-safe-api-project.ts index f6f2cdc1a..a4cbf250f 100644 --- a/projenrc/projects/type-safe-api-project.ts +++ b/projenrc/projects/type-safe-api-project.ts @@ -35,6 +35,10 @@ export class TypeSafeApiProject extends PDKProject { "projen", "@aws-sdk/client-s3", `${PDK_NAMESPACE}monorepo@^0.x`, + "@apidevtools/swagger-parser@10.1.0", // Used by scripts + "ts-command-line-args@2.4.2", // Used by scripts + "@faker-js/faker@8.1.0", // Used by scripts + "reregexp@1.6.1", // Used by scripts ], deps: [ `${PDK_NAMESPACE}pdk-nag@^0.x`, From 25607d008fdddb2ba15509423cb1c534a8d46e38 Mon Sep 17 00:00:00 2001 From: Adrian Dimech <51220968+agdimech@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:35:43 +1100 Subject: [PATCH 05/21] fix: rename unnamespaced packages (#600) --- docs/package.json | 2 +- docs/project.json | 5 +++-- package.json | 6 +++--- pnpm-workspace.yaml | 2 +- projenrc/projects/docs-project.ts | 2 +- projenrc/projects/pdk-monorepo-project.ts | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/package.json b/docs/package.json index 236437aff..2b188c1c6 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,5 +1,5 @@ { - "name": "docs", + "name": "@aws/docs", "scripts": { "build": "pnpm exec projen build", "compile": "pnpm exec projen compile", diff --git a/docs/project.json b/docs/project.json index 6540e650c..f53ab1208 100644 --- a/docs/project.json +++ b/docs/project.json @@ -1,5 +1,5 @@ { - "name": "docs", + "name": "@aws/docs", "root": "docs", "targets": { "default": { @@ -77,7 +77,8 @@ "@aws/cdk-graph", "@aws/cdk-graph-plugin-diagram", "@aws/pipeline", - "@aws/infrastructure" + "@aws/infrastructure", + "@aws/docs" ], "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." } diff --git a/package.json b/package.json index b96034cca..8bfc5d7d6 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "aws-pdk-monorepo", + "name": "@aws/pdk-monorepo", "scripts": { "build": "pnpm exec projen build", "clobber": "pnpm exec projen clobber", @@ -110,6 +110,7 @@ "packages/cdk-graph", "packages/cdk-graph-plugin-diagram", "packages/cloudscape-react-ts-website", + "docs", "packages/identity", "packages/infrastructure", "packages/monorepo", @@ -117,8 +118,7 @@ "packages/pdk-nag", "packages/pipeline", "packages/static-website", - "packages/type-safe-api", - "docs" + "packages/type-safe-api" ] }, "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"." diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 0faf7c2fe..1100f8e57 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -5,6 +5,7 @@ packages: - packages/cdk-graph - packages/cdk-graph-plugin-diagram - packages/cloudscape-react-ts-website + - docs - packages/identity - packages/infrastructure - packages/monorepo @@ -13,4 +14,3 @@ packages: - packages/pipeline - packages/static-website - packages/type-safe-api - - docs diff --git a/projenrc/projects/docs-project.ts b/projenrc/projects/docs-project.ts index 5a40ffaff..095d5d154 100644 --- a/projenrc/projects/docs-project.ts +++ b/projenrc/projects/docs-project.ts @@ -19,7 +19,7 @@ export class DocsProject extends TypeScriptProject { defaultReleaseBranch: "mainline", sampleCode: false, jest: false, - name: "docs", + name: "@aws/docs", depsUpgrade: false, deps: ["fs-extra"], }); diff --git a/projenrc/projects/pdk-monorepo-project.ts b/projenrc/projects/pdk-monorepo-project.ts index 67416a847..d472f313f 100644 --- a/projenrc/projects/pdk-monorepo-project.ts +++ b/projenrc/projects/pdk-monorepo-project.ts @@ -31,7 +31,7 @@ export class PDKMonorepoProject extends MonorepoTsProject { ignorePatterns: ["packages/**/*.*"], }, depsUpgrade: false, - name: "aws-pdk-monorepo", + name: "@aws/pdk-monorepo", devDeps: [ "lerna", "nx", From e3f9cac44d38c5ea341798e10aaf722970dc4a83 Mon Sep 17 00:00:00 2001 From: Adrian Dimech <51220968+agdimech@users.noreply.github.com> Date: Tue, 17 Oct 2023 10:28:37 +1100 Subject: [PATCH 06/21] fix(monorepo): fix issues with monorepo-ts peer deps (#602) fix #601, #586 --- .../monorepo/src/projects/typescript/monorepo-ts.ts | 13 +++++++++---- packages/pdk/_scripts/exec-command.js | 4 ++-- .../type-safe-api-project.test.ts.snap | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/monorepo/src/projects/typescript/monorepo-ts.ts b/packages/monorepo/src/projects/typescript/monorepo-ts.ts index 3aac34f73..2d96fec8f 100644 --- a/packages/monorepo/src/projects/typescript/monorepo-ts.ts +++ b/packages/monorepo/src/projects/typescript/monorepo-ts.ts @@ -171,6 +171,9 @@ export class MonorepoTsProject }, include: ["**/*.ts", ".projenrc.ts"], }, + peerDeps: ["nx@^16", ...(options.peerDeps || [])], + devDeps: ["nx@^16", "@aws/pdk@^0", ...(options.devDeps || [])], + deps: ["aws-cdk-lib", "constructs", "cdk-nag", ...(options.deps || [])], }); this.nxConfigurator = new NxConfigurator(this, { @@ -201,6 +204,12 @@ export class MonorepoTsProject ); break; } + case NodePackageManager.NPM: { + // Allow older versions of peer deps to resolv compatibility issues + this.tasks.tryFind("install")?.reset("npm install --legacy-peer-deps"); + this.tasks.tryFind("install:ci")?.reset("npm ci --legacy-peer-deps"); + break; + } } this.workspaceConfig = options.workspaceConfig; @@ -272,10 +281,6 @@ export class MonorepoTsProject }); } - // Add dependency on nx 16 - this.addPeerDeps("nx@^16"); - this.addDevDeps("nx@^16", "@aws/pdk@^0"); - this.addDeps("aws-cdk-lib", "constructs", "cdk-nag"); // Needed as this can be bundled in @aws/pdk this.package.addPackageResolutions( "@types/babel__traverse@7.18.2", "wrap-ansi@^7.0.0", diff --git a/packages/pdk/_scripts/exec-command.js b/packages/pdk/_scripts/exec-command.js index 96796b620..653ce4bf7 100755 --- a/packages/pdk/_scripts/exec-command.js +++ b/packages/pdk/_scripts/exec-command.js @@ -27,8 +27,8 @@ const engines = JSON.parse( ).engines; if (engines) { - const pkgMgr = engines.pnpm ? "pnpm" : engines.yarn ? "yarn" : "npm"; - execa.commandSync(`${pkgMgr}${isSynth ? " projen" : ""} ${process.argv.join(" ")}`, { stdio: "inherit" }); + const pkgMgrCmd = engines.pnpm ? "pnpm" : engines.yarn ? "yarn" : "npm run"; + execa.commandSync(`${pkgMgrCmd}${isSynth ? " default" : ""} ${process.argv.join(" ")}`, { stdio: "inherit" }); } else { execa.commandSync(`npx projen ${process.argv.join(" ")}`, { stdio: "inherit"}); } diff --git a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap index 06c4830ed..a85463edd 100644 --- a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap +++ b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap @@ -39615,7 +39615,7 @@ tsconfig.tsbuildinfo "name": "install", "steps": [ { - "exec": "npm install", + "exec": "npm install --legacy-peer-deps", }, ], }, @@ -39624,7 +39624,7 @@ tsconfig.tsbuildinfo "name": "install:ci", "steps": [ { - "exec": "npm ci", + "exec": "npm ci --legacy-peer-deps", }, ], }, From 17aa81bc559c86bb4d365b21000a7fdc47d145d3 Mon Sep 17 00:00:00 2001 From: Jack Stevenson Date: Wed, 18 Oct 2023 14:11:18 +1100 Subject: [PATCH 07/21] fix(type-safe-api): fix generated react hooks compilation issues (#605) @tanstack/react-query v5 was released earlier, and the hooks project did not pin the version resulting in code which failed to compile. Additionally the @paginated trait in Smithy specifies the Smithy member name which is not the name used in the final generated code, since Smithy -> OpenAPI translation will rename parameters to the name provided in the @httpHeader or @httpQuery traits. Additionally the generated typescript client will use valid parameter names, eg kebab-case becomes camelCase, so address this too. Fixes #604 --- .../type-safe-api/generators/post-process.ts | 6 + .../templates/hooks.handlebars | 2 +- .../parser/parse-openapi-spec.ts | 40 +- .../typescript-react-query-hooks-library.ts | 2 +- .../type-safe-api-project.test.ts.snap | 3 +- .../smithy/rename-pagination/model.json | 997 ++++++++++++++++++ .../smithy/rename-pagination/openapi.json | 165 +++ .../parse-openapi-spec.test.ts.snap | 184 ++++ .../scripts/parser/parse-openapi-spec.test.ts | 19 + 9 files changed, 1411 insertions(+), 7 deletions(-) create mode 100644 packages/type-safe-api/test/resources/smithy/rename-pagination/model.json create mode 100644 packages/type-safe-api/test/resources/smithy/rename-pagination/openapi.json diff --git a/packages/type-safe-api/scripts/type-safe-api/generators/post-process.ts b/packages/type-safe-api/scripts/type-safe-api/generators/post-process.ts index cd40c20ba..6e596eae1 100644 --- a/packages/type-safe-api/scripts/type-safe-api/generators/post-process.ts +++ b/packages/type-safe-api/scripts/type-safe-api/generators/post-process.ts @@ -3,6 +3,7 @@ SPDX-License-Identifier: Apache-2.0 */ import * as fs from "fs"; import * as path from "path"; import kebabCase from "lodash/kebabCase"; +import camelCase from "lodash/camelCase"; import { parse } from "ts-command-line-args"; // Used to split OpenAPI generated files into multiple files in order to work around @@ -32,6 +33,8 @@ const applyReplacementFunction = (functionConfig: FunctionConfig): string => { switch (functionConfig.function) { case "kebabCase": return kebabCase(functionConfig.args[0]); + case "camelCase": + return camelCase(functionConfig.args[0]); default: throw new Error(`Unsupported TSAPI_FN function ${functionConfig.function}`); } @@ -127,6 +130,9 @@ void (async () => { // Delete the original file fs.rmSync(filePath); + } else { + // Apply the replacement functions directly + fs.writeFileSync(filePath, applyReplacementFunctions(contents)); } } }); diff --git a/packages/type-safe-api/scripts/type-safe-api/generators/typescript-react-query-hooks/templates/hooks.handlebars b/packages/type-safe-api/scripts/type-safe-api/generators/typescript-react-query-hooks/templates/hooks.handlebars index 7b4c1848a..357e06b29 100644 --- a/packages/type-safe-api/scripts/type-safe-api/generators/typescript-react-query-hooks/templates/hooks.handlebars +++ b/packages/type-safe-api/scripts/type-safe-api/generators/typescript-react-query-hooks/templates/hooks.handlebars @@ -54,7 +54,7 @@ export const use{{operationIdCamelCase}} = ( if (!api) { throw NO_API_ERROR; } - return useInfiniteQuery(["{{nickname}}"{{#allParams.0}}, params{{/allParams.0}}], ({ pageParam }) => api.{{nickname}}({ {{#allParams.0}}...params, {{/allParams.0}}{{vendorExtensions.x-paginated.inputToken}}: pageParam }), { + return useInfiniteQuery(["{{nickname}}"{{#allParams.0}}, params{{/allParams.0}}], ({ pageParam }) => api.{{nickname}}({ {{#allParams.0}}...params, {{/allParams.0}}###TSAPI_FN###{"function": "camelCase", "args": ["{{vendorExtensions.x-paginated.inputToken}}"]}###/TSAPI_FN###: pageParam }), { getNextPageParam: (response) => response.{{vendorExtensions.x-paginated.outputToken}}, context: {{classname}}DefaultContext, ...options as any, diff --git a/packages/type-safe-api/scripts/type-safe-api/parser/parse-openapi-spec.ts b/packages/type-safe-api/scripts/type-safe-api/parser/parse-openapi-spec.ts index 49003f2f8..ef29abb79 100644 --- a/packages/type-safe-api/scripts/type-safe-api/parser/parse-openapi-spec.ts +++ b/packages/type-safe-api/scripts/type-safe-api/parser/parse-openapi-spec.ts @@ -3,24 +3,42 @@ SPDX-License-Identifier: Apache-2.0 */ import SwaggerParser from "@apidevtools/swagger-parser"; import { writeFile } from "projen/lib/util"; import { parse } from "ts-command-line-args"; -import * as path from 'path'; import * as _ from "lodash"; import fs from "fs"; -import type { OpenAPIV3 } from "openapi-types"; // Smithy HTTP trait is used to map Smithy operations to their location in the spec const SMITHY_HTTP_TRAIT_ID = "smithy.api#http"; +// The OpenAPI vendor extension used for paginated operations +const PAGINATED_VENDOR_EXTENSION = "x-paginated"; + +// Traits that will "rename" members in the generated OpenAPI spec +const SMITHY_RENAME_TRAITS = [ + "smithy.api#httpQuery", + "smithy.api#httpHeader", +]; + // Maps traits to specific vendor extensions which we also support specifying in OpenAPI const TRAIT_TO_SUPPORTED_OPENAPI_VENDOR_EXTENSION: { [key: string]: string } = { - "smithy.api#paginated": "x-paginated", + "smithy.api#paginated": PAGINATED_VENDOR_EXTENSION, }; +interface SmithyMember { + readonly target: string; + readonly traits?: { [key: string]: any }; +} + +interface SmithyOperationInput { + readonly type: string; + readonly members?: { [key: string]: SmithyMember } +} + interface SmithyOperationDetails { readonly id: string; readonly method: string; readonly path: string; readonly traits: { [key: string]: any }; + readonly input?: SmithyOperationInput; } interface InvalidRequestParameter { @@ -80,6 +98,7 @@ void (async () => { method: shape.traits[SMITHY_HTTP_TRAIT_ID].method?.toLowerCase(), path: shape.traits[SMITHY_HTTP_TRAIT_ID].uri, traits: shape.traits, + input: smithyModel.shapes[shape.input?.target], })); // Apply all operation-level traits as vendor extensions to the relevant operation in the spec @@ -96,7 +115,20 @@ void (async () => { if (traitId.endsWith("#handler")) { vendorExtension = "x-handler"; } - spec.paths[operation.path][operation.method][vendorExtension] = value; + + let extensionValue = value; + + // The smithy paginated trait is written in terms of inputs which may have different names in openapi + // so we must map them here + if (vendorExtension === PAGINATED_VENDOR_EXTENSION) { + extensionValue = Object.fromEntries(Object.entries(value as {[key: string]: string}).map(([traitProperty, memberName]) => { + const member = operation.input?.members?.[memberName]; + const renamedMemberName = SMITHY_RENAME_TRAITS.map(trait => member?.traits?.[trait]).find(x => x) ?? memberName; + return [traitProperty, renamedMemberName]; + })); + } + + spec.paths[operation.path][operation.method][vendorExtension] = extensionValue; }); } }); diff --git a/packages/type-safe-api/src/project/codegen/library/typescript-react-query-hooks-library.ts b/packages/type-safe-api/src/project/codegen/library/typescript-react-query-hooks-library.ts index d43904021..644924346 100644 --- a/packages/type-safe-api/src/project/codegen/library/typescript-react-query-hooks-library.ts +++ b/packages/type-safe-api/src/project/codegen/library/typescript-react-query-hooks-library.ts @@ -90,7 +90,7 @@ export class TypescriptReactQueryHooksLibrary extends TypeScriptProject { } // Add dependencies on react-query and react - this.addDeps("@tanstack/react-query"); + this.addDeps("@tanstack/react-query@^4"); // Pin at 4 for now - requires generated code updates to upgrade to 5 this.addDevDeps("react", "@types/react"); this.addPeerDeps("react"); diff --git a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap index a85463edd..2172e839a 100644 --- a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap +++ b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap @@ -27858,6 +27858,7 @@ tsconfig.esm.json { "name": "@tanstack/react-query", "type": "runtime", + "version": "^4", }, ], }, @@ -28244,7 +28245,7 @@ tsconfig.esm.json "generated/libraries/typescript-react-query-hooks/package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "dependencies": { - "@tanstack/react-query": "*", + "@tanstack/react-query": "^4", }, "devDependencies": { "@types/node": "^16", diff --git a/packages/type-safe-api/test/resources/smithy/rename-pagination/model.json b/packages/type-safe-api/test/resources/smithy/rename-pagination/model.json new file mode 100644 index 000000000..97f79d459 --- /dev/null +++ b/packages/type-safe-api/test/resources/smithy/rename-pagination/model.json @@ -0,0 +1,997 @@ +{ + "smithy": "2.0", + "metadata": { + "validators": [ + { + "configuration": { + "bindToTrait": "com.aws#handler", + "messageTemplate": " @{trait|com.aws#handler|language} is not supported by type-safe-api.\n Supported languages are \"typescript\", \"java\" and \"python\".\n", + "selector": " :not([@trait|com.aws#handler: @{language} = typescript, java, python])\n" + }, + "id": "SupportedLanguage", + "name": "EmitEachSelector" + }, + { + "configuration": { + "bindToTrait": "com.aws#handler", + "messageTemplate": " @@handler language @{trait|com.aws#handler|language} cannot be referenced unless a handler project is configured for this language.\n Configured handler project languages are: typescript.\n You can add this language by configuring TypeSafeApiProject in your .projenrc\n", + "selector": " [@trait|com.aws#handler: @{language} = typescript, java, python]\n :not([@trait|com.aws#handler: @{language} = typescript])\n" + }, + "id": "ConfiguredHandlerProject", + "name": "EmitEachSelector" + } + ] + }, + "shapes": { + "aws.api#ArnNamespace": { + "type": "string", + "traits": { + "smithy.api#documentation": "A string representing a service's ARN namespace.", + "smithy.api#pattern": "^[a-z0-9.\\-]{1,63}$", + "smithy.api#private": {} + } + }, + "aws.api#CloudFormationName": { + "type": "string", + "traits": { + "smithy.api#documentation": "A string representing a CloudFormation service name.", + "smithy.api#pattern": "^[A-Z][A-Za-z0-9]+$", + "smithy.api#private": {} + } + }, + "aws.api#TagOperationReference": { + "type": "string", + "traits": { + "smithy.api#documentation": "Points to an operation designated for a tagging APi", + "smithy.api#idRef": { + "failWhenMissing": true, + "selector": "resource > operation" + } + } + }, + "aws.api#TaggableApiConfig": { + "type": "structure", + "members": { + "tagApi": { + "target": "aws.api#TagOperationReference", + "traits": { + "smithy.api#documentation": "The `tagApi` property is a string value that references a non-instance\nor create operation that creates or updates tags on the resource.", + "smithy.api#required": {} + } + }, + "untagApi": { + "target": "aws.api#TagOperationReference", + "traits": { + "smithy.api#documentation": "The `untagApi` property is a string value that references a non-instance\noperation that removes tags on the resource.", + "smithy.api#required": {} + } + }, + "listTagsApi": { + "target": "aws.api#TagOperationReference", + "traits": { + "smithy.api#documentation": "The `listTagsApi` property is a string value that references a non-\ninstance operation which gets the current tags on the resource.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Structure representing the configuration of resource specific tagging APIs" + } + }, + "aws.api#arn": { + "type": "structure", + "members": { + "template": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Defines the ARN template. The provided string contains URI-template\nstyle label placeholders that contain the name of one of the identifiers\ndefined in the `identifiers` property of the resource. These labels can\nbe substituted at runtime with the actual identifiers of the resource.\nEvery identifier name of the resource MUST have corresponding label of\nthe same name. Note that percent-encoding **is not** performed on these\nplaceholder values; they are to be replaced literally. For relative ARN\ntemplates that have not set `absolute` to `true`, the template string\ncontains only the resource part of the ARN (for example,\n`foo/{MyResourceId}`). Relative ARNs MUST NOT start with \"/\".", + "smithy.api#required": {} + } + }, + "absolute": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Set to true to indicate that the ARN template contains a fully-formed\nARN that does not need to be merged with the service. This type of ARN\nMUST be used when the identifier of a resource is an ARN or is based on\nthe ARN identifier of a parent resource." + } + }, + "noRegion": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Set to true to specify that the ARN does not contain a region. If not\nset, or if set to false, the resolved ARN will contain a placeholder\nfor the region. This can only be set to true if `absolute` is not set\nor is false." + } + }, + "noAccount": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Set to true to specify that the ARN does not contain an account ID. If\nnot set, or if set to false, the resolved ARN will contain a placeholder\nfor the customer account ID. This can only be set to true if absolute\nis not set or is false." + } + } + }, + "traits": { + "smithy.api#documentation": "Specifies an ARN template for the resource.", + "smithy.api#externalDocumentation": { + "Reference": "https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html" + }, + "smithy.api#trait": { + "selector": "resource" + } + } + }, + "aws.api#arnReference": { + "type": "structure", + "members": { + "type": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The AWS CloudFormation resource type contained in the ARN." + } + }, + "resource": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "An absolute shape ID that references the Smithy resource type contained\nin the ARN (e.g., `com.foo#SomeResource`). The targeted resource is not\nrequired to be found in the model, allowing for external shapes to be\nreferenced without needing to take on an additional dependency. If the\nshape is found in the model, it MUST target a resource shape, and the\nresource MUST be found within the closure of the referenced service\nshape." + } + }, + "service": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The Smithy service absolute shape ID that is referenced by the ARN. The\ntargeted service is not required to be found in the model, allowing for\nexternal shapes to be referenced without needing to take on an\nadditional dependency." + } + } + }, + "traits": { + "smithy.api#documentation": "Marks a string as containing an ARN.", + "smithy.api#trait": { + "selector": "string" + } + } + }, + "aws.api#clientDiscoveredEndpoint": { + "type": "structure", + "members": { + "required": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "This field denotes whether or not this operation requires the use of a\nspecific endpoint. If this field is false, the standard regional\nendpoint for a service can handle this request. The client will start\nsending requests to the standard regional endpoint while working to\ndiscover a more specific endpoint.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Indicates that the target operation should use the client's endpoint\ndiscovery logic.", + "smithy.api#trait": { + "selector": "operation" + } + } + }, + "aws.api#clientEndpointDiscovery": { + "type": "structure", + "members": { + "operation": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Indicates the operation that clients should use to discover endpoints\nfor the service.", + "smithy.api#idRef": { + "failWhenMissing": true, + "selector": "operation" + }, + "smithy.api#required": {} + } + }, + "error": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Indicates the error that tells clients that the endpoint they are using\nis no longer valid. This error MUST be bound to any operation bound to\nthe service which is marked with the aws.api#clientDiscoveredEndpoint\ntrait.", + "smithy.api#idRef": { + "failWhenMissing": true, + "selector": "structure[trait|error]" + }, + "smithy.api#recommended": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Configures endpoint discovery for the service.", + "smithy.api#trait": { + "selector": "service" + } + } + }, + "aws.api#clientEndpointDiscoveryId": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#documentation": "Indicates members of the operation input which should be use to discover\nendpoints.", + "smithy.api#trait": { + "selector": "operation[trait|aws.api#clientDiscoveredEndpoint] -[input]->\nstructure > :test(member[trait|required] > string)" + } + } + }, + "aws.api#controlPlane": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#documentation": "Defines a service, resource, or operation as operating on the control plane.", + "smithy.api#trait": { + "selector": ":test(service, resource, operation)", + "conflicts": [ + "aws.api#dataPlane" + ] + } + } + }, + "aws.api#data": { + "type": "enum", + "members": { + "CUSTOMER_CONTENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#documentation": "Customer content means any software (including machine images), data,\ntext, audio, video or images that customers or any customer end user\ntransfers to AWS for processing, storage or hosting by AWS services in\nconnection with the customer’s accounts and any computational results\nthat customers or any customer end user derive from the foregoing\nthrough their use of AWS services.", + "smithy.api#enumValue": "content" + } + }, + "CUSTOMER_ACCOUNT_INFORMATION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#documentation": "Account information means information about customers that customers\nprovide to AWS in connection with the creation or administration of\ncustomers’ accounts.", + "smithy.api#enumValue": "account" + } + }, + "SERVICE_ATTRIBUTES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#documentation": "Service Attributes means service usage data related to a customer’s\naccount, such as resource identifiers, metadata tags, security and\naccess roles, rules, usage policies, permissions, usage statistics,\nlogging data, and analytics.", + "smithy.api#enumValue": "usage" + } + }, + "TAG_DATA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#documentation": "Designates metadata tags applied to AWS resources.", + "smithy.api#enumValue": "tagging" + } + }, + "PERMISSIONS_DATA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#documentation": "Designates security and access roles, rules, usage policies, and\npermissions.", + "smithy.api#enumValue": "permissions" + } + } + }, + "traits": { + "smithy.api#documentation": "Designates the target as containing data of a known classification level.", + "smithy.api#trait": { + "selector": ":test(simpleType, list, structure, union, member)" + } + } + }, + "aws.api#dataPlane": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#documentation": "Defines a service, resource, or operation as operating on the data plane.", + "smithy.api#trait": { + "selector": ":test(service, resource, operation)", + "conflicts": [ + "aws.api#controlPlane" + ] + } + } + }, + "aws.api#service": { + "type": "structure", + "members": { + "sdkId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The `sdkId` property is a required string value that specifies the AWS\nSDK service ID (e.g., \"API Gateway\"). This value is used for generating\nclient names in SDKs and for linking between services.", + "smithy.api#required": {} + } + }, + "arnNamespace": { + "target": "aws.api#ArnNamespace", + "traits": { + "smithy.api#documentation": "The `arnNamespace` property is a string value that defines the ARN service\nnamespace of the service (e.g., \"apigateway\"). This value is used in\nARNs assigned to resources in the service. If not set, this value\ndefaults to the lowercase name of the service shape." + } + }, + "cloudFormationName": { + "target": "aws.api#CloudFormationName", + "traits": { + "smithy.api#documentation": "The `cloudFormationName` property is a string value that specifies the\nAWS CloudFormation service name (e.g., `ApiGateway`). When not set,\nthis value defaults to the name of the service shape. This value is\npart of the CloudFormation resource type name that is automatically\nassigned to resources in the service (e.g., `AWS::::resourceName`)." + } + }, + "cloudTrailEventSource": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The `cloudTrailEventSource` property is a string value that defines the\nAWS customer-facing eventSource property contained in CloudTrail event\nrecords emitted by the service. If not specified, this value defaults\nto the `arnNamespace` plus `.amazonaws.com`." + } + }, + "endpointPrefix": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The `endpointPrefix` property is a string value that identifies which\nendpoint in a given region should be used to connect to the service.\nFor example, most services in the AWS standard partition have endpoints\nwhich follow the format: `{endpointPrefix}.{region}.amazonaws.com`. A\nservice with the endpoint prefix example in the region us-west-2 might\nhave the endpoint example.us-west-2.amazonaws.com.\n\nThis value is not unique across services and is subject to change.\nTherefore, it MUST NOT be used for client naming or for any other\npurpose that requires a static, unique identifier. sdkId should be used\nfor those purposes. Additionally, this value can be used to attempt to\nresolve endpoints." + } + } + }, + "traits": { + "smithy.api#documentation": "An AWS service is defined using the `aws.api#service` trait. This trait\nprovides information about the service like the name used to generate AWS\nSDK client classes and the namespace used in ARNs.", + "smithy.api#trait": { + "selector": "service" + } + } + }, + "aws.api#tagEnabled": { + "type": "structure", + "members": { + "disableDefaultOperations": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "The `disableDefaultOperations` property is a boolean value that specifies\nif the service does not have the standard tag operations supporting all\nresources on the service. Default value is `false`" + } + } + }, + "traits": { + "smithy.api#documentation": "Annotates a service as having tagging on 1 or more resources and associated\nAPIs to perform CRUD operations on those tags", + "smithy.api#trait": { + "selector": "service" + }, + "smithy.api#unstable": {} + } + }, + "aws.api#taggable": { + "type": "structure", + "members": { + "property": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The `property` property is a string value that identifies which\nresource property represents tags for the resource." + } + }, + "apiConfig": { + "target": "aws.api#TaggableApiConfig", + "traits": { + "smithy.api#documentation": "Specifies configuration for resource specific tagging APIs if the\nresource has them." + } + }, + "disableSystemTags": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Flag indicating if the resource is not able to carry AWS system level.\nUsed by service principals. Default value is `false`" + } + } + }, + "traits": { + "smithy.api#documentation": "Indicates a resource supports CRUD operations for tags. Either through\nresource lifecycle or instance operations or tagging operations on the\nservice.", + "smithy.api#trait": { + "selector": "resource" + }, + "smithy.api#unstable": {} + } + }, + "aws.auth#StringList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#private": {} + } + }, + "aws.auth#cognitoUserPools": { + "type": "structure", + "members": { + "providerArns": { + "target": "aws.auth#StringList", + "traits": { + "smithy.api#documentation": "A list of the Amazon Cognito user pool ARNs. Each element is of this\nformat: `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#authDefinition": {}, + "smithy.api#documentation": "Configures an Amazon Cognito User Pools auth scheme.", + "smithy.api#internal": {}, + "smithy.api#tags": [ + "internal" + ], + "smithy.api#trait": { + "selector": "service" + } + } + }, + "aws.auth#sigv4": { + "type": "structure", + "members": { + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The signature version 4 service signing name to use in the credential\nscope when signing requests. This value SHOULD match the `arnNamespace`\nproperty of the `aws.api#service-trait`.", + "smithy.api#externalDocumentation": { + "Reference": "https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html" + }, + "smithy.api#length": { + "min": 1 + }, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#authDefinition": { + "traits": [ + "aws.auth#unsignedPayload" + ] + }, + "smithy.api#documentation": "Signature Version 4 is the process to add authentication information to\nAWS requests sent by HTTP. For security, most requests to AWS must be\nsigned with an access key, which consists of an access key ID and secret\naccess key. These two keys are commonly referred to as your security\ncredentials.", + "smithy.api#externalDocumentation": { + "Reference": "https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html" + }, + "smithy.api#trait": { + "selector": "service" + } + } + }, + "aws.auth#unsignedPayload": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#documentation": "Indicates that the request payload of a signed request is not to be used\nas part of the signature.", + "smithy.api#trait": { + "selector": "operation" + } + } + }, + "aws.customizations#s3UnwrappedXmlOutput": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#documentation": "Indicates the response body from S3 is not wrapped in the\naws-restxml-protocol operation-level XML node. Intended to only be used by\nAWS S3.", + "smithy.api#trait": { + "selector": "operation" + } + } + }, + "aws.protocols#ChecksumAlgorithm": { + "type": "enum", + "members": { + "CRC32C": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#documentation": "CRC32C", + "smithy.api#enumValue": "CRC32C" + } + }, + "CRC32": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#documentation": "CRC32", + "smithy.api#enumValue": "CRC32" + } + }, + "SHA1": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#documentation": "SHA1", + "smithy.api#enumValue": "SHA1" + } + }, + "SHA256": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#documentation": "SHA256", + "smithy.api#enumValue": "SHA256" + } + } + }, + "traits": { + "smithy.api#private": {} + } + }, + "aws.protocols#ChecksumAlgorithmSet": { + "type": "list", + "member": { + "target": "aws.protocols#ChecksumAlgorithm" + }, + "traits": { + "smithy.api#length": { + "min": 1 + }, + "smithy.api#private": {}, + "smithy.api#uniqueItems": {} + } + }, + "aws.protocols#HttpConfiguration": { + "type": "structure", + "members": { + "http": { + "target": "aws.protocols#StringList", + "traits": { + "smithy.api#documentation": "The priority ordered list of supported HTTP protocol versions." + } + }, + "eventStreamHttp": { + "target": "aws.protocols#StringList", + "traits": { + "smithy.api#documentation": "The priority ordered list of supported HTTP protocol versions that\nare required when using event streams with the service. If not set,\nthis value defaults to the value of the `http` member. Any entry in\n`eventStreamHttp` MUST also appear in `http`." + } + } + }, + "traits": { + "smithy.api#documentation": "Contains HTTP protocol configuration for HTTP-based protocols.", + "smithy.api#mixin": { + "localTraits": [ + "smithy.api#private" + ] + }, + "smithy.api#private": {} + } + }, + "aws.protocols#StringList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#private": {} + } + }, + "aws.protocols#awsJson1_0": { + "type": "structure", + "mixins": [ + { + "target": "aws.protocols#HttpConfiguration" + } + ], + "members": {}, + "traits": { + "smithy.api#documentation": "An RPC-based protocol that sends JSON payloads. This protocol does not use\nHTTP binding traits.", + "smithy.api#protocolDefinition": { + "traits": [ + "smithy.api#timestampFormat", + "smithy.api#cors", + "smithy.api#endpoint", + "smithy.api#hostLabel" + ] + }, + "smithy.api#trait": { + "selector": "service" + } + } + }, + "aws.protocols#awsJson1_1": { + "type": "structure", + "mixins": [ + { + "target": "aws.protocols#HttpConfiguration" + } + ], + "members": {}, + "traits": { + "smithy.api#documentation": "An RPC-based protocol that sends JSON payloads. This protocol does not use\nHTTP binding traits.", + "smithy.api#protocolDefinition": { + "traits": [ + "smithy.api#timestampFormat", + "smithy.api#cors", + "smithy.api#endpoint", + "smithy.api#hostLabel" + ] + }, + "smithy.api#trait": { + "selector": "service" + } + } + }, + "aws.protocols#awsQuery": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#deprecated": {}, + "smithy.api#documentation": "An RPC-based protocol that sends 'POST' requests in the body as\n`x-www-form-urlencoded` strings and responses in XML documents. This\nprotocol does not use HTTP binding traits.", + "smithy.api#protocolDefinition": { + "noInlineDocumentSupport": true, + "traits": [ + "aws.protocols#awsQueryError", + "smithy.api#xmlAttribute", + "smithy.api#xmlFlattened", + "smithy.api#xmlName", + "smithy.api#xmlNamespace", + "smithy.api#timestampFormat", + "smithy.api#cors", + "smithy.api#endpoint", + "smithy.api#hostLabel" + ] + }, + "smithy.api#trait": { + "selector": "service [trait|xmlNamespace]" + } + } + }, + "aws.protocols#awsQueryCompatible": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#documentation": "Enable backward compatibility when migrating from awsQuery to awsJson protocol", + "smithy.api#trait": { + "selector": "service [trait|aws.protocols#awsJson1_0]" + } + } + }, + "aws.protocols#awsQueryError": { + "type": "structure", + "members": { + "code": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The value used to distinguish this error shape during serialization.", + "smithy.api#required": {} + } + }, + "httpResponseCode": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "The HTTP response code used on a response containing this error shape.", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Provides the value in the 'Code' distinguishing field and HTTP response\ncode for an operation error.", + "smithy.api#trait": { + "selector": "structure [trait|error]", + "breakingChanges": [ + { + "change": "any" + } + ] + } + } + }, + "aws.protocols#ec2Query": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#deprecated": {}, + "smithy.api#documentation": "An RPC-based protocol that sends 'POST' requests in the body as Amazon EC2\nformatted `x-www-form-urlencoded` strings and responses in XML documents.\nThis protocol does not use HTTP binding traits.", + "smithy.api#protocolDefinition": { + "noInlineDocumentSupport": true, + "traits": [ + "aws.protocols#ec2QueryName", + "smithy.api#xmlAttribute", + "smithy.api#xmlFlattened", + "smithy.api#xmlName", + "smithy.api#xmlNamespace", + "smithy.api#timestampFormat", + "smithy.api#cors", + "smithy.api#endpoint", + "smithy.api#hostLabel" + ] + }, + "smithy.api#trait": { + "selector": "service [trait|xmlNamespace]" + } + } + }, + "aws.protocols#ec2QueryName": { + "type": "string", + "traits": { + "smithy.api#documentation": "Indicates the serialized name of a structure member when that structure is\nserialized for the input of an EC2 operation.", + "smithy.api#pattern": "^[a-zA-Z_][a-zA-Z_0-9-]*$", + "smithy.api#trait": { + "selector": "structure > member" + } + } + }, + "aws.protocols#httpChecksum": { + "type": "structure", + "members": { + "requestAlgorithmMember": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Defines a top-level operation input member that is used to configure\nrequest checksum behavior." + } + }, + "requestChecksumRequired": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "Indicates an operation requires a checksum in its HTTP request." + } + }, + "requestValidationModeMember": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "Defines a top-level operation input member used to opt-in to response\nchecksum validation." + } + }, + "responseAlgorithms": { + "target": "aws.protocols#ChecksumAlgorithmSet", + "traits": { + "smithy.api#documentation": "Defines the checksum algorithms clients should look for when performing\nHTTP response checksum validation." + } + } + }, + "traits": { + "smithy.api#documentation": "Indicates that an operation supports checksum validation.", + "smithy.api#trait": { + "selector": "operation" + }, + "smithy.api#unstable": {} + } + }, + "aws.protocols#restJson1": { + "type": "structure", + "mixins": [ + { + "target": "aws.protocols#HttpConfiguration" + } + ], + "members": {}, + "traits": { + "smithy.api#documentation": "A RESTful protocol that sends JSON in structured payloads.", + "smithy.api#protocolDefinition": { + "traits": [ + "smithy.api#cors", + "smithy.api#endpoint", + "smithy.api#hostLabel", + "smithy.api#http", + "smithy.api#httpError", + "smithy.api#httpHeader", + "smithy.api#httpLabel", + "smithy.api#httpPayload", + "smithy.api#httpPrefixHeaders", + "smithy.api#httpQuery", + "smithy.api#httpQueryParams", + "smithy.api#httpResponseCode", + "smithy.api#jsonName", + "smithy.api#timestampFormat" + ] + }, + "smithy.api#trait": { + "selector": "service" + } + } + }, + "aws.protocols#restXml": { + "type": "structure", + "mixins": [ + { + "target": "aws.protocols#HttpConfiguration" + } + ], + "members": { + "noErrorWrapping": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#deprecated": {}, + "smithy.api#documentation": "Disables the serialization wrapping of error properties in an 'Error'\nXML element." + } + } + }, + "traits": { + "smithy.api#deprecated": {}, + "smithy.api#documentation": "A RESTful protocol that sends XML in structured payloads.", + "smithy.api#protocolDefinition": { + "noInlineDocumentSupport": true, + "traits": [ + "smithy.api#cors", + "smithy.api#endpoint", + "smithy.api#hostLabel", + "smithy.api#http", + "smithy.api#httpError", + "smithy.api#httpHeader", + "smithy.api#httpLabel", + "smithy.api#httpPayload", + "smithy.api#httpPrefixHeaders", + "smithy.api#httpQuery", + "smithy.api#httpQueryParams", + "smithy.api#httpResponseCode", + "smithy.api#xmlAttribute", + "smithy.api#xmlFlattened", + "smithy.api#xmlName", + "smithy.api#xmlNamespace" + ] + }, + "smithy.api#trait": { + "selector": "service" + } + } + }, + "com.aws#BadRequestError": { + "type": "structure", + "members": { + "message": { + "target": "com.aws#ErrorMessage", + "traits": { + "smithy.api#documentation": "Message with details about the error", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "An error at the fault of the client sending invalid input", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.aws#ErrorMessage": { + "type": "string", + "traits": { + "smithy.api#documentation": "An error message" + } + }, + "com.aws#InternalFailureError": { + "type": "structure", + "members": { + "message": { + "target": "com.aws#ErrorMessage", + "traits": { + "smithy.api#documentation": "Message with details about the error", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "An internal failure at the fault of the server", + "smithy.api#error": "server", + "smithy.api#httpError": 500 + } + }, + "com.aws#Messages": { + "type": "list", + "member": { + "target": "smithy.api#String" + } + }, + "com.aws#MyService": { + "type": "service", + "version": "1.0", + "operations": [ + { + "target": "com.aws#SayHello" + } + ], + "errors": [ + { + "target": "com.aws#BadRequestError" + }, + { + "target": "com.aws#InternalFailureError" + }, + { + "target": "com.aws#NotAuthorizedError" + } + ], + "traits": { + "aws.protocols#restJson1": {}, + "smithy.api#documentation": "A sample smithy api" + } + }, + "com.aws#NotAuthorizedError": { + "type": "structure", + "members": { + "message": { + "target": "com.aws#ErrorMessage", + "traits": { + "smithy.api#documentation": "Message with details about the error", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "An error due to the client not being authorized to access the resource", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.aws#NotFoundError": { + "type": "structure", + "members": { + "message": { + "target": "com.aws#ErrorMessage", + "traits": { + "smithy.api#documentation": "Message with details about the error", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "An error due to the client attempting to access a missing resource", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.aws#SayHello": { + "type": "operation", + "input": { + "target": "com.aws#SayHelloInput" + }, + "output": { + "target": "com.aws#SayHelloOutput" + }, + "errors": [ + { + "target": "com.aws#NotFoundError" + } + ], + "traits": { + "com.aws#handler": { + "language": "typescript" + }, + "smithy.api#http": { + "method": "GET", + "uri": "/hello" + }, + "smithy.api#paginated": { + "inputToken": "inToken", + "outputToken": "outToken", + "items": "messages", + "pageSize": "pageSize" + }, + "smithy.api#readonly": {} + } + }, + "com.aws#SayHelloInput": { + "type": "structure", + "members": { + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "name", + "smithy.api#required": {} + } + }, + "pageSize": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#httpHeader": "x-page-size" + } + }, + "inToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#httpQuery": "myInToken" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.aws#SayHelloOutput": { + "type": "structure", + "members": { + "messages": { + "target": "com.aws#Messages", + "traits": { + "smithy.api#required": {} + } + }, + "outToken": { + "target": "smithy.api#String" + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.aws#handler": { + "type": "structure", + "members": { + "language": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "The language you will implement the lambda in.\nValid values: typescript, java, python", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "Add this trait to an operation to generate a lambda handler stub for the operation.\nYou have configured handler projects for typescript", + "smithy.api#trait": { + "selector": "operation" + } + } + } + } +} diff --git a/packages/type-safe-api/test/resources/smithy/rename-pagination/openapi.json b/packages/type-safe-api/test/resources/smithy/rename-pagination/openapi.json new file mode 100644 index 000000000..eee12ae1a --- /dev/null +++ b/packages/type-safe-api/test/resources/smithy/rename-pagination/openapi.json @@ -0,0 +1,165 @@ +{ + "openapi": "3.0.2", + "info": { + "title": "MyService", + "version": "1.0", + "description": "A sample smithy api" + }, + "paths": { + "/hello": { + "get": { + "operationId": "SayHello", + "parameters": [ + { + "name": "name", + "in": "query", + "schema": { + "type": "string" + }, + "required": true + }, + { + "name": "myInToken", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "x-page-size", + "in": "header", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "SayHello 200 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SayHelloResponseContent" + } + } + } + }, + "400": { + "description": "BadRequestError 400 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestErrorResponseContent" + } + } + } + }, + "403": { + "description": "NotAuthorizedError 403 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotAuthorizedErrorResponseContent" + } + } + } + }, + "404": { + "description": "NotFoundError 404 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorResponseContent" + } + } + } + }, + "500": { + "description": "InternalFailureError 500 response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalFailureErrorResponseContent" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "BadRequestErrorResponseContent": { + "type": "object", + "description": "An error at the fault of the client sending invalid input", + "properties": { + "message": { + "type": "string", + "description": "Message with details about the error" + } + }, + "required": [ + "message" + ] + }, + "InternalFailureErrorResponseContent": { + "type": "object", + "description": "An internal failure at the fault of the server", + "properties": { + "message": { + "type": "string", + "description": "Message with details about the error" + } + }, + "required": [ + "message" + ] + }, + "NotAuthorizedErrorResponseContent": { + "type": "object", + "description": "An error due to the client not being authorized to access the resource", + "properties": { + "message": { + "type": "string", + "description": "Message with details about the error" + } + }, + "required": [ + "message" + ] + }, + "NotFoundErrorResponseContent": { + "type": "object", + "description": "An error due to the client attempting to access a missing resource", + "properties": { + "message": { + "type": "string", + "description": "Message with details about the error" + } + }, + "required": [ + "message" + ] + }, + "SayHelloResponseContent": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "items": { + "type": "string" + } + }, + "outToken": { + "type": "string" + } + }, + "required": [ + "messages" + ] + } + } + } +} diff --git a/packages/type-safe-api/test/scripts/parser/__snapshots__/parse-openapi-spec.test.ts.snap b/packages/type-safe-api/test/scripts/parser/__snapshots__/parse-openapi-spec.test.ts.snap index 75670fc6c..cd167b254 100644 --- a/packages/type-safe-api/test/scripts/parser/__snapshots__/parse-openapi-spec.test.ts.snap +++ b/packages/type-safe-api/test/scripts/parser/__snapshots__/parse-openapi-spec.test.ts.snap @@ -367,6 +367,190 @@ exports[`Parse OpenAPI Spec Script Unit Tests Injects @handler and @paginated tr } `; +exports[`Parse OpenAPI Spec Script Unit Tests Maps renamed @paginated traits for query and header parameters 1`] = ` +{ + ".api.json": { + "components": { + "schemas": { + "BadRequestErrorResponseContent": { + "description": "An error at the fault of the client sending invalid input", + "properties": { + "message": { + "description": "Message with details about the error", + "type": "string", + }, + }, + "required": [ + "message", + ], + "type": "object", + }, + "InternalFailureErrorResponseContent": { + "description": "An internal failure at the fault of the server", + "properties": { + "message": { + "description": "Message with details about the error", + "type": "string", + }, + }, + "required": [ + "message", + ], + "type": "object", + }, + "NotAuthorizedErrorResponseContent": { + "description": "An error due to the client not being authorized to access the resource", + "properties": { + "message": { + "description": "Message with details about the error", + "type": "string", + }, + }, + "required": [ + "message", + ], + "type": "object", + }, + "NotFoundErrorResponseContent": { + "description": "An error due to the client attempting to access a missing resource", + "properties": { + "message": { + "description": "Message with details about the error", + "type": "string", + }, + }, + "required": [ + "message", + ], + "type": "object", + }, + "SayHelloResponseContent": { + "properties": { + "messages": { + "items": { + "type": "string", + }, + "type": "array", + }, + "outToken": { + "type": "string", + }, + }, + "required": [ + "messages", + ], + "type": "object", + }, + }, + }, + "info": { + "description": "A sample smithy api", + "title": "MyService", + "version": "1.0", + }, + "openapi": "3.0.2", + "paths": { + "/hello": { + "get": { + "operationId": "SayHello", + "parameters": [ + { + "in": "query", + "name": "name", + "required": true, + "schema": { + "type": "string", + }, + }, + { + "in": "query", + "name": "myInToken", + "schema": { + "type": "string", + }, + }, + { + "in": "header", + "name": "x-page-size", + "schema": { + "format": "int32", + "type": "integer", + }, + }, + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SayHelloResponseContent", + }, + }, + }, + "description": "SayHello 200 response", + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestErrorResponseContent", + }, + }, + }, + "description": "BadRequestError 400 response", + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotAuthorizedErrorResponseContent", + }, + }, + }, + "description": "NotAuthorizedError 403 response", + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundErrorResponseContent", + }, + }, + }, + "description": "NotFoundError 404 response", + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalFailureErrorResponseContent", + }, + }, + }, + "description": "InternalFailureError 500 response", + }, + }, + "x-handler": { + "language": "typescript", + }, + "x-paginated": { + "inputToken": "myInToken", + "items": "messages", + "outputToken": "outToken", + "pageSize": "x-page-size", + }, + "x-smithy.api#http": { + "method": "GET", + "uri": "/hello", + }, + "x-smithy.api#readonly": {}, + }, + }, + }, + }, +} +`; + exports[`Parse OpenAPI Spec Script Unit Tests Permits parameter references (and circular references) 1`] = ` { ".api.json": { diff --git a/packages/type-safe-api/test/scripts/parser/parse-openapi-spec.test.ts b/packages/type-safe-api/test/scripts/parser/parse-openapi-spec.test.ts index bffc94ea6..5b16b0c14 100644 --- a/packages/type-safe-api/test/scripts/parser/parse-openapi-spec.test.ts +++ b/packages/type-safe-api/test/scripts/parser/parse-openapi-spec.test.ts @@ -41,6 +41,25 @@ describe("Parse OpenAPI Spec Script Unit Tests", () => { ).toMatchSnapshot(); }); + it("Maps renamed @paginated traits for query and header parameters", () => { + expect( + withTmpDirSnapshot(os.tmpdir(), (tmpDir) => { + const specPath = + "../../resources/smithy/rename-pagination/openapi.json"; + const smithyJsonModelPath = + "../../resources/smithy/rename-pagination/model.json"; + const outputPath = path.join( + path.relative(path.resolve(__dirname), tmpDir), + ".api.json" + ); + const command = `../../../scripts/type-safe-api/parser/parse-openapi-spec --spec-path ${specPath} --output-path ${outputPath} --smithy-json-path ${smithyJsonModelPath}`; + exec(command, { + cwd: path.resolve(__dirname), + }); + }) + ).toMatchSnapshot(); + }); + it("Throws for unsupported request parameter types", () => { withTmpDirSnapshot(os.tmpdir(), (tmpDir) => { const specPath = "../../resources/specs/invalid-request-parameters.yaml"; From c92239031086466f12d902614ef77413a8486e0e Mon Sep 17 00:00:00 2001 From: Jack Stevenson Date: Fri, 20 Oct 2023 10:03:06 +1100 Subject: [PATCH 08/21] fix(type-safe-api): fix typescript handler dist path for operations with inline request bodies (#607) When an operation has inline request body schemas (rather than a $ref) in OpenAPI, the operation ID is suffixed with "Operation" in the generated code, but the operation nickname remains unchanged. Previously, the operation ID was used for the handler dist reference in the generated functions, but the nickname was used to generate the actual filename. Address this by using the nickname in both places for typescript generated functions. Fixes #606 --- .../templates/functions.handlebars | 2 +- .../test/resources/specs/inline-body.yaml | 86 ++++ .../java-cdk-infrastructure.test.ts.snap | 420 +++++++++++++++++- .../python-cdk-infrastructure.test.ts.snap | 63 ++- ...typescript-cdk-infrastructure.test.ts.snap | 81 +++- .../java-cdk-infrastructure.test.ts | 93 ++-- .../python-cdk-infrastructure.test.ts | 71 +-- .../typescript-cdk-infrastructure.test.ts | 65 +-- 8 files changed, 767 insertions(+), 114 deletions(-) create mode 100644 packages/type-safe-api/test/resources/specs/inline-body.yaml diff --git a/packages/type-safe-api/scripts/type-safe-api/generators/typescript-cdk-infrastructure/templates/functions.handlebars b/packages/type-safe-api/scripts/type-safe-api/generators/typescript-cdk-infrastructure/templates/functions.handlebars index bb9bca4d0..ea5769aca 100644 --- a/packages/type-safe-api/scripts/type-safe-api/generators/typescript-cdk-infrastructure/templates/functions.handlebars +++ b/packages/type-safe-api/scripts/type-safe-api/generators/typescript-cdk-infrastructure/templates/functions.handlebars @@ -46,7 +46,7 @@ export class {{operationIdCamelCase}}Function extends {{#startsWith vendorExtens code: Code.fromAsset(path.resolve(__dirname, "..", {{#startsWith vendorExtensions.x-handler.language 'typescript' ~}} "{{#apiInfo}}{{#apis.0}}{{vendorExtensions.x-handlers-typescript-asset-path}}{{/apis.0}}{{/apiInfo}}", - "###TSAPI_FN###{ "function": "kebabCase", "args": ["{{operationIdCamelCase}}"] }###/TSAPI_FN###", + "###TSAPI_FN###{ "function": "kebabCase", "args": ["{{nickname}}"] }###/TSAPI_FN###", {{~/startsWith}}{{#startsWith vendorExtensions.x-handler.language 'python' ~}} "{{#apiInfo}}{{#apis.0}}{{vendorExtensions.x-handlers-python-asset-path}}{{/apis.0}}{{/apiInfo}}", {{~/startsWith}}{{#startsWith vendorExtensions.x-handler.language 'java' ~}} diff --git a/packages/type-safe-api/test/resources/specs/inline-body.yaml b/packages/type-safe-api/test/resources/specs/inline-body.yaml new file mode 100644 index 000000000..0637c1ffd --- /dev/null +++ b/packages/type-safe-api/test/resources/specs/inline-body.yaml @@ -0,0 +1,86 @@ +openapi: 3.0.3 +info: + version: 1.0.0 + title: Test +paths: + /typescript: + post: + operationId: typescriptTest + x-handler: + language: typescript + requestBody: + required: true + content: + application/json: + # Schema is inline rather than a $ref + schema: + type: object + properties: + field1: + type: string + field2: + type: string + responses: + 200: + description: OK + content: + 'application/json': + schema: + $ref: '#/components/schemas/TestResponseContent' + /java: + post: + operationId: javaTest + x-handler: + language: java + requestBody: + required: true + content: + application/json: + # Schema is inline rather than a $ref + schema: + type: object + properties: + field1: + type: string + field2: + type: string + responses: + 200: + description: OK + content: + 'application/json': + schema: + $ref: '#/components/schemas/TestResponseContent' + /python: + post: + operationId: pythonTest + x-handler: + language: python + requestBody: + required: true + content: + application/json: + # Schema is inline rather than a $ref + schema: + type: object + properties: + field1: + type: string + field2: + type: string + responses: + 200: + description: OK + content: + 'application/json': + schema: + $ref: '#/components/schemas/TestResponseContent' +components: + schemas: + TestResponseContent: + type: object + properties: + message: + type: string + required: + - message diff --git a/packages/type-safe-api/test/scripts/generators/__snapshots__/java-cdk-infrastructure.test.ts.snap b/packages/type-safe-api/test/scripts/generators/__snapshots__/java-cdk-infrastructure.test.ts.snap index 1b9d46a7d..d3b517e19 100644 --- a/packages/type-safe-api/test/scripts/generators/__snapshots__/java-cdk-infrastructure.test.ts.snap +++ b/packages/type-safe-api/test/scripts/generators/__snapshots__/java-cdk-infrastructure.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Java Infrastructure Code Generation Script Unit Tests Generates Functions 1`] = ` +exports[`Java Infrastructure Code Generation Script Unit Tests Generates Functions for handlers.yaml 1`] = ` [ [ "infra/src/main/java/test/test-infra/infra/functions/JavaOneFunction.java", @@ -832,6 +832,424 @@ public class TypescriptTwoFunctionProps implements FunctionProps { ] `; +exports[`Java Infrastructure Code Generation Script Unit Tests Generates Functions for inline-body.yaml 1`] = ` +[ + [ + "infra/src/main/java/test/test-infra/infra/functions/JavaTestFunction.java", + "package test.test-infra.infra.functions; + +import org.jetbrains.annotations.NotNull; +import software.amazon.awscdk.services.lambda.Function; +import software.aws.pdk.type_safe_api.SnapStartFunction; +import software.constructs.Construct; + +/** + * Lambda function construct which points to the java implementation of JavaTest + */ +public class JavaTestFunction extends SnapStartFunction { + public JavaTestFunction(@NotNull Construct scope, @NotNull String id, @NotNull JavaTestFunctionProps props) { + super(scope, id, props); + } + + public JavaTestFunction(@NotNull Construct scope, @NotNull String id) { + this(scope, id, JavaTestFunctionProps.builder().build()); + } +} +", + ], + [ + "infra/src/main/java/test/test-infra/infra/functions/JavaTestFunctionProps.java", + "package test.test-infra.infra.functions; + +import org.jetbrains.annotations.NotNull; +import software.amazon.awscdk.Duration; +import software.amazon.awscdk.Size; +import software.amazon.awscdk.services.codeguruprofiler.IProfilingGroup; +import software.amazon.awscdk.services.ec2.ISecurityGroup; +import software.amazon.awscdk.services.ec2.IVpc; +import software.amazon.awscdk.services.ec2.SubnetSelection; +import software.amazon.awscdk.services.iam.IRole; +import software.amazon.awscdk.services.iam.PolicyStatement; +import software.amazon.awscdk.services.kms.IKey; +import software.amazon.awscdk.services.lambda.AdotInstrumentationConfig; +import software.amazon.awscdk.services.lambda.Architecture; +import software.amazon.awscdk.services.lambda.Code; +import software.amazon.awscdk.services.lambda.FileSystem; +import software.amazon.awscdk.services.lambda.FunctionProps; +import software.amazon.awscdk.services.lambda.ICodeSigningConfig; +import software.amazon.awscdk.services.lambda.IDestination; +import software.amazon.awscdk.services.lambda.IEventSource; +import software.amazon.awscdk.services.lambda.ILayerVersion; +import software.amazon.awscdk.services.lambda.LambdaInsightsVersion; +import software.amazon.awscdk.services.lambda.LogRetentionRetryOptions; +import software.amazon.awscdk.services.lambda.ParamsAndSecretsLayerVersion; +import software.amazon.awscdk.services.lambda.Runtime; +import software.amazon.awscdk.services.lambda.RuntimeManagementMode; +import software.amazon.awscdk.services.lambda.Tracing; +import software.amazon.awscdk.services.lambda.VersionOptions; +import software.amazon.awscdk.services.logs.RetentionDays; +import software.amazon.awscdk.services.sns.ITopic; +import software.amazon.awscdk.services.sqs.IQueue; +import software.aws.pdk.type_safe_api.SnapStartFunctionProps; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.file.Paths; +import java.util.List; +import java.util.Map; + +@lombok.Builder @lombok.Getter +public class JavaTestFunctionProps implements SnapStartFunctionProps { + private static String infraProjectAbsolutePath; + + static { + try { + try (InputStream stream = JavaTestFunctionProps.class.getClassLoader() + .getResourceAsStream("project-absolute-path.txt")) { + try (InputStreamReader inputStreamReader = new InputStreamReader(stream)) { + infraProjectAbsolutePath = new BufferedReader(inputStreamReader).lines().findFirst() + .orElseThrow(() -> new RuntimeException("No project-absolute-path.txt resource found")); + } + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + // Fixed props + private final Code code = Code.fromAsset(Paths.get(infraProjectAbsolutePath).resolve( + "../java-handlers/dist/java/test/com.aws.pdk.test.handlers/1.0.0/com.aws.pdk.test.handlers-1.0.0.jar" + ).toAbsolutePath().toString()); + private final String handler = "test.test-java-handlers.handlers.JavaTestHandler"; + private final Runtime runtime = Runtime.JAVA_17; + + // Props with defaults + @lombok.Builder.Default + Duration timeout = Duration.seconds(30); + @lombok.Builder.Default + Tracing tracing = Tracing.ACTIVE; + + // Remaining Function Props + AdotInstrumentationConfig adotInstrumentation; + Boolean allowAllOutbound; + Boolean allowPublicSubnet; + Architecture architecture; + ICodeSigningConfig codeSigningConfig; + VersionOptions currentVersionOptions; + IQueue deadLetterQueue; + Boolean deadLetterQueueEnabled; + ITopic deadLetterTopic; + String description; + Map environment; + IKey environmentEncryption; + Size ephemeralStorageSize; + List events; + FileSystem filesystem; + String functionName; + List initialPolicy; + LambdaInsightsVersion insightsVersion; + List layers; + RetentionDays logRetention; + LogRetentionRetryOptions logRetentionRetryOptions; + IRole logRetentionRole; + Number memorySize; + ParamsAndSecretsLayerVersion paramsAndSecrets; + Boolean profiling; + IProfilingGroup profilingGroup; + Number reservedConcurrentExecutions; + IRole role; + RuntimeManagementMode runtimeManagementMode; + List securityGroups; + IVpc vpc; + SubnetSelection vpcSubnets; + Duration maxEventAge; + IDestination onFailure; + IDestination onSuccess; + Number retryAttempts; +} + +", + ], + [ + "infra/src/main/java/test/test-infra/infra/functions/PythonTestFunction.java", + "package test.test-infra.infra.functions; + +import org.jetbrains.annotations.NotNull; +import software.amazon.awscdk.services.lambda.Function; +import software.aws.pdk.type_safe_api.SnapStartFunction; +import software.constructs.Construct; + +/** + * Lambda function construct which points to the python implementation of PythonTest + */ +public class PythonTestFunction extends Function { + public PythonTestFunction(@NotNull Construct scope, @NotNull String id, @NotNull PythonTestFunctionProps props) { + super(scope, id, props); + } + + public PythonTestFunction(@NotNull Construct scope, @NotNull String id) { + this(scope, id, PythonTestFunctionProps.builder().build()); + } +} +", + ], + [ + "infra/src/main/java/test/test-infra/infra/functions/PythonTestFunctionProps.java", + "package test.test-infra.infra.functions; + +import org.jetbrains.annotations.NotNull; +import software.amazon.awscdk.Duration; +import software.amazon.awscdk.Size; +import software.amazon.awscdk.services.codeguruprofiler.IProfilingGroup; +import software.amazon.awscdk.services.ec2.ISecurityGroup; +import software.amazon.awscdk.services.ec2.IVpc; +import software.amazon.awscdk.services.ec2.SubnetSelection; +import software.amazon.awscdk.services.iam.IRole; +import software.amazon.awscdk.services.iam.PolicyStatement; +import software.amazon.awscdk.services.kms.IKey; +import software.amazon.awscdk.services.lambda.AdotInstrumentationConfig; +import software.amazon.awscdk.services.lambda.Architecture; +import software.amazon.awscdk.services.lambda.Code; +import software.amazon.awscdk.services.lambda.FileSystem; +import software.amazon.awscdk.services.lambda.FunctionProps; +import software.amazon.awscdk.services.lambda.ICodeSigningConfig; +import software.amazon.awscdk.services.lambda.IDestination; +import software.amazon.awscdk.services.lambda.IEventSource; +import software.amazon.awscdk.services.lambda.ILayerVersion; +import software.amazon.awscdk.services.lambda.LambdaInsightsVersion; +import software.amazon.awscdk.services.lambda.LogRetentionRetryOptions; +import software.amazon.awscdk.services.lambda.ParamsAndSecretsLayerVersion; +import software.amazon.awscdk.services.lambda.Runtime; +import software.amazon.awscdk.services.lambda.RuntimeManagementMode; +import software.amazon.awscdk.services.lambda.Tracing; +import software.amazon.awscdk.services.lambda.VersionOptions; +import software.amazon.awscdk.services.logs.RetentionDays; +import software.amazon.awscdk.services.sns.ITopic; +import software.amazon.awscdk.services.sqs.IQueue; +import software.aws.pdk.type_safe_api.SnapStartFunctionProps; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.file.Paths; +import java.util.List; +import java.util.Map; + +@lombok.Builder @lombok.Getter +public class PythonTestFunctionProps implements FunctionProps { + private static String infraProjectAbsolutePath; + + static { + try { + try (InputStream stream = PythonTestFunctionProps.class.getClassLoader() + .getResourceAsStream("project-absolute-path.txt")) { + try (InputStreamReader inputStreamReader = new InputStreamReader(stream)) { + infraProjectAbsolutePath = new BufferedReader(inputStreamReader).lines().findFirst() + .orElseThrow(() -> new RuntimeException("No project-absolute-path.txt resource found")); + } + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + // Fixed props + private final Code code = Code.fromAsset(Paths.get(infraProjectAbsolutePath).resolve( + "../python-handlers/dist/lambda" + ).toAbsolutePath().toString()); + private final String handler = "test_python_handlers.python_test.handler"; + private final Runtime runtime = Runtime.PYTHON_3_11; + + // Props with defaults + @lombok.Builder.Default + Duration timeout = Duration.seconds(30); + @lombok.Builder.Default + Tracing tracing = Tracing.ACTIVE; + + // Remaining Function Props + AdotInstrumentationConfig adotInstrumentation; + Boolean allowAllOutbound; + Boolean allowPublicSubnet; + Architecture architecture; + ICodeSigningConfig codeSigningConfig; + VersionOptions currentVersionOptions; + IQueue deadLetterQueue; + Boolean deadLetterQueueEnabled; + ITopic deadLetterTopic; + String description; + Map environment; + IKey environmentEncryption; + Size ephemeralStorageSize; + List events; + FileSystem filesystem; + String functionName; + List initialPolicy; + LambdaInsightsVersion insightsVersion; + List layers; + RetentionDays logRetention; + LogRetentionRetryOptions logRetentionRetryOptions; + IRole logRetentionRole; + Number memorySize; + ParamsAndSecretsLayerVersion paramsAndSecrets; + Boolean profiling; + IProfilingGroup profilingGroup; + Number reservedConcurrentExecutions; + IRole role; + RuntimeManagementMode runtimeManagementMode; + List securityGroups; + IVpc vpc; + SubnetSelection vpcSubnets; + Duration maxEventAge; + IDestination onFailure; + IDestination onSuccess; + Number retryAttempts; +} + +", + ], + [ + "infra/src/main/java/test/test-infra/infra/functions/TypescriptTestFunction.java", + "package test.test-infra.infra.functions; + +import org.jetbrains.annotations.NotNull; +import software.amazon.awscdk.services.lambda.Function; +import software.aws.pdk.type_safe_api.SnapStartFunction; +import software.constructs.Construct; + +/** + * Lambda function construct which points to the typescript implementation of TypescriptTest + */ +public class TypescriptTestFunction extends Function { + public TypescriptTestFunction(@NotNull Construct scope, @NotNull String id, @NotNull TypescriptTestFunctionProps props) { + super(scope, id, props); + } + + public TypescriptTestFunction(@NotNull Construct scope, @NotNull String id) { + this(scope, id, TypescriptTestFunctionProps.builder().build()); + } +} +", + ], + [ + "infra/src/main/java/test/test-infra/infra/functions/TypescriptTestFunctionProps.java", + "package test.test-infra.infra.functions; + +import org.jetbrains.annotations.NotNull; +import software.amazon.awscdk.Duration; +import software.amazon.awscdk.Size; +import software.amazon.awscdk.services.codeguruprofiler.IProfilingGroup; +import software.amazon.awscdk.services.ec2.ISecurityGroup; +import software.amazon.awscdk.services.ec2.IVpc; +import software.amazon.awscdk.services.ec2.SubnetSelection; +import software.amazon.awscdk.services.iam.IRole; +import software.amazon.awscdk.services.iam.PolicyStatement; +import software.amazon.awscdk.services.kms.IKey; +import software.amazon.awscdk.services.lambda.AdotInstrumentationConfig; +import software.amazon.awscdk.services.lambda.Architecture; +import software.amazon.awscdk.services.lambda.Code; +import software.amazon.awscdk.services.lambda.FileSystem; +import software.amazon.awscdk.services.lambda.FunctionProps; +import software.amazon.awscdk.services.lambda.ICodeSigningConfig; +import software.amazon.awscdk.services.lambda.IDestination; +import software.amazon.awscdk.services.lambda.IEventSource; +import software.amazon.awscdk.services.lambda.ILayerVersion; +import software.amazon.awscdk.services.lambda.LambdaInsightsVersion; +import software.amazon.awscdk.services.lambda.LogRetentionRetryOptions; +import software.amazon.awscdk.services.lambda.ParamsAndSecretsLayerVersion; +import software.amazon.awscdk.services.lambda.Runtime; +import software.amazon.awscdk.services.lambda.RuntimeManagementMode; +import software.amazon.awscdk.services.lambda.Tracing; +import software.amazon.awscdk.services.lambda.VersionOptions; +import software.amazon.awscdk.services.logs.RetentionDays; +import software.amazon.awscdk.services.sns.ITopic; +import software.amazon.awscdk.services.sqs.IQueue; +import software.aws.pdk.type_safe_api.SnapStartFunctionProps; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.file.Paths; +import java.util.List; +import java.util.Map; + +@lombok.Builder @lombok.Getter +public class TypescriptTestFunctionProps implements FunctionProps { + private static String infraProjectAbsolutePath; + + static { + try { + try (InputStream stream = TypescriptTestFunctionProps.class.getClassLoader() + .getResourceAsStream("project-absolute-path.txt")) { + try (InputStreamReader inputStreamReader = new InputStreamReader(stream)) { + infraProjectAbsolutePath = new BufferedReader(inputStreamReader).lines().findFirst() + .orElseThrow(() -> new RuntimeException("No project-absolute-path.txt resource found")); + } + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + // Fixed props + private final Code code = Code.fromAsset(Paths.get(infraProjectAbsolutePath).resolve( + "../typescript-handlers/dist/lambda/typescript-test" + ).toAbsolutePath().toString()); + private final String handler = "index.handler"; + private final Runtime runtime = Runtime.NODEJS_18_X; + + // Props with defaults + @lombok.Builder.Default + Duration timeout = Duration.seconds(30); + @lombok.Builder.Default + Tracing tracing = Tracing.ACTIVE; + + // Remaining Function Props + AdotInstrumentationConfig adotInstrumentation; + Boolean allowAllOutbound; + Boolean allowPublicSubnet; + Architecture architecture; + ICodeSigningConfig codeSigningConfig; + VersionOptions currentVersionOptions; + IQueue deadLetterQueue; + Boolean deadLetterQueueEnabled; + ITopic deadLetterTopic; + String description; + Map environment; + IKey environmentEncryption; + Size ephemeralStorageSize; + List events; + FileSystem filesystem; + String functionName; + List initialPolicy; + LambdaInsightsVersion insightsVersion; + List layers; + RetentionDays logRetention; + LogRetentionRetryOptions logRetentionRetryOptions; + IRole logRetentionRole; + Number memorySize; + ParamsAndSecretsLayerVersion paramsAndSecrets; + Boolean profiling; + IProfilingGroup profilingGroup; + Number reservedConcurrentExecutions; + IRole role; + RuntimeManagementMode runtimeManagementMode; + List securityGroups; + IVpc vpc; + SubnetSelection vpcSubnets; + Duration maxEventAge; + IDestination onFailure; + IDestination onSuccess; + Number retryAttempts; +} +", + ], +] +`; + exports[`Java Infrastructure Code Generation Script Unit Tests Generates With Mocks Disabled 1`] = ` "package test.test-infra.infra; diff --git a/packages/type-safe-api/test/scripts/generators/__snapshots__/python-cdk-infrastructure.test.ts.snap b/packages/type-safe-api/test/scripts/generators/__snapshots__/python-cdk-infrastructure.test.ts.snap index d034b31a9..71a3d1680 100644 --- a/packages/type-safe-api/test/scripts/generators/__snapshots__/python-cdk-infrastructure.test.ts.snap +++ b/packages/type-safe-api/test/scripts/generators/__snapshots__/python-cdk-infrastructure.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Python Infrastructure Code Generation Script Unit Tests Generates Functions 1`] = ` +exports[`Python Infrastructure Code Generation Script Unit Tests Generates Functions for handlers.yaml 1`] = ` "from aws_cdk import Duration from aws_cdk.aws_lambda import ( Function, Runtime, Tracing, Code @@ -110,6 +110,67 @@ class TypescriptTwoFunction(Function): )" `; +exports[`Python Infrastructure Code Generation Script Unit Tests Generates Functions for inline-body.yaml 1`] = ` +"from aws_cdk import Duration +from aws_cdk.aws_lambda import ( + Function, Runtime, Tracing, Code +) +from aws_pdk.type_safe_api import SnapStartFunction +from os import path +from pathlib import Path + + + +class JavaTestFunction(SnapStartFunction): + """ + Lambda function construct which points to the java implementation of JavaTest + """ + def __init__(self, scope, id, **kwargs): + super().__init__(scope, id, + runtime=Runtime.JAVA_17, + handler="test.test-java-handlers.handlers.JavaTestHandler", + code=Code.from_asset(path.join(str(Path(__file__).absolute().parent), "..", + "../java-handlers/dist/java/test/com.aws.pdk.test.handlers/1.0.0/com.aws.pdk.test.handlers-1.0.0.jar", + )), + tracing=Tracing.ACTIVE, + timeout=Duration.seconds(30), + **kwargs, + ) + +class PythonTestFunction(Function): + """ + Lambda function construct which points to the python implementation of PythonTest + """ + def __init__(self, scope, id, **kwargs): + super().__init__(scope, id, + runtime=Runtime.PYTHON_3_11, + handler="test_python_handlers.python_test.handler", + code=Code.from_asset(path.join(str(Path(__file__).absolute().parent), "..", + "../python-handlers/dist/lambda", + )), + tracing=Tracing.ACTIVE, + timeout=Duration.seconds(30), + **kwargs, + ) + +class TypescriptTestFunction(Function): + """ + Lambda function construct which points to the typescript implementation of TypescriptTest + """ + def __init__(self, scope, id, **kwargs): + super().__init__(scope, id, + runtime=Runtime.NODEJS_18_X, + handler="index.handler", + code=Code.from_asset(path.join(str(Path(__file__).absolute().parent), "..", + "../typescript-handlers/dist/lambda", + "typescript-test", + )), + tracing=Tracing.ACTIVE, + timeout=Duration.seconds(30), + **kwargs, + )" +`; + exports[`Python Infrastructure Code Generation Script Unit Tests Generates With Mocks Disabled 1`] = ` "import json from aws_pdk.type_safe_api import Integrations, MockIntegration, TypeSafeApiIntegration diff --git a/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript-cdk-infrastructure.test.ts.snap b/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript-cdk-infrastructure.test.ts.snap index d3ed2cad5..309ee743b 100644 --- a/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript-cdk-infrastructure.test.ts.snap +++ b/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript-cdk-infrastructure.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Typescript Infrastructure Code Generation Script Unit Tests Generates Functions 1`] = ` +exports[`Typescript Infrastructure Code Generation Script Unit Tests Generates Functions for handlers.yaml 1`] = ` "import { Construct } from "constructs"; import { Duration } from "aws-cdk-lib"; import { SnapStartFunction, SnapStartFunctionProps } from "@aws/pdk/type-safe-api"; @@ -149,6 +149,85 @@ export class TypescriptTwoFunction extends Function { }" `; +exports[`Typescript Infrastructure Code Generation Script Unit Tests Generates Functions for inline-body.yaml 1`] = ` +"import { Construct } from "constructs"; +import { Duration } from "aws-cdk-lib"; +import { SnapStartFunction, SnapStartFunctionProps } from "@aws/pdk/type-safe-api"; +import { Code, Function, Runtime, Tracing, FunctionProps } from "aws-cdk-lib/aws-lambda"; +import * as path from "path"; + + +/** + * Options for the JavaTestFunction construct + */ +export interface JavaTestFunctionProps extends Omit {} + +/** + * Lambda function construct which points to the java implementation of JavaTest + */ +export class JavaTestFunction extends SnapStartFunction { + constructor(scope: Construct, id: string, props?: JavaTestFunctionProps) { + super(scope, id, { + runtime: Runtime.JAVA_17, + handler: "test.test-java-handlers.handlers.JavaTestHandler", + code: Code.fromAsset(path.resolve(__dirname, "..", + "../java-handlers/dist/java/test/com.aws.pdk.test.handlers/1.0.0/com.aws.pdk.test.handlers-1.0.0.jar", + )), + tracing: Tracing.ACTIVE, + timeout: Duration.seconds(30), + ...props, + }); + } +} + +/** + * Options for the PythonTestFunction construct + */ +export interface PythonTestFunctionProps extends Omit {} + +/** + * Lambda function construct which points to the python implementation of PythonTest + */ +export class PythonTestFunction extends Function { + constructor(scope: Construct, id: string, props?: PythonTestFunctionProps) { + super(scope, id, { + runtime: Runtime.PYTHON_3_11, + handler: "test_python_handlers.python_test.handler", + code: Code.fromAsset(path.resolve(__dirname, "..", + "../python-handlers/dist/lambda", + )), + tracing: Tracing.ACTIVE, + timeout: Duration.seconds(30), + ...props, + }); + } +} + +/** + * Options for the TypescriptTestOperationFunction construct + */ +export interface TypescriptTestOperationFunctionProps extends Omit {} + +/** + * Lambda function construct which points to the typescript implementation of TypescriptTestOperation + */ +export class TypescriptTestOperationFunction extends Function { + constructor(scope: Construct, id: string, props?: TypescriptTestOperationFunctionProps) { + super(scope, id, { + runtime: Runtime.NODEJS_18_X, + handler: "index.handler", + code: Code.fromAsset(path.resolve(__dirname, "..", + "../typescript-handlers/dist/lambda", + "typescript-test", + )), + tracing: Tracing.ACTIVE, + timeout: Duration.seconds(30), + ...props, + }); + } +}" +`; + exports[`Typescript Infrastructure Code Generation Script Unit Tests Generates With Mocks Disabled 1`] = ` "import { ApiError, diff --git a/packages/type-safe-api/test/scripts/generators/java-cdk-infrastructure.test.ts b/packages/type-safe-api/test/scripts/generators/java-cdk-infrastructure.test.ts index fe11fe8d1..f423fccde 100644 --- a/packages/type-safe-api/test/scripts/generators/java-cdk-infrastructure.test.ts +++ b/packages/type-safe-api/test/scripts/generators/java-cdk-infrastructure.test.ts @@ -130,53 +130,56 @@ describe("Java Infrastructure Code Generation Script Unit Tests", () => { ).toMatchSnapshot(); }); - it("Generates Functions", () => { - const specPath = path.resolve( - __dirname, - `../../resources/specs/handlers.yaml` - ); + it.each(["handlers.yaml", "inline-body.yaml"])( + "Generates Functions for %s", + (specFile) => { + const specPath = path.resolve( + __dirname, + `../../resources/specs/${specFile}` + ); - const snapshot = withTmpDirSnapshot( - os.tmpdir(), - (outdir) => { - exec(`cp ${specPath} ${outdir}/spec.yaml`, { - cwd: path.resolve(__dirname), - }); + const snapshot = withTmpDirSnapshot( + os.tmpdir(), + (outdir) => { + exec(`cp ${specPath} ${outdir}/spec.yaml`, { + cwd: path.resolve(__dirname), + }); - const { runtimes, handlers } = getTestHandlerProjects(outdir); + const { runtimes, handlers } = getTestHandlerProjects(outdir); - const infraOutdir = path.join(outdir, "infra"); - const project = new GeneratedJavaCdkInfrastructureProject({ - name: "test-infra", - artifactId: "com.aws.pdk.test.infra", - groupId: "test", - version: "1.0.0", - outdir: infraOutdir, - specPath: "../spec.yaml", - generatedJavaTypes: runtimes.java, - generatedHandlers: handlers, - }); - project.synth(); - exec( - `${path.resolve( - __dirname, - "../../../scripts/type-safe-api/generators/generate" - )} ${project.buildGenerateCommandArgs()}`, - { - cwd: infraOutdir, - } - ); - }, - { - excludeGlobs: GeneratedJavaRuntimeProject.openApiIgnorePatterns, - parseJson: false, - } - ); + const infraOutdir = path.join(outdir, "infra"); + const project = new GeneratedJavaCdkInfrastructureProject({ + name: "test-infra", + artifactId: "com.aws.pdk.test.infra", + groupId: "test", + version: "1.0.0", + outdir: infraOutdir, + specPath: "../spec.yaml", + generatedJavaTypes: runtimes.java, + generatedHandlers: handlers, + }); + project.synth(); + exec( + `${path.resolve( + __dirname, + "../../../scripts/type-safe-api/generators/generate" + )} ${project.buildGenerateCommandArgs()}`, + { + cwd: infraOutdir, + } + ); + }, + { + excludeGlobs: GeneratedJavaRuntimeProject.openApiIgnorePatterns, + parseJson: false, + } + ); - expect( - Object.entries(snapshot).filter(([file]: [string, any]) => - file.startsWith("infra/src/main/java/test/test-infra/infra/functions") - ) - ).toMatchSnapshot(); - }); + expect( + Object.entries(snapshot).filter(([file]: [string, any]) => + file.startsWith("infra/src/main/java/test/test-infra/infra/functions") + ) + ).toMatchSnapshot(); + } + ); }); diff --git a/packages/type-safe-api/test/scripts/generators/python-cdk-infrastructure.test.ts b/packages/type-safe-api/test/scripts/generators/python-cdk-infrastructure.test.ts index e28d3ec73..77528b429 100644 --- a/packages/type-safe-api/test/scripts/generators/python-cdk-infrastructure.test.ts +++ b/packages/type-safe-api/test/scripts/generators/python-cdk-infrastructure.test.ts @@ -105,42 +105,45 @@ describe("Python Infrastructure Code Generation Script Unit Tests", () => { expect(snapshot["infra/test_infra/mock_integrations.py"]).toMatchSnapshot(); }); - it("Generates Functions", () => { - const specPath = path.resolve( - __dirname, - `../../resources/specs/handlers.yaml` - ); + it.each(["handlers.yaml", "inline-body.yaml"])( + "Generates Functions for %s", + (specFile) => { + const specPath = path.resolve( + __dirname, + `../../resources/specs/${specFile}` + ); - const snapshot = withTmpDirSnapshot(os.tmpdir(), (outdir) => { - exec(`cp ${specPath} ${outdir}/spec.yaml`, { - cwd: path.resolve(__dirname), - }); - const { runtimes, handlers } = getTestHandlerProjects(outdir); + const snapshot = withTmpDirSnapshot(os.tmpdir(), (outdir) => { + exec(`cp ${specPath} ${outdir}/spec.yaml`, { + cwd: path.resolve(__dirname), + }); + const { runtimes, handlers } = getTestHandlerProjects(outdir); - const infraOutdir = path.join(outdir, "infra"); - const project = new GeneratedPythonCdkInfrastructureProject({ - name: "test-infra", - moduleName: "test_infra", - authorEmail: "me@example.com", - authorName: "test", - version: "1.0.0", - outdir: infraOutdir, - specPath: "../spec.yaml", - generatedPythonTypes: runtimes.python, - generatedHandlers: handlers, + const infraOutdir = path.join(outdir, "infra"); + const project = new GeneratedPythonCdkInfrastructureProject({ + name: "test-infra", + moduleName: "test_infra", + authorEmail: "me@example.com", + authorName: "test", + version: "1.0.0", + outdir: infraOutdir, + specPath: "../spec.yaml", + generatedPythonTypes: runtimes.python, + generatedHandlers: handlers, + }); + project.synth(); + exec( + `${path.resolve( + __dirname, + "../../../scripts/type-safe-api/generators/generate" + )} ${project.buildGenerateCommandArgs()}`, + { + cwd: infraOutdir, + } + ); }); - project.synth(); - exec( - `${path.resolve( - __dirname, - "../../../scripts/type-safe-api/generators/generate" - )} ${project.buildGenerateCommandArgs()}`, - { - cwd: infraOutdir, - } - ); - }); - expect(snapshot["infra/test_infra/functions.py"]).toMatchSnapshot(); - }); + expect(snapshot["infra/test_infra/functions.py"]).toMatchSnapshot(); + } + ); }); diff --git a/packages/type-safe-api/test/scripts/generators/typescript-cdk-infrastructure.test.ts b/packages/type-safe-api/test/scripts/generators/typescript-cdk-infrastructure.test.ts index e3ceb19c5..46db2181e 100644 --- a/packages/type-safe-api/test/scripts/generators/typescript-cdk-infrastructure.test.ts +++ b/packages/type-safe-api/test/scripts/generators/typescript-cdk-infrastructure.test.ts @@ -96,38 +96,41 @@ describe("Typescript Infrastructure Code Generation Script Unit Tests", () => { expect(snapshot["infra/src/mock-integrations.ts"]).toMatchSnapshot(); }); - it("Generates Functions", () => { - const specPath = path.resolve( - __dirname, - `../../resources/specs/handlers.yaml` - ); + it.each(["handlers.yaml", "inline-body.yaml"])( + "Generates Functions for %s", + (specFile) => { + const specPath = path.resolve( + __dirname, + `../../resources/specs/${specFile}` + ); - const snapshot = withTmpDirSnapshot(os.tmpdir(), (outdir) => { - exec(`cp ${specPath} ${outdir}/spec.yaml`, { - cwd: path.resolve(__dirname), + const snapshot = withTmpDirSnapshot(os.tmpdir(), (outdir) => { + exec(`cp ${specPath} ${outdir}/spec.yaml`, { + cwd: path.resolve(__dirname), + }); + const { runtimes, handlers } = getTestHandlerProjects(outdir); + const infraOutdir = path.join(outdir, "infra"); + const project = new GeneratedTypescriptCdkInfrastructureProject({ + name: "test-infra", + defaultReleaseBranch: "main", + outdir: infraOutdir, + specPath: "../spec.yaml", + generatedTypescriptTypes: runtimes.typescript, + generatedHandlers: handlers, + }); + project.synth(); + exec( + `${path.resolve( + __dirname, + "../../../scripts/type-safe-api/generators/generate" + )} ${project.buildGenerateCommandArgs()}`, + { + cwd: infraOutdir, + } + ); }); - const { runtimes, handlers } = getTestHandlerProjects(outdir); - const infraOutdir = path.join(outdir, "infra"); - const project = new GeneratedTypescriptCdkInfrastructureProject({ - name: "test-infra", - defaultReleaseBranch: "main", - outdir: infraOutdir, - specPath: "../spec.yaml", - generatedTypescriptTypes: runtimes.typescript, - generatedHandlers: handlers, - }); - project.synth(); - exec( - `${path.resolve( - __dirname, - "../../../scripts/type-safe-api/generators/generate" - )} ${project.buildGenerateCommandArgs()}`, - { - cwd: infraOutdir, - } - ); - }); - expect(snapshot["infra/src/functions.ts"]).toMatchSnapshot(); - }); + expect(snapshot["infra/src/functions.ts"]).toMatchSnapshot(); + } + ); }); From 9d0bfd9726ca5387fb4be22f4bf7a6a9a94fc79f Mon Sep 17 00:00:00 2001 From: Adrian Dimech <51220968+agdimech@users.noreply.github.com> Date: Fri, 20 Oct 2023 13:07:04 +1100 Subject: [PATCH 09/21] fix: fix java build issues (#608) --- docs/content/getting_started/index.md | 21 ++++-- .../your_first_aws_pdk_project.md | 67 +------------------ .../constructs/ApiConstruct.java.mustache | 2 +- .../stacks/ApplicationStackTest.java.mustache | 2 +- 4 files changed, 18 insertions(+), 74 deletions(-) diff --git a/docs/content/getting_started/index.md b/docs/content/getting_started/index.md index b85b5e157..a772a5cc1 100644 --- a/docs/content/getting_started/index.md +++ b/docs/content/getting_started/index.md @@ -182,21 +182,30 @@ git config --global user.email "username@domain.com" git config --global user.name "username" ``` +### JDK + Maven (If using Type Safe API) + +The Type Safe API requires JDK >= 11 and Maven >= 3.8 in order to perform the required code generation. + +To install these, follow the below links: + +- JDK: We recommend installing any Coretto version >= 11 https://docs.aws.amazon.com/corretto/ +- Maven: You can any version of Maven >= 3.8: https://maven.apache.org/install.html + ### Language specific Other prerequisites depend on the language in which you develop AWS PDK projects and are as follows. === "TYPESCRIPT" - - `Node >= 16` - - `PNPM >= 8.6.3` [if using `--package-manager=pnpm` flag to bootstrap] + - `PNPM >= 8.6.3` [if using `--package-manager=pnpm` flag to bootstrap]: https://pnpm.io/installation + - `YARN` [if `--package-manager` flag is unset]: https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable === "PYTHON" - - `Python >= 3.9` - - `Poetry >= 1.5.1` + - `Python >= 3.9`: https://github.com/pyenv/pyenv + - `Poetry >= 1.5.1`: https://python-poetry.org/docs/ + - `YARN`: https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable === "JAVA" - - `JDK >= 11` - - `Apache Maven >= 3.8` + - `YARN`: https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable ### Install the AWS CDK diff --git a/docs/content/getting_started/your_first_aws_pdk_project.md b/docs/content/getting_started/your_first_aws_pdk_project.md index e2555e13e..3683b82d1 100644 --- a/docs/content/getting_started/your_first_aws_pdk_project.md +++ b/docs/content/getting_started/your_first_aws_pdk_project.md @@ -26,72 +26,7 @@ We'll also show how to add a new API operation, implement an API handler, and wi ## Prerequisites -The following subsections outline what you need to install and use the AWS PDK. - -### Node runtime - -All AWS PDK developers, even those working in Python or Java, need Node.js 16 or later. All supported languages use the same backend, which runs on Node.js. We recommend a version in active long-term support. Your organization may have a different recommendation. - -!!!tip - We recommend installing [`nvm`](https://github.com/nvm-sh/nvm#installing-and-updating) and configuring it to use Node 18. - -### PDK CLI - -Once your NodeJs ruuntime is set up, run the following command to install the pdk CLI: - -```bash -npm install -g @aws/pdk -``` - -Run the following command to verify correct installation and print the version number of the AWS PDK. - -`pdk --version` - -!!!warning - The `pdk` command is a wrapper command which delegates to either a package manager or a projen command depending on the context. As such it may be possible that certain arguments may not operate as expected. - -### Git - -[Git](https://git-scm.com/) is also required to be installed and configured when bootstrapping new applications unless the `--no-git` flag is specified when executing the `pdk new` command. - -Ensure to configure a username and email via the below commands once installed: - -```bash -git config --global user.email "username@domain.com" -git config --global user.name "username" -``` - -### Language specific - -Other prerequisites depend on the language in which you develop AWS PDK projects and are as follows. - -=== "TYPESCRIPT" - - `Node >= 16` - - `PNPM >= 8.6.3` [if using `--package-manager=pnpm` flag to bootstrap] - -=== "PYTHON" - - `Python >= 3.9` - - `Poetry >= 1.5.1` - -=== "JAVA" - - `JDK >= 11` - - `Apache Maven >= 3.8` - -### Install the AWS CDK - -You will need to install the AWS CDK in order to bootstrap and deploy your infrastructure to AWS. To install, run the following command: - -`npm install -g aws-cdk` - -Run the following command to verify correct installation and print the version number of the AWS CDK. - -`cdk --version` - -### Authentication with AWS - -You must establish how the AWS CDK authenticates with AWS when deploying infrastructure. There are different ways in which you can configure programmatic access to AWS resources, depending on the environment and the AWS access available to you. - -For an in depth guide, please refer to: https://docs.aws.amazon.com/sdkref/latest/guide/access.html +Refer to [prerequisites](./index.md#prerequisites). ## Create your project diff --git a/packages/infrastructure/samples/infrastructure/java/src/java/groupId/constructs/ApiConstruct.java.mustache b/packages/infrastructure/samples/infrastructure/java/src/java/groupId/constructs/ApiConstruct.java.mustache index 987916fce..4a3eab84d 100644 --- a/packages/infrastructure/samples/infrastructure/java/src/java/groupId/constructs/ApiConstruct.java.mustache +++ b/packages/infrastructure/samples/infrastructure/java/src/java/groupId/constructs/ApiConstruct.java.mustache @@ -48,7 +48,7 @@ public class ApiConstruct extends Construct { // still be granted access to the API. new PolicyStatement(PolicyStatementProps.builder() .effect(Effect.ALLOW) - .principals(Arrays.asList(new AccountPrincipal(Stack.of(this)))) + .principals(Arrays.asList(new AccountPrincipal(Stack.of(this).getAccount()))) .actions(Arrays.asList("execute-api:Invoke")) .resources(Arrays.asList("execute-api:/*")) .build()), diff --git a/packages/infrastructure/samples/infrastructure/java/test/java/groupId/stacks/ApplicationStackTest.java.mustache b/packages/infrastructure/samples/infrastructure/java/test/java/groupId/stacks/ApplicationStackTest.java.mustache index b0824b526..faf771c5f 100644 --- a/packages/infrastructure/samples/infrastructure/java/test/java/groupId/stacks/ApplicationStackTest.java.mustache +++ b/packages/infrastructure/samples/infrastructure/java/test/java/groupId/stacks/ApplicationStackTest.java.mustache @@ -16,7 +16,7 @@ public class ApplicationStackTest { @Test public void myTest() { App app = new App(); - ApplicationStack stack = new ApplicationStack(app, "test"); + ApplicationStack stack = new ApplicationStack(app, "test", null); Template template = Template.fromStack(stack); expect.serializer("json").toMatchSnapshot(template.toJSON()); From 4057d69b68e329d7434af4c3cd0ef7d17856c8b2 Mon Sep 17 00:00:00 2001 From: Jack Stevenson Date: Fri, 20 Oct 2023 14:33:43 +1100 Subject: [PATCH 10/21] fix(type-safe-api): fix syntax error for python runtime request parameters with descriptions (#610) Descriptions in Python request parameters would previously render invalid python syntax as quotes were escaped as ". Use triple curly braces to ensure these are rendered correctly. Additionally, field references can only be used once per field in a pydantic model, and since fields with descriptions include the field in the type annotation these would fail at runtime when another field is used in the assignment (ie foo: Annotated[StrictStr, Field(..., description="...")] = Field(alias='foo') ). We therefore remove the assignment of a Field value, which is ok since the alias is not required as the handler wrapper already constructs a dict with the "paramName"s as keys rather than the "baseName"s which are in the raw request. Fixes #609 --- .../python/templates/operationConfig.mustache | 6 +- .../test/resources/specs/single.yaml | 6 ++ .../__snapshots__/docs.test.ts.snap | 74 ++++++++++------- .../__snapshots__/java.test.ts.snap | 40 ++++++---- .../__snapshots__/python.test.ts.snap | 80 ++++++++++--------- .../__snapshots__/typescript.test.ts.snap | 6 +- 6 files changed, 120 insertions(+), 92 deletions(-) diff --git a/packages/type-safe-api/scripts/type-safe-api/generators/python/templates/operationConfig.mustache b/packages/type-safe-api/scripts/type-safe-api/generators/python/templates/operationConfig.mustache index bad2e254c..2215dc967 100644 --- a/packages/type-safe-api/scripts/type-safe-api/generators/python/templates/operationConfig.mustache +++ b/packages/type-safe-api/scripts/type-safe-api/generators/python/templates/operationConfig.mustache @@ -1,7 +1,7 @@ from __future__ import annotations import urllib.parse import json -from typing import Callable, Any, Dict, List, NamedTuple, TypeVar, Generic, Union, TypedDict, Protocol, Optional, Literal +from typing import Callable, Any, Dict, List, NamedTuple, TypeVar, Generic, Union, TypedDict, Protocol, Optional, Literal, Annotated from functools import wraps from dataclasses import dataclass, fields from datetime import datetime @@ -215,7 +215,7 @@ class {{operationIdCamelCase}}RequestParameters(BaseModel): """ {{#allParams}} {{^isBodyParam}} - {{paramName}}: {{vendorExtensions.x-py-typing}} = Field(alias='{{baseName}}'{{^required}}, default=None{{/required}}) + {{paramName}}: {{{vendorExtensions.x-py-typing}}} {{/isBodyParam}} {{/allParams}} @@ -232,7 +232,7 @@ class {{operationIdCamelCase}}RequestParameters(BaseModel): return cls.from_dict(json.loads(json_str)) def to_dict(self): - return self.dict(by_alias=True, exclude={}, exclude_none=True) + return self.dict(exclude={}, exclude_none=True) @classmethod def from_dict(cls, obj: dict) -> {{operationIdCamelCase}}RequestParameters: diff --git a/packages/type-safe-api/test/resources/specs/single.yaml b/packages/type-safe-api/test/resources/specs/single.yaml index 4c9428ffe..e8ab7a206 100644 --- a/packages/type-safe-api/test/resources/specs/single.yaml +++ b/packages/type-safe-api/test/resources/specs/single.yaml @@ -9,11 +9,13 @@ paths: parameters: - in: query name: param1 + description: This is parameter 1 schema: type: string required: true - in: query name: param2 + description: This is parameter 2 schema: type: array items: @@ -36,6 +38,7 @@ paths: required: true - in: header name: x-header-param + description: This is a header parameter schema: type: string required: true @@ -149,11 +152,13 @@ components: required: - errorMessage TestRequest: + description: This is a test request type: object properties: myInput: type: number TestResponse: + description: This is a test response type: object properties: messages: @@ -162,6 +167,7 @@ components: type: object properties: message: + description: This is a message type: string id: type: integer diff --git a/packages/type-safe-api/test/scripts/generators/__snapshots__/docs.test.ts.snap b/packages/type-safe-api/test/scripts/generators/__snapshots__/docs.test.ts.snap index ae8c019c7..837acc81a 100644 --- a/packages/type-safe-api/test/scripts/generators/__snapshots__/docs.test.ts.snap +++ b/packages/type-safe-api/test/scripts/generators/__snapshots__/docs.test.ts.snap @@ -916,7 +916,8 @@ ul.nav-tabs { "myInput" : { "type" : "number" } - } + }, + "description" : "This is a test request" }; defs["TestResponse"] = { "required" : [ "messages" ], @@ -928,14 +929,16 @@ ul.nav-tabs { "$ref" : "#/components/schemas/TestResponse_messages_inner" } } - } + }, + "description" : "This is a test response" }; defs["TestResponse_messages_inner"] = { "required" : [ "id" ], "type" : "object", "properties" : { "message" : { - "type" : "string" + "type" : "string", + "description" : "This is a message" }, "id" : { "type" : "integer" @@ -2655,11 +2658,11 @@ public class DefaultApiExample { // Create an instance of the API class DefaultApi apiInstance = new DefaultApi(); - String param1 = param1_example; // String | - array[String] param2 = ; // array[String] | + String param1 = param1_example; // String | This is parameter 1 + array[String] param2 = ; // array[String] | This is parameter 2 BigDecimal param3 = 8.14; // BigDecimal | String pathParam = pathParam_example; // String | - String xHeaderParam = xHeaderParam_example; // String | + String xHeaderParam = xHeaderParam_example; // String | This is a header parameter TestRequest testRequest = ; // TestRequest | String param4 = param4_example; // String | array[String] xMultiValueHeaderParam = ; // array[String] | @@ -2682,11 +2685,11 @@ public class DefaultApiExample { public class DefaultApiExample { public static void main(String[] args) { DefaultApi apiInstance = new DefaultApi(); - String param1 = param1_example; // String | - array[String] param2 = ; // array[String] | + String param1 = param1_example; // String | This is parameter 1 + array[String] param2 = ; // array[String] | This is parameter 2 BigDecimal param3 = 8.14; // BigDecimal | String pathParam = pathParam_example; // String | - String xHeaderParam = xHeaderParam_example; // String | + String xHeaderParam = xHeaderParam_example; // String | This is a header parameter TestRequest testRequest = ; // TestRequest | String param4 = param4_example; // String | array[String] xMultiValueHeaderParam = ; // array[String] | @@ -2710,11 +2713,11 @@ public class DefaultApiExample { // Create an instance of the API class DefaultApi *apiInstance = [[DefaultApi alloc] init]; -String *param1 = param1_example; // (default to null) -array[String] *param2 = ; // (default to null) +String *param1 = param1_example; // This is parameter 1 (default to null) +array[String] *param2 = ; // This is parameter 2 (default to null) BigDecimal *param3 = 8.14; // (default to null) String *pathParam = pathParam_example; // (default to null) -String *xHeaderParam = xHeaderParam_example; // (default to null) +String *xHeaderParam = xHeaderParam_example; // This is a header parameter (default to null) TestRequest *testRequest = ; // String *param4 = param4_example; // (optional) (default to null) array[String] *xMultiValueHeaderParam = ; // (optional) (default to null) @@ -2743,11 +2746,11 @@ array[String] *xMultiValueHeaderParam = ; // (optional) (default to null) // Create an instance of the API class var api = new ExampleApi.DefaultApi() -var param1 = param1_example; // {String} -var param2 = ; // {array[String]} +var param1 = param1_example; // {String} This is parameter 1 +var param2 = ; // {array[String]} This is parameter 2 var param3 = 8.14; // {BigDecimal} var pathParam = pathParam_example; // {String} -var xHeaderParam = xHeaderParam_example; // {String} +var xHeaderParam = xHeaderParam_example; // {String} This is a header parameter var testRequest = ; // {TestRequest} var opts = { 'param4': param4_example, // {String} @@ -2784,11 +2787,11 @@ namespace Example // Create an instance of the API class var apiInstance = new DefaultApi(); - var param1 = param1_example; // String | (default to null) - var param2 = new array[String](); // array[String] | (default to null) + var param1 = param1_example; // String | This is parameter 1 (default to null) + var param2 = new array[String](); // array[String] | This is parameter 2 (default to null) var param3 = 8.14; // BigDecimal | (default to null) var pathParam = pathParam_example; // String | (default to null) - var xHeaderParam = xHeaderParam_example; // String | (default to null) + var xHeaderParam = xHeaderParam_example; // String | This is a header parameter (default to null) var testRequest = new TestRequest(); // TestRequest | var param4 = param4_example; // String | (optional) (default to null) var xMultiValueHeaderParam = new array[String](); // array[String] | (optional) (default to null) @@ -2811,11 +2814,11 @@ require_once(__DIR__ . '/vendor/autoload.php'); // Create an instance of the API class $api_instance = new OpenAPITools\\Client\\Api\\DefaultApi(); -$param1 = param1_example; // String | -$param2 = ; // array[String] | +$param1 = param1_example; // String | This is parameter 1 +$param2 = ; // array[String] | This is parameter 2 $param3 = 8.14; // BigDecimal | $pathParam = pathParam_example; // String | -$xHeaderParam = xHeaderParam_example; // String | +$xHeaderParam = xHeaderParam_example; // String | This is a header parameter $testRequest = ; // TestRequest | $param4 = param4_example; // String | $xMultiValueHeaderParam = ; // array[String] | @@ -2836,11 +2839,11 @@ use WWW::OPenAPIClient::DefaultApi; # Create an instance of the API class my $api_instance = WWW::OPenAPIClient::DefaultApi->new(); -my $param1 = param1_example; # String | -my $param2 = []; # array[String] | +my $param1 = param1_example; # String | This is parameter 1 +my $param2 = []; # array[String] | This is parameter 2 my $param3 = 8.14; # BigDecimal | my $pathParam = pathParam_example; # String | -my $xHeaderParam = xHeaderParam_example; # String | +my $xHeaderParam = xHeaderParam_example; # String | This is a header parameter my $testRequest = WWW::OPenAPIClient::Object::TestRequest->new(); # TestRequest | my $param4 = param4_example; # String | my $xMultiValueHeaderParam = []; # array[String] | @@ -2863,11 +2866,11 @@ from pprint import pprint # Create an instance of the API class api_instance = openapi_client.DefaultApi() -param1 = param1_example # String | (default to null) -param2 = # array[String] | (default to null) +param1 = param1_example # String | This is parameter 1 (default to null) +param2 = # array[String] | This is parameter 2 (default to null) param3 = 8.14 # BigDecimal | (default to null) pathParam = pathParam_example # String | (default to null) -xHeaderParam = xHeaderParam_example # String | (default to null) +xHeaderParam = xHeaderParam_example # String | This is a header parameter (default to null) testRequest = # TestRequest | param4 = param4_example # String | (optional) (default to null) xMultiValueHeaderParam = # array[String] | (optional) (default to null) @@ -2953,6 +2956,9 @@ pub fn main() { String +
+This is a header parameter +
Required @@ -3046,6 +3052,9 @@ $(document).ready(function() { String +
+This is parameter 1 +
Required @@ -3066,6 +3075,9 @@ $(document).ready(function() { array[String] +
+This is parameter 2 +
Required @@ -5484,11 +5496,11 @@ No authorization required |Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **param1** | **String**| | [default to null] | -| **param2** | [**List**](../Models/String.md)| | [default to null] | +| **param1** | **String**| This is parameter 1 | [default to null] | +| **param2** | [**List**](../Models/String.md)| This is parameter 2 | [default to null] | | **param3** | **BigDecimal**| | [default to null] | | **pathParam** | **String**| | [default to null] | -| **x-header-param** | **String**| | [default to null] | +| **x-header-param** | **String**| This is a header parameter | [default to null] | | **TestRequest** | [**TestRequest**](../Models/TestRequest.md)| | | | **param4** | **String**| | [optional] [default to null] | | **x-multi-value-header-param** | [**List**](../Models/String.md)| | [optional] [default to null] | @@ -5585,7 +5597,7 @@ No authorization required | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -| **message** | **String** | | [optional] [default to null] | +| **message** | **String** | This is a message | [optional] [default to null] | | **id** | **Integer** | | [default to null] | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/packages/type-safe-api/test/scripts/generators/__snapshots__/java.test.ts.snap b/packages/type-safe-api/test/scripts/generators/__snapshots__/java.test.ts.snap index cd138506c..9b7abbe7e 100644 --- a/packages/type-safe-api/test/scripts/generators/__snapshots__/java.test.ts.snap +++ b/packages/type-safe-api/test/scripts/generators/__snapshots__/java.test.ts.snap @@ -7252,14 +7252,16 @@ paths: post: operationId: operationOne parameters: - - explode: true + - description: This is parameter 1 + explode: true in: query name: param1 required: true schema: type: string style: form - - explode: true + - description: This is parameter 2 + explode: true in: query name: param2 required: true @@ -7289,7 +7291,8 @@ paths: schema: type: string style: simple - - explode: false + - description: This is a header parameter + explode: false in: header name: x-header-param required: true @@ -7420,11 +7423,13 @@ components: - errorMessage type: object TestRequest: + description: This is a test request properties: myInput: type: number type: object TestResponse: + description: This is a test response properties: messages: items: @@ -7445,6 +7450,7 @@ components: TestResponse_messages_inner: properties: message: + description: This is a message type: string id: type: integer @@ -7809,11 +7815,11 @@ public class Example { defaultClient.setBasePath("http://localhost"); DefaultApi apiInstance = new DefaultApi(defaultClient); - String param1 = "param1_example"; // String | - List param2 = Arrays.asList(); // List | + String param1 = "param1_example"; // String | This is parameter 1 + List param2 = Arrays.asList(); // List | This is parameter 2 BigDecimal param3 = new BigDecimal(78); // BigDecimal | String pathParam = "pathParam_example"; // String | - String xHeaderParam = "xHeaderParam_example"; // String | + String xHeaderParam = "xHeaderParam_example"; // String | This is a header parameter TestRequest testRequest = new TestRequest(); // TestRequest | String param4 = "param4_example"; // String | List xMultiValueHeaderParam = Arrays.asList(); // List | @@ -7838,11 +7844,11 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **param1** | **String**| | | -| **param2** | [**List<String>**](String.md)| | | +| **param1** | **String**| This is parameter 1 | | +| **param2** | [**List<String>**](String.md)| This is parameter 2 | | | **param3** | **BigDecimal**| | | | **pathParam** | **String**| | | -| **xHeaderParam** | **String**| | | +| **xHeaderParam** | **String**| This is a header parameter | | | **testRequest** | [**TestRequest**](TestRequest.md)| | | | **param4** | **String**| | [optional] | | **xMultiValueHeaderParam** | [**List<String>**](String.md)| | [optional] | @@ -7957,6 +7963,7 @@ No authorization required # TestRequest +This is a test request ## Properties @@ -7971,6 +7978,7 @@ No authorization required # TestResponse +This is a test response ## Properties @@ -7990,7 +7998,7 @@ No authorization required | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**message** | **String** | | [optional] | +|**message** | **String** | This is a message | [optional] | |**id** | **Integer** | | | @@ -11811,11 +11819,11 @@ public class DefaultApi { /** * * - * @param param1 (required) - * @param param2 (required) + * @param param1 This is parameter 1 (required) + * @param param2 This is parameter 2 (required) * @param param3 (required) * @param pathParam (required) - * @param xHeaderParam (required) + * @param xHeaderParam This is a header parameter (required) * @param testRequest (required) * @return APIoperationOneRequest * @http.response.details @@ -16640,7 +16648,7 @@ import java.util.Set; import test.test.runtime.JSON; /** - * TestRequest + * This is a test request */ @lombok.AllArgsConstructor @lombok.experimental.SuperBuilder @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -16847,7 +16855,7 @@ import java.util.Set; import test.test.runtime.JSON; /** - * TestResponse + * This is a test response */ @lombok.AllArgsConstructor @lombok.experimental.SuperBuilder @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -17097,7 +17105,7 @@ public class TestResponseMessagesInner { } /** - * Get message + * This is a message * @return message **/ @javax.annotation.Nullable diff --git a/packages/type-safe-api/test/scripts/generators/__snapshots__/python.test.ts.snap b/packages/type-safe-api/test/scripts/generators/__snapshots__/python.test.ts.snap index eeb409f3e..2188d6d0e 100644 --- a/packages/type-safe-api/test/scripts/generators/__snapshots__/python.test.ts.snap +++ b/packages/type-safe-api/test/scripts/generators/__snapshots__/python.test.ts.snap @@ -947,7 +947,7 @@ class DefaultApi(object): "test_project/api/operation_config.py": "from __future__ import annotations import urllib.parse import json -from typing import Callable, Any, Dict, List, NamedTuple, TypeVar, Generic, Union, TypedDict, Protocol, Optional, Literal +from typing import Callable, Any, Dict, List, NamedTuple, TypeVar, Generic, Union, TypedDict, Protocol, Optional, Literal, Annotated from functools import wraps from dataclasses import dataclass, fields from datetime import datetime @@ -1171,7 +1171,7 @@ class NeitherRequestParameters(BaseModel): return cls.from_dict(json.loads(json_str)) def to_dict(self): - return self.dict(by_alias=True, exclude={}, exclude_none=True) + return self.dict(exclude={}, exclude_none=True) @classmethod def from_dict(cls, obj: dict) -> NeitherRequestParameters: @@ -1284,7 +1284,7 @@ class BothRequestParameters(BaseModel): return cls.from_dict(json.loads(json_str)) def to_dict(self): - return self.dict(by_alias=True, exclude={}, exclude_none=True) + return self.dict(exclude={}, exclude_none=True) @classmethod def from_dict(cls, obj: dict) -> BothRequestParameters: @@ -1397,7 +1397,7 @@ class Tag1RequestParameters(BaseModel): return cls.from_dict(json.loads(json_str)) def to_dict(self): - return self.dict(by_alias=True, exclude={}, exclude_none=True) + return self.dict(exclude={}, exclude_none=True) @classmethod def from_dict(cls, obj: dict) -> Tag1RequestParameters: @@ -1510,7 +1510,7 @@ class Tag2RequestParameters(BaseModel): return cls.from_dict(json.loads(json_str)) def to_dict(self): - return self.dict(by_alias=True, exclude={}, exclude_none=True) + return self.dict(exclude={}, exclude_none=True) @classmethod def from_dict(cls, obj: dict) -> Tag2RequestParameters: @@ -4872,11 +4872,11 @@ configuration = test_project.Configuration( with test_project.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = test_project.DefaultApi(api_client) - param1 = 'param1_example' # str | - param2 = ['param2_example'] # List[str] | + param1 = 'param1_example' # str | This is parameter 1 + param2 = ['param2_example'] # List[str] | This is parameter 2 param3 = 3.4 # float | path_param = 'path_param_example' # str | - x_header_param = 'x_header_param_example' # str | + x_header_param = 'x_header_param_example' # str | This is a header parameter test_request = test_project.TestRequest() # TestRequest | param4 = 'param4_example' # str | (optional) x_multi_value_header_param = ['x_multi_value_header_param_example'] # List[str] | (optional) @@ -4894,11 +4894,11 @@ with test_project.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param1** | **str**| | - **param2** | [**List[str]**](str.md)| | + **param1** | **str**| This is parameter 1 | + **param2** | [**List[str]**](str.md)| This is parameter 2 | **param3** | **float**| | **path_param** | **str**| | - **x_header_param** | **str**| | + **x_header_param** | **str**| This is a header parameter | **test_request** | [**TestRequest**](TestRequest.md)| | **param4** | **str**| | [optional] **x_multi_value_header_param** | [**List[str]**](str.md)| | [optional] @@ -5045,6 +5045,7 @@ map_response_map_property_value_form_dict = map_response_map_property_value.from ", "docs/TestRequest.md": "# TestRequest +This is a test request ## Properties Name | Type | Description | Notes @@ -5074,6 +5075,7 @@ test_request_form_dict = test_request.from_dict(test_request_dict) ", "docs/TestResponse.md": "# TestResponse +This is a test response ## Properties Name | Type | Description | Notes @@ -5107,7 +5109,7 @@ test_response_form_dict = test_response.from_dict(test_response_dict) ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**message** | **str** | | [optional] +**message** | **str** | This is a message | [optional] **id** | **int** | | ## Example @@ -5212,7 +5214,7 @@ import warnings from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import StrictBytes, StrictFloat, StrictInt, StrictStr, conlist +from pydantic import Field, StrictBytes, StrictFloat, StrictInt, StrictStr, conlist from typing import Any, Optional, Union @@ -5930,7 +5932,7 @@ class DefaultApi(object): _request_auth=_params.get('_request_auth')) @validate_arguments - def operation_one(self, param1 : StrictStr, param2 : conlist(StrictStr), param3 : Union[StrictFloat, StrictInt], path_param : StrictStr, x_header_param : StrictStr, test_request : TestRequest, param4 : Optional[StrictStr] = None, x_multi_value_header_param : Optional[conlist(StrictStr)] = None, **kwargs) -> TestResponse: # noqa: E501 + def operation_one(self, param1 : Annotated[StrictStr, Field(..., description="This is parameter 1")], param2 : Annotated[conlist(StrictStr), Field(..., description="This is parameter 2")], param3 : Union[StrictFloat, StrictInt], path_param : StrictStr, x_header_param : Annotated[StrictStr, Field(..., description="This is a header parameter")], test_request : TestRequest, param4 : Optional[StrictStr] = None, x_multi_value_header_param : Optional[conlist(StrictStr)] = None, **kwargs) -> TestResponse: # noqa: E501 """operation_one # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -5939,15 +5941,15 @@ class DefaultApi(object): >>> thread = api.operation_one(param1, param2, param3, path_param, x_header_param, test_request, param4, x_multi_value_header_param, async_req=True) >>> result = thread.get() - :param param1: (required) + :param param1: This is parameter 1 (required) :type param1: str - :param param2: (required) + :param param2: This is parameter 2 (required) :type param2: List[str] :param param3: (required) :type param3: float :param path_param: (required) :type path_param: str - :param x_header_param: (required) + :param x_header_param: This is a header parameter (required) :type x_header_param: str :param test_request: (required) :type test_request: TestRequest @@ -5972,7 +5974,7 @@ class DefaultApi(object): return self.operation_one_with_http_info(param1, param2, param3, path_param, x_header_param, test_request, param4, x_multi_value_header_param, **kwargs) # noqa: E501 @validate_arguments - def operation_one_with_http_info(self, param1 : StrictStr, param2 : conlist(StrictStr), param3 : Union[StrictFloat, StrictInt], path_param : StrictStr, x_header_param : StrictStr, test_request : TestRequest, param4 : Optional[StrictStr] = None, x_multi_value_header_param : Optional[conlist(StrictStr)] = None, **kwargs) -> ApiResponse: # noqa: E501 + def operation_one_with_http_info(self, param1 : Annotated[StrictStr, Field(..., description="This is parameter 1")], param2 : Annotated[conlist(StrictStr), Field(..., description="This is parameter 2")], param3 : Union[StrictFloat, StrictInt], path_param : StrictStr, x_header_param : Annotated[StrictStr, Field(..., description="This is a header parameter")], test_request : TestRequest, param4 : Optional[StrictStr] = None, x_multi_value_header_param : Optional[conlist(StrictStr)] = None, **kwargs) -> ApiResponse: # noqa: E501 """operation_one # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -5981,15 +5983,15 @@ class DefaultApi(object): >>> thread = api.operation_one_with_http_info(param1, param2, param3, path_param, x_header_param, test_request, param4, x_multi_value_header_param, async_req=True) >>> result = thread.get() - :param param1: (required) + :param param1: This is parameter 1 (required) :type param1: str - :param param2: (required) + :param param2: This is parameter 2 (required) :type param2: List[str] :param param3: (required) :type param3: float :param path_param: (required) :type path_param: str - :param x_header_param: (required) + :param x_header_param: This is a header parameter (required) :type x_header_param: str :param test_request: (required) :type test_request: TestRequest @@ -6264,7 +6266,7 @@ class DefaultApi(object): "test_project/api/operation_config.py": "from __future__ import annotations import urllib.parse import json -from typing import Callable, Any, Dict, List, NamedTuple, TypeVar, Generic, Union, TypedDict, Protocol, Optional, Literal +from typing import Callable, Any, Dict, List, NamedTuple, TypeVar, Generic, Union, TypedDict, Protocol, Optional, Literal, Annotated from functools import wraps from dataclasses import dataclass, fields from datetime import datetime @@ -6506,7 +6508,7 @@ class AnyRequestResponseRequestParameters(BaseModel): return cls.from_dict(json.loads(json_str)) def to_dict(self): - return self.dict(by_alias=True, exclude={}, exclude_none=True) + return self.dict(exclude={}, exclude_none=True) @classmethod def from_dict(cls, obj: dict) -> AnyRequestResponseRequestParameters: @@ -6620,7 +6622,7 @@ class EmptyRequestParameters(BaseModel): return cls.from_dict(json.loads(json_str)) def to_dict(self): - return self.dict(by_alias=True, exclude={}, exclude_none=True) + return self.dict(exclude={}, exclude_none=True) @classmethod def from_dict(cls, obj: dict) -> EmptyRequestParameters: @@ -6733,7 +6735,7 @@ class MapResponseRequestParameters(BaseModel): return cls.from_dict(json.loads(json_str)) def to_dict(self): - return self.dict(by_alias=True, exclude={}, exclude_none=True) + return self.dict(exclude={}, exclude_none=True) @classmethod def from_dict(cls, obj: dict) -> MapResponseRequestParameters: @@ -6846,7 +6848,7 @@ class MediaTypesRequestParameters(BaseModel): return cls.from_dict(json.loads(json_str)) def to_dict(self): - return self.dict(by_alias=True, exclude={}, exclude_none=True) + return self.dict(exclude={}, exclude_none=True) @classmethod def from_dict(cls, obj: dict) -> MediaTypesRequestParameters: @@ -6960,7 +6962,7 @@ class MultipleContentTypesRequestParameters(BaseModel): return cls.from_dict(json.loads(json_str)) def to_dict(self): - return self.dict(by_alias=True, exclude={}, exclude_none=True) + return self.dict(exclude={}, exclude_none=True) @classmethod def from_dict(cls, obj: dict) -> MultipleContentTypesRequestParameters: @@ -7060,13 +7062,13 @@ class OperationOneRequestParameters(BaseModel): """ Query, path and header parameters for the OperationOne operation """ - param1: StrictStr = Field(alias='param1') - param2: conlist(StrictStr) = Field(alias='param2') - param3: Union[StrictFloat, StrictInt] = Field(alias='param3') - path_param: StrictStr = Field(alias='pathParam') - x_header_param: StrictStr = Field(alias='x-header-param') - param4: Optional[StrictStr] = Field(alias='param4', default=None) - x_multi_value_header_param: Optional[conlist(StrictStr)] = Field(alias='x-multi-value-header-param', default=None) + param1: Annotated[StrictStr, Field(..., description="This is parameter 1")] + param2: Annotated[conlist(StrictStr), Field(..., description="This is parameter 2")] + param3: Union[StrictFloat, StrictInt] + path_param: StrictStr + x_header_param: Annotated[StrictStr, Field(..., description="This is a header parameter")] + param4: Optional[StrictStr] + x_multi_value_header_param: Optional[conlist(StrictStr)] class Config: """Pydantic configuration""" @@ -7081,7 +7083,7 @@ class OperationOneRequestParameters(BaseModel): return cls.from_dict(json.loads(json_str)) def to_dict(self): - return self.dict(by_alias=True, exclude={}, exclude_none=True) + return self.dict(exclude={}, exclude_none=True) @classmethod def from_dict(cls, obj: dict) -> OperationOneRequestParameters: @@ -7207,7 +7209,7 @@ class WithoutOperationIdDeleteRequestParameters(BaseModel): return cls.from_dict(json.loads(json_str)) def to_dict(self): - return self.dict(by_alias=True, exclude={}, exclude_none=True) + return self.dict(exclude={}, exclude_none=True) @classmethod def from_dict(cls, obj: dict) -> WithoutOperationIdDeleteRequestParameters: @@ -9170,7 +9172,7 @@ from pydantic import BaseModel, Field, StrictFloat, StrictInt class TestRequest(BaseModel): """ - TestRequest + This is a test request """ my_input: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="myInput") __properties = ["myInput"] @@ -9242,7 +9244,7 @@ from test_project.models.test_response_messages_inner import TestResponseMessage class TestResponse(BaseModel): """ - TestResponse + This is a test response """ messages: conlist(TestResponseMessagesInner) = Field(...) __properties = ["messages"] @@ -9322,7 +9324,7 @@ class TestResponseMessagesInner(BaseModel): """ TestResponseMessagesInner """ - message: Optional[StrictStr] = None + message: Optional[StrictStr] = Field(None, description="This is a message") id: StrictInt = Field(...) __properties = ["message", "id"] diff --git a/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript.test.ts.snap b/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript.test.ts.snap index f0bacf6b4..33968ff2c 100644 --- a/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript.test.ts.snap +++ b/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript.test.ts.snap @@ -3818,7 +3818,7 @@ export function MapResponseMapPropertyValueToJSON(value?: MapResponseMapProperty import { exists, mapValues } from '../runtime'; /** - * + * This is a test request * @export * @interface TestRequest */ @@ -3892,7 +3892,7 @@ import { } from './TestResponseMessagesInner'; /** - * + * This is a test response * @export * @interface TestResponse */ @@ -3966,7 +3966,7 @@ import { exists, mapValues } from '../runtime'; */ export interface TestResponseMessagesInner { /** - * + * This is a message * @type {string} * @memberof TestResponseMessagesInner */ From e1a6e49c12505e168b136d6ef390028e0c74509e Mon Sep 17 00:00:00 2001 From: Adrian Dimech <51220968+agdimech@users.noreply.github.com> Date: Mon, 30 Oct 2023 10:46:11 +1100 Subject: [PATCH 11/21] feat(infrastructure): allow stackName to be configurable (#617) --- .../java/src/java/groupId/Main.java.mustache | 2 +- .../samples/infrastructure/python/src/main.py.mustache | 2 +- .../infrastructure/typescript/src/main.ts.mustache | 2 +- packages/infrastructure/src/consts.ts | 3 +++ .../src/projects/java/infrastructure-java-project.ts | 9 +++++++++ .../src/projects/python/infrastructure-py-project.ts | 9 +++++++++ .../src/projects/typescript/infrastructure-ts-project.ts | 9 +++++++++ 7 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 packages/infrastructure/src/consts.ts diff --git a/packages/infrastructure/samples/infrastructure/java/src/java/groupId/Main.java.mustache b/packages/infrastructure/samples/infrastructure/java/src/java/groupId/Main.java.mustache index bc73500ca..90b23cb0b 100644 --- a/packages/infrastructure/samples/infrastructure/java/src/java/groupId/Main.java.mustache +++ b/packages/infrastructure/samples/infrastructure/java/src/java/groupId/Main.java.mustache @@ -27,7 +27,7 @@ public class Main { .nagPacks(Arrays.asList(new AwsPrototypingChecks())) .build()); - new ApplicationStack(app, "infra-dev", StackProps.builder() + new ApplicationStack(app, "{{{stackName}}}", StackProps.builder() .env(Environment.builder() .account(System.getenv("CDK_DEFAULT_ACCOUNT")) .region(System.getenv("CDK_DEFAULT_REGION")) diff --git a/packages/infrastructure/samples/infrastructure/python/src/main.py.mustache b/packages/infrastructure/samples/infrastructure/python/src/main.py.mustache index 405641827..a8915382c 100644 --- a/packages/infrastructure/samples/infrastructure/python/src/main.py.mustache +++ b/packages/infrastructure/samples/infrastructure/python/src/main.py.mustache @@ -12,7 +12,7 @@ dev_env = Environment( ) app = PDKNag.app(nag_packs=[AwsPrototypingChecks()]) -ApplicationStack(app, "infra-dev", env=dev_env) +ApplicationStack(app, "{{{stackName}}}", env=dev_env) graph = CdkGraph(app, plugins=[CdkGraphDiagramPlugin( defaults=IDiagramConfigBase( diff --git a/packages/infrastructure/samples/infrastructure/typescript/src/main.ts.mustache b/packages/infrastructure/samples/infrastructure/typescript/src/main.ts.mustache index e170eafd1..5124be4ce 100644 --- a/packages/infrastructure/samples/infrastructure/typescript/src/main.ts.mustache +++ b/packages/infrastructure/samples/infrastructure/typescript/src/main.ts.mustache @@ -15,7 +15,7 @@ const devEnv = { nagPacks: [new AwsPrototypingChecks()], }); - new ApplicationStack(app, "infra-dev", { env: devEnv }); + new ApplicationStack(app, "{{{stackName}}}", { env: devEnv }); const graph = new CdkGraph(app, { plugins: [ diff --git a/packages/infrastructure/src/consts.ts b/packages/infrastructure/src/consts.ts new file mode 100644 index 000000000..9606fe097 --- /dev/null +++ b/packages/infrastructure/src/consts.ts @@ -0,0 +1,3 @@ +/*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 */ +export const DEFAULT_STACK_NAME = "infra-dev"; diff --git a/packages/infrastructure/src/projects/java/infrastructure-java-project.ts b/packages/infrastructure/src/projects/java/infrastructure-java-project.ts index 5127c9cb2..e1bd44e3f 100644 --- a/packages/infrastructure/src/projects/java/infrastructure-java-project.ts +++ b/packages/infrastructure/src/projects/java/infrastructure-java-project.ts @@ -9,11 +9,19 @@ import * as Mustache from "mustache"; import { SampleFile } from "projen"; import { AwsCdkJavaApp } from "projen/lib/awscdk"; import { AwsCdkJavaAppOptions } from "./aws-cdk-java-app-options"; +import { DEFAULT_STACK_NAME } from "../../consts"; /** * Configuration options for the InfrastructureJavaProject. */ export interface InfrastructureJavaProjectOptions extends AwsCdkJavaAppOptions { + /** + * Stack name. + * + * @default infra-dev + */ + readonly stackName?: string; + /** * TypeSafeApi instance to use when setting up the initial project sample code. */ @@ -110,6 +118,7 @@ export class InfrastructureJavaProject extends AwsCdkJavaApp { const mustacheConfig = { hasApi, hasWebsite, + stackName: options.stackName || DEFAULT_STACK_NAME, infraPackage: `${options.typeSafeApi?.infrastructure.java?.pom.groupId}.${options.typeSafeApi?.infrastructure.java?.pom.name}.infra`, groupId, websiteDistRelativePath: diff --git a/packages/infrastructure/src/projects/python/infrastructure-py-project.ts b/packages/infrastructure/src/projects/python/infrastructure-py-project.ts index 9ca1e59b0..fd59c9807 100644 --- a/packages/infrastructure/src/projects/python/infrastructure-py-project.ts +++ b/packages/infrastructure/src/projects/python/infrastructure-py-project.ts @@ -9,11 +9,19 @@ import * as Mustache from "mustache"; import { SampleFile } from "projen"; import { AwsCdkPythonApp } from "projen/lib/awscdk"; import { AwsCdkPythonAppOptions } from "./aws-cdk-py-app-options"; +import { DEFAULT_STACK_NAME } from "../../consts"; /** * Configuration options for the InfrastructurePyProject. */ export interface InfrastructurePyProjectOptions extends AwsCdkPythonAppOptions { + /** + * Stack name. + * + * @default infra-dev + */ + readonly stackName?: string; + /** * TypeSafeApi instance to use when setting up the initial project sample code. */ @@ -96,6 +104,7 @@ export class InfrastructurePyProject extends AwsCdkPythonApp { const mustacheConfig = { hasApi, hasWebsite, + stackName: options.stackName || DEFAULT_STACK_NAME, infraPackage: options.typeSafeApi?.infrastructure.python?.moduleName, moduleName, websiteDistRelativePath: diff --git a/packages/infrastructure/src/projects/typescript/infrastructure-ts-project.ts b/packages/infrastructure/src/projects/typescript/infrastructure-ts-project.ts index b1299b5b6..712426d46 100644 --- a/packages/infrastructure/src/projects/typescript/infrastructure-ts-project.ts +++ b/packages/infrastructure/src/projects/typescript/infrastructure-ts-project.ts @@ -10,12 +10,20 @@ import { SampleFile } from "projen"; import { AwsCdkTypeScriptApp } from "projen/lib/awscdk"; import { NodeProject } from "projen/lib/javascript"; import { AwsCdkTypeScriptAppOptions } from "./aws-cdk-ts-app-options"; +import { DEFAULT_STACK_NAME } from "../../consts"; /** * Configuration options for the InfrastructureTsProject. */ export interface InfrastructureTsProjectOptions extends AwsCdkTypeScriptAppOptions { + /** + * Stack name. + * + * @default infra-dev + */ + readonly stackName?: string; + /** * TypeSafeApi instance to use when setting up the initial project sample code. */ @@ -91,6 +99,7 @@ export class InfrastructureTsProject extends AwsCdkTypeScriptApp { const mustacheConfig = { hasApi, hasWebsite, + stackName: options.stackName || DEFAULT_STACK_NAME, infraPackage: options.typeSafeApi?.infrastructure.typescript?.package.packageName, websiteDistRelativePath: From d1babf7395921aecd19ed95cb064cb41e47c4eaf Mon Sep 17 00:00:00 2001 From: Adrian Dimech <51220968+agdimech@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:44:58 +1100 Subject: [PATCH 12/21] fix(monorepo): ensure install:ci task is present in package.json for node projects (#618) --- package.json | 1 + .../monorepo/src/projects/typescript/monorepo-ts.ts | 7 +++++++ .../test/__snapshots__/monorepo.test.ts.snap | 13 +++++++++++++ .../type-safe-api-project.test.ts.snap | 10 ++++++++++ 4 files changed, 31 insertions(+) diff --git a/package.json b/package.json index 8bfc5d7d6..900e5b5a6 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "upgrade-deps": "pnpm exec projen upgrade-deps", "watch": "pnpm exec projen watch", "workspace:bin:link": "pnpm exec projen workspace:bin:link", + "install:ci": "pnpm exec projen install:ci", "synth-workspace": "pnpm exec projen" }, "devDependencies": { diff --git a/packages/monorepo/src/projects/typescript/monorepo-ts.ts b/packages/monorepo/src/projects/typescript/monorepo-ts.ts index 2d96fec8f..47b92e5d7 100644 --- a/packages/monorepo/src/projects/typescript/monorepo-ts.ts +++ b/packages/monorepo/src/projects/typescript/monorepo-ts.ts @@ -211,6 +211,13 @@ export class MonorepoTsProject break; } } + this.package.setScript( + "install:ci", + NodePackageUtils.command.exec( + this.package.packageManager, + "projen install:ci" + ) + ); this.workspaceConfig = options.workspaceConfig; this.workspacePackages = options.workspaceConfig?.additionalPackages ?? []; diff --git a/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap b/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap index 6a6546162..41907fd86 100644 --- a/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap +++ b/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap @@ -940,6 +940,7 @@ resolution-mode=highest "eject": "pnpm exec projen eject", "eslint": "pnpm exec projen eslint", "graph": "pnpm exec projen graph", + "install:ci": "pnpm exec projen install:ci", "package": "pnpm exec projen package", "post-compile": "pnpm exec projen post-compile", "post-upgrade": "pnpm exec projen post-upgrade", @@ -2967,6 +2968,7 @@ tsconfig.tsbuildinfo "eject": "yarn projen eject", "eslint": "yarn projen eslint", "graph": "yarn projen graph", + "install:ci": "yarn projen install:ci", "package": "yarn projen package", "post-compile": "yarn projen post-compile", "post-upgrade": "yarn projen post-upgrade", @@ -4989,6 +4991,7 @@ tsconfig.tsbuildinfo "eject": "yarn exec projen eject", "eslint": "yarn exec projen eslint", "graph": "yarn exec projen graph", + "install:ci": "yarn exec projen install:ci", "package": "yarn exec projen package", "post-compile": "yarn exec projen post-compile", "post-upgrade": "yarn exec projen post-upgrade", @@ -7006,6 +7009,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -8859,6 +8863,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -10592,6 +10597,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -11626,6 +11632,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -14938,6 +14945,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -15963,6 +15971,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -16991,6 +17000,7 @@ pattern1.txt "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -18026,6 +18036,7 @@ resolution-mode=highest "eject": "pnpm exec projen eject", "eslint": "pnpm exec projen eslint", "graph": "pnpm exec projen graph", + "install:ci": "pnpm exec projen install:ci", "package": "pnpm exec projen package", "post-compile": "pnpm exec projen post-compile", "post-upgrade": "pnpm exec projen post-upgrade", @@ -20059,6 +20070,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -21085,6 +21097,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", diff --git a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap index 2172e839a..0d75afa01 100644 --- a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap +++ b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap @@ -3878,6 +3878,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -11086,6 +11087,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -18495,6 +18497,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -33269,6 +33272,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -40071,6 +40075,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "npx projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -46050,6 +46055,7 @@ resolution-mode=highest "eject": "pnpm exec projen eject", "eslint": "pnpm exec projen eslint", "graph": "pnpm exec projen graph", + "install:ci": "pnpm exec projen install:ci", "package": "pnpm exec projen package", "post-compile": "pnpm exec projen post-compile", "post-upgrade": "pnpm exec projen post-upgrade", @@ -52620,6 +52626,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -60215,6 +60222,7 @@ tsconfig.tsbuildinfo "eject": "npx projen eject", "eslint": "npx projen eslint", "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", "package": "npx projen package", "post-compile": "npx projen post-compile", "post-upgrade": "npx projen post-upgrade", @@ -67210,6 +67218,7 @@ tsconfig.tsbuildinfo "eject": "yarn projen eject", "eslint": "yarn projen eslint", "graph": "yarn projen graph", + "install:ci": "yarn projen install:ci", "package": "yarn projen package", "post-compile": "yarn projen post-compile", "post-upgrade": "yarn projen post-upgrade", @@ -73179,6 +73188,7 @@ tsconfig.tsbuildinfo "eject": "yarn exec projen eject", "eslint": "yarn exec projen eslint", "graph": "yarn exec projen graph", + "install:ci": "yarn exec projen install:ci", "package": "yarn exec projen package", "post-compile": "yarn exec projen post-compile", "post-upgrade": "yarn exec projen post-upgrade", From 8e7b8b50b7d8694381fa39ac26cd2150cf93b1cd Mon Sep 17 00:00:00 2001 From: Jack Stevenson Date: Mon, 30 Oct 2023 14:31:14 +1100 Subject: [PATCH 13/21] fix(type-safe-api): ensure lambda function names do not exceed max length (#619) Truncate the lambda function names for the custom resource to ensure they are below the max length of 64 characters. Fixes #615 --- .../src/construct/type-safe-rest-api.ts | 15 +- .../type-safe-rest-api.test.ts.snap | 6666 ++++++++--------- .../test/construct/type-safe-rest-api.test.ts | 35 + 3 files changed, 3377 insertions(+), 3339 deletions(-) diff --git a/packages/type-safe-api/src/construct/type-safe-rest-api.ts b/packages/type-safe-api/src/construct/type-safe-rest-api.ts index c804f57bf..2b8ad66d7 100644 --- a/packages/type-safe-api/src/construct/type-safe-rest-api.ts +++ b/packages/type-safe-api/src/construct/type-safe-rest-api.ts @@ -125,9 +125,12 @@ export class TypeSafeRestApi extends Construct { const stack = Stack.of(this); - const prepareSpecLambdaName = `${PDKNag.getStackPrefix(stack) + // Lambda name prefix is truncated to 48 characters (16 below the max of 64) + const lambdaNamePrefix = `${PDKNag.getStackPrefix(stack) .split("/") - .join("-")}PrepareSpec${this.node.addr.slice(-8).toUpperCase()}`; + .join("-") + .slice(0, 40)}${this.node.addr.slice(-8).toUpperCase()}`; + const prepareSpecLambdaName = `${lambdaNamePrefix}PrepSpec`; const prepareSpecRole = new Role(this, "PrepareSpecRole", { assumedBy: new ServicePrincipal("lambda.amazonaws.com"), inlinePolicies: { @@ -210,7 +213,7 @@ export class TypeSafeRestApi extends Construct { ); // Create a custom resource for preparing the spec for deployment (adding integrations, authorizers, etc) - const prepareSpec = new LambdaFunction(this, "PrepareSpec", { + const prepareSpec = new LambdaFunction(this, "PrepareSpecHandler", { handler: "index.handler", runtime: Runtime.NODEJS_18_X, code: Code.fromAsset( @@ -221,7 +224,7 @@ export class TypeSafeRestApi extends Construct { functionName: prepareSpecLambdaName, }); - const providerFunctionName = `${prepareSpecLambdaName}-Provider`; + const providerFunctionName = `${lambdaNamePrefix}PrepSpecProvider`; const providerRole = new Role(this, "PrepareSpecProviderRole", { assumedBy: new ServicePrincipal("lambda.amazonaws.com"), inlinePolicies: { @@ -244,7 +247,7 @@ export class TypeSafeRestApi extends Construct { }, }); - const provider = new Provider(this, "PrepareSpecResourceProvider", { + const provider = new Provider(this, "PrepareSpecProvider", { onEventHandler: prepareSpec, role: providerRole, providerFunctionName, @@ -345,7 +348,7 @@ export class TypeSafeRestApi extends Construct { const prepareSpecCustomResource = new CustomResource( this, - "PrepareSpecResource", + "PrepareSpecCustomResource", { serviceToken: provider.serviceToken, properties: prepareApiSpecCustomResourceProperties, diff --git a/packages/type-safe-api/test/construct/__snapshots__/type-safe-rest-api.test.ts.snap b/packages/type-safe-api/test/construct/__snapshots__/type-safe-rest-api.test.ts.snap index 85ceaa564..fa494fa02 100644 --- a/packages/type-safe-api/test/construct/__snapshots__/type-safe-rest-api.test.ts.snap +++ b/packages/type-safe-api/test/construct/__snapshots__/type-safe-rest-api.test.ts.snap @@ -108,7 +108,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] "DeletionPolicy": "Retain", "DependsOn": [ "ApiTest1E0FDBC81", - "ApiTest1PrepareSpecResource90D3F124", + "ApiTest1PrepareSpecCustomResource30CD03AA", ], "Metadata": { "cdk_nag": { @@ -289,7 +289,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] "ApiTest1CloudWatchRole30B84AB0": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTest1PrepareSpecResource90D3F124", + "ApiTest1PrepareSpecCustomResource30CD03AA", ], "Metadata": { "cdk_nag": { @@ -354,9 +354,9 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTest1Deployment2E308FF829282c3ffceb3f752e192bfc30d947d6": { + "ApiTest1Deployment2E308FF82fc4f0a458a5f6de41661a6b62b5c224": { "DependsOn": [ - "ApiTest1PrepareSpecResource90D3F124", + "ApiTest1PrepareSpecCustomResource30CD03AA", ], "Metadata": { "cdk_nag": { @@ -401,7 +401,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] "ApiTest1DeploymentStageprod6B6E3F66": { "DependsOn": [ "ApiTest1Account37F1A1C0", - "ApiTest1PrepareSpecResource90D3F124", + "ApiTest1PrepareSpecCustomResource30CD03AA", ], "Metadata": { "cdk_nag": { @@ -446,7 +446,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTest1Deployment2E308FF829282c3ffceb3f752e192bfc30d947d6", + "Ref": "ApiTest1Deployment2E308FF82fc4f0a458a5f6de41661a6b62b5c224", }, "MethodSettings": [ { @@ -465,7 +465,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] }, "ApiTest1E0FDBC81": { "DependsOn": [ - "ApiTest1PrepareSpecResource90D3F124", + "ApiTest1PrepareSpecCustomResource30CD03AA", ], "Metadata": { "cdk_nag": { @@ -506,7 +506,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] }, "Key": { "Fn::GetAtt": [ - "ApiTest1PrepareSpecResource90D3F124", + "ApiTest1PrepareSpecCustomResource30CD03AA", "outputSpecKey", ], }, @@ -584,7 +584,103 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] }, "Type": "AWS::Lambda::Permission", }, - "ApiTest1PrepareSpecE7061D01": { + "ApiTest1PrepareSpecCustomResource30CD03AA": { + "DeletionPolicy": "Delete", + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ApiTest1PrepareSpecProviderframeworkonEvent9E64448F", + "Arn", + ], + }, + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", + }, + "integrations": { + "testOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", + }, + "securitySchemes": {}, + }, + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", + }, + "ApiTest1PrepareSpecHandler41DBA69C": { "DependsOn": [ "ApiTest1PrepareSpecRole6018776C", ], @@ -627,7 +723,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] }, "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", }, - "FunctionName": "Default-PrepareSpec85532C36", + "FunctionName": "Default-85532C36PrepSpec", "Handler": "index.handler", "Role": { "Fn::GetAtt": [ @@ -718,7 +814,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec85532C36-Provider", + ":log-group:/aws/lambda/Default-85532C36PrepSpecProvider", ], ], }, @@ -734,7 +830,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec85532C36-Provider:*", + ":log-group:/aws/lambda/Default-85532C36PrepSpecProvider:*", ], ], }, @@ -799,7 +895,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] "Resource": [ { "Fn::GetAtt": [ - "ApiTest1PrepareSpecE7061D01", + "ApiTest1PrepareSpecHandler41DBA69C", "Arn", ], }, @@ -809,7 +905,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] [ { "Fn::GetAtt": [ - "ApiTest1PrepareSpecE7061D01", + "ApiTest1PrepareSpecHandler41DBA69C", "Arn", ], }, @@ -831,103 +927,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] }, "Type": "AWS::IAM::Policy", }, - "ApiTest1PrepareSpecResource90D3F124": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTest1PrepareSpecResourceProviderframeworkonEventCE6393EE", - "Arn", - ], - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", - }, - "integrations": { - "testOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "LambdaD247545B", - "Arn", - ], - }, - "/invocations", - ], - ], - }, - }, - }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", - }, - "securitySchemes": {}, - }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", - }, - "ApiTest1PrepareSpecResourceProviderframeworkonEventCE6393EE": { + "ApiTest1PrepareSpecProviderframeworkonEvent9E64448F": { "DependsOn": [ "ApiTest1PrepareSpecProviderRoleDefaultPolicyFCE97042", "ApiTest1PrepareSpecProviderRoleA1D8F665", @@ -979,18 +979,18 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest1/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest1/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTest1PrepareSpecE7061D01", + "ApiTest1PrepareSpecHandler41DBA69C", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec85532C36-Provider", + "FunctionName": "Default-85532C36PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -1010,7 +1010,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec85532C36:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-85532C36PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -1028,7 +1028,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec85532C36:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-85532C36PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -1109,7 +1109,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec85532C36", + ":log-group:/aws/lambda/Default-85532C36PrepSpec", ], ], }, @@ -1125,7 +1125,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec85532C36:*", + ":log-group:/aws/lambda/Default-85532C36PrepSpec:*", ], ], }, @@ -1190,7 +1190,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] }, "ApiTest29D927A57": { "DependsOn": [ - "ApiTest2PrepareSpecResourceD26A81CE", + "ApiTest2PrepareSpecCustomResource2182A9C5", ], "Metadata": { "cdk_nag": { @@ -1231,7 +1231,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] }, "Key": { "Fn::GetAtt": [ - "ApiTest2PrepareSpecResourceD26A81CE", + "ApiTest2PrepareSpecCustomResource2182A9C5", "outputSpecKey", ], }, @@ -1284,7 +1284,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] "DeletionPolicy": "Retain", "DependsOn": [ "ApiTest29D927A57", - "ApiTest2PrepareSpecResourceD26A81CE", + "ApiTest2PrepareSpecCustomResource2182A9C5", ], "Metadata": { "cdk_nag": { @@ -1465,7 +1465,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] "ApiTest2CloudWatchRole72C1A98D": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTest2PrepareSpecResourceD26A81CE", + "ApiTest2PrepareSpecCustomResource2182A9C5", ], "Metadata": { "cdk_nag": { @@ -1530,9 +1530,9 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTest2DeploymentF5547FBBf114e24fd32a3a02b1d1eb07572095f3": { + "ApiTest2DeploymentF5547FBB0628ff5b414eb67a464523f7ee50546d": { "DependsOn": [ - "ApiTest2PrepareSpecResourceD26A81CE", + "ApiTest2PrepareSpecCustomResource2182A9C5", ], "Metadata": { "cdk_nag": { @@ -1577,7 +1577,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] "ApiTest2DeploymentStageprodF3467DC1": { "DependsOn": [ "ApiTest2Account685F675E", - "ApiTest2PrepareSpecResourceD26A81CE", + "ApiTest2PrepareSpecCustomResource2182A9C5", ], "Metadata": { "cdk_nag": { @@ -1622,7 +1622,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTest2DeploymentF5547FBBf114e24fd32a3a02b1d1eb07572095f3", + "Ref": "ApiTest2DeploymentF5547FBB0628ff5b414eb67a464523f7ee50546d", }, "MethodSettings": [ { @@ -1708,10 +1708,8 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] }, "Type": "AWS::Lambda::Permission", }, - "ApiTest2PrepareSpec6015FD84": { - "DependsOn": [ - "ApiTest2PrepareSpecRoleE638C076", - ], + "ApiTest2PrepareSpecCustomResource2182A9C5": { + "DeletionPolicy": "Delete", "Metadata": { "cdk_nag": { "rules_to_suppress": [ @@ -1745,70 +1743,168 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] }, }, "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", - }, - "FunctionName": "Default-PrepareSpec300D0E5F", - "Handler": "index.handler", - "Role": { + "ServiceToken": { "Fn::GetAtt": [ - "ApiTest2PrepareSpecRoleE638C076", + "ApiTest2PrepareSpecProviderframeworkonEventC9470DD8", "Arn", ], }, - "Runtime": "nodejs18.x", - "Timeout": 30, - }, - "Type": "AWS::Lambda::Function", - }, - "ApiTest2PrepareSpecProviderRole59C44E6C": { - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "id": "AwsSolutions-IAM5", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", - }, - { - "id": "AwsPrototyping-IAMNoWildcardPermissions", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", }, - }, - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { + "integrations": { + "testOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", + }, + "securitySchemes": {}, + }, + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", + }, + "ApiTest2PrepareSpecHandler8A43E4DB": { + "DependsOn": [ + "ApiTest2PrepareSpecRoleE638C076", + ], + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", + }, + "FunctionName": "Default-300D0E5FPrepSpec", + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "ApiTest2PrepareSpecRoleE638C076", + "Arn", + ], + }, + "Runtime": "nodejs18.x", + "Timeout": 30, + }, + "Type": "AWS::Lambda::Function", + }, + "ApiTest2PrepareSpecProviderRole59C44E6C": { + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "id": "AwsSolutions-IAM5", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + }, + { + "id": "AwsPrototyping-IAMNoWildcardPermissions", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { @@ -1842,7 +1938,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec300D0E5F-Provider", + ":log-group:/aws/lambda/Default-300D0E5FPrepSpecProvider", ], ], }, @@ -1858,7 +1954,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec300D0E5F-Provider:*", + ":log-group:/aws/lambda/Default-300D0E5FPrepSpecProvider:*", ], ], }, @@ -1923,7 +2019,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] "Resource": [ { "Fn::GetAtt": [ - "ApiTest2PrepareSpec6015FD84", + "ApiTest2PrepareSpecHandler8A43E4DB", "Arn", ], }, @@ -1933,7 +2029,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] [ { "Fn::GetAtt": [ - "ApiTest2PrepareSpec6015FD84", + "ApiTest2PrepareSpecHandler8A43E4DB", "Arn", ], }, @@ -1955,103 +2051,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] }, "Type": "AWS::IAM::Policy", }, - "ApiTest2PrepareSpecResourceD26A81CE": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTest2PrepareSpecResourceProviderframeworkonEventF2315413", - "Arn", - ], - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", - }, - "integrations": { - "testOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "LambdaD247545B", - "Arn", - ], - }, - "/invocations", - ], - ], - }, - }, - }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", - }, - "securitySchemes": {}, - }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", - }, - "ApiTest2PrepareSpecResourceProviderframeworkonEventF2315413": { + "ApiTest2PrepareSpecProviderframeworkonEventC9470DD8": { "DependsOn": [ "ApiTest2PrepareSpecProviderRoleDefaultPolicyA41E659C", "ApiTest2PrepareSpecProviderRole59C44E6C", @@ -2103,18 +2103,18 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest2/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest2/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTest2PrepareSpec6015FD84", + "ApiTest2PrepareSpecHandler8A43E4DB", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec300D0E5F-Provider", + "FunctionName": "Default-300D0E5FPrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -2134,7 +2134,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec300D0E5F:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-300D0E5FPrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -2152,7 +2152,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec300D0E5F:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-300D0E5FPrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -2233,7 +2233,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec300D0E5F", + ":log-group:/aws/lambda/Default-300D0E5FPrepSpec", ], ], }, @@ -2249,7 +2249,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Create 2 APIs on same stack 1`] { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec300D0E5F:*", + ":log-group:/aws/lambda/Default-300D0E5FPrepSpec:*", ], ], }, @@ -2503,7 +2503,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -2684,7 +2684,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -2749,9 +2749,9 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC4789714f15d025ac32418baad3768f6c629": { + "ApiTestDeployment153EC4781c1d08559e5f0b03e31c4dcb542fe38a": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -2796,7 +2796,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -2841,7 +2841,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC4789714f15d025ac32418baad3768f6c629", + "Ref": "ApiTestDeployment153EC4781c1d08559e5f0b03e31c4dcb542fe38a", }, "MethodSettings": [ { @@ -2860,7 +2860,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -3046,10 +3046,8 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` }, "Type": "AWS::Lambda::Permission", }, - "ApiTestPrepareSpecA3536D2B": { - "DependsOn": [ - "ApiTestPrepareSpecRole44D562E5", - ], + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", "Metadata": { "cdk_nag": { "rules_to_suppress": [ @@ -3083,17 +3081,115 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` }, }, "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", - }, - "FunctionName": "Default-PrepareSpec3E755E54", - "Handler": "index.handler", - "Role": { + "ServiceToken": { "Fn::GetAtt": [ - "ApiTestPrepareSpecRole44D562E5", + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", + "Arn", + ], + }, + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", + }, + "integrations": { + "testOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", + }, + "securitySchemes": {}, + }, + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", + }, + "ApiTestPrepareSpecHandler46C6FEB5": { + "DependsOn": [ + "ApiTestPrepareSpecRole44D562E5", + ], + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", + }, + "FunctionName": "Default-3E755E54PrepSpec", + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "ApiTestPrepareSpecRole44D562E5", "Arn", ], }, @@ -3152,7 +3248,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` "Resource": [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -3162,7 +3258,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -3262,7 +3358,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", ], ], }, @@ -3278,7 +3374,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", ], ], }, @@ -3293,103 +3389,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` }, "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", - "Arn", - ], - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", - }, - "integrations": { - "testOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "LambdaD247545B", - "Arn", - ], - }, - "/invocations", - ], - ], - }, - }, - }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", - }, - "securitySchemes": {}, - }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", - }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -3441,18 +3441,18 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -3472,7 +3472,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -3490,7 +3490,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -3571,7 +3571,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -3587,7 +3587,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Local Mode 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, @@ -3813,7 +3813,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -3994,7 +3994,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -4059,9 +4059,9 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC478ea304cc67d1740dcd707f988306159b0": { + "ApiTestDeployment153EC47838079670259c24557112d51aa8c99f2d": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -4106,7 +4106,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -4151,7 +4151,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC478ea304cc67d1740dcd707f988306159b0", + "Ref": "ApiTestDeployment153EC47838079670259c24557112d51aa8c99f2d", }, "MethodSettings": [ { @@ -4170,7 +4170,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -4211,7 +4211,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], }, @@ -4289,10 +4289,8 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers }, "Type": "AWS::Lambda::Permission", }, - "ApiTestPrepareSpecA3536D2B": { - "DependsOn": [ - "ApiTestPrepareSpecRole44D562E5", - ], + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", "Metadata": { "cdk_nag": { "rules_to_suppress": [ @@ -4326,64 +4324,165 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers }, }, "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", - }, - "FunctionName": "Default-PrepareSpec3E755E54", - "Handler": "index.handler", - "Role": { + "ServiceToken": { "Fn::GetAtt": [ - "ApiTestPrepareSpecRole44D562E5", + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", "Arn", ], }, - "Runtime": "nodejs18.x", - "Timeout": 30, - }, - "Type": "AWS::Lambda::Function", - }, - "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78": { - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "id": "AwsSolutions-IAM5", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", - }, - { - "id": "AwsPrototyping-IAMNoWildcardPermissions", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], + "defaultAuthorizerReference": { + "authorizerId": "none", + }, + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", + }, + "integrations": { + "testOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", + }, + "securitySchemes": {}, + }, + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", + }, + "ApiTestPrepareSpecHandler46C6FEB5": { + "DependsOn": [ + "ApiTestPrepareSpecRole44D562E5", + ], + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", + }, + "FunctionName": "Default-3E755E54PrepSpec", + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "ApiTestPrepareSpecRole44D562E5", + "Arn", + ], + }, + "Runtime": "nodejs18.x", + "Timeout": 30, + }, + "Type": "AWS::Lambda::Function", + }, + "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78": { + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "id": "AwsSolutions-IAM5", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + }, + { + "id": "AwsPrototyping-IAMNoWildcardPermissions", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], }, }, "Properties": { @@ -4395,7 +4494,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers "Resource": [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -4405,7 +4504,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -4505,7 +4604,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", ], ], }, @@ -4521,7 +4620,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", ], ], }, @@ -4536,106 +4635,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers }, "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", - "Arn", - ], - }, - "defaultAuthorizerReference": { - "authorizerId": "none", - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", - }, - "integrations": { - "testOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "LambdaD247545B", - "Arn", - ], - }, - "/invocations", - ], - ], - }, - }, - }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", - }, - "securitySchemes": {}, - }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", - }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -4687,18 +4687,18 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -4718,7 +4718,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -4736,7 +4736,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -4817,7 +4817,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -4833,7 +4833,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Permits Matching No Authorizers { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, @@ -5059,7 +5059,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -5240,7 +5240,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -5305,9 +5305,9 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC47845bc057e867fdbb6199242334c8d117a": { + "ApiTestDeployment153EC47894f72739a02c7563be2a8cc00e09568e": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -5352,7 +5352,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -5397,7 +5397,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC47845bc057e867fdbb6199242334c8d117a", + "Ref": "ApiTestDeployment153EC47894f72739a02c7563be2a8cc00e09568e", }, "MethodSettings": [ { @@ -5416,7 +5416,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -5457,7 +5457,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], }, @@ -5742,255 +5742,8 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to }, "Type": "AWS::Lambda::Permission", }, - "ApiTestPrepareSpecA3536D2B": { - "DependsOn": [ - "ApiTestPrepareSpecRole44D562E5", - ], - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", - }, - "FunctionName": "Default-PrepareSpec3E755E54", - "Handler": "index.handler", - "Role": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecRole44D562E5", - "Arn", - ], - }, - "Runtime": "nodejs18.x", - "Timeout": 30, - }, - "Type": "AWS::Lambda::Function", - }, - "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78": { - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "id": "AwsSolutions-IAM5", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", - }, - { - "id": "AwsPrototyping-IAMNoWildcardPermissions", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "lambda:InvokeFunction", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", - "Arn", - ], - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", - "Arn", - ], - }, - ":*", - ], - ], - }, - ], - }, - ], - "Version": "2012-10-17", - }, - "PolicyName": "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", - "Roles": [ - { - "Ref": "ApiTestPrepareSpecProviderRoleF47822B8", - }, - ], - }, - "Type": "AWS::IAM::Policy", - }, - "ApiTestPrepareSpecProviderRoleF47822B8": { - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "id": "AwsSolutions-IAM5", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", - }, - { - "id": "AwsPrototyping-IAMNoWildcardPermissions", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com", - }, - }, - ], - "Version": "2012-10-17", - }, - "Policies": [ - { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents", - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:aws:logs:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", - ], - ], - }, - { - "Fn::Join": [ - "", - [ - "arn:aws:logs:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", - ], - ], - }, - ], - }, - ], - "Version": "2012-10-17", - }, - "PolicyName": "logs", - }, - ], - }, - "Type": "AWS::IAM::Role", - }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", "Metadata": { "cdk_nag": { "rules_to_suppress": [ @@ -6026,7 +5779,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to "Properties": { "ServiceToken": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", "Arn", ], }, @@ -6221,22 +5974,13 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to "Type": "AWS::CloudFormation::CustomResource", "UpdateReplacePolicy": "Delete", }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecHandler46C6FEB5": { "DependsOn": [ - "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", - "ApiTestPrepareSpecProviderRoleF47822B8", + "ApiTestPrepareSpecRole44D562E5", ], "Metadata": { "cdk_nag": { "rules_to_suppress": [ - { - "id": "AwsSolutions-L1", - "reason": "Latest runtime cannot be configured. CDK will need to upgrade the Provider construct accordingly.", - }, - { - "id": "AwsPrototyping-LambdaLatestVersion", - "reason": "Latest runtime cannot be configured. CDK will need to upgrade the Provider construct accordingly.", - }, { "applies_to": [ { @@ -6271,71 +6015,114 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", }, - "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", + "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", - "Environment": { - "Variables": { - "USER_ON_EVENT_FUNCTION_ARN": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", - "Arn", - ], - }, - }, - }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", - "Handler": "framework.onEvent", + "FunctionName": "Default-3E755E54PrepSpec", + "Handler": "index.handler", "Role": { "Fn::GetAtt": [ - "ApiTestPrepareSpecProviderRoleF47822B8", + "ApiTestPrepareSpecRole44D562E5", "Arn", ], }, "Runtime": "nodejs18.x", - "Timeout": 900, + "Timeout": 30, }, "Type": "AWS::Lambda::Function", }, - "ApiTestPrepareSpecRole44D562E5": { + "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78": { "Metadata": { "cdk_nag": { "rules_to_suppress": [ { - "applies_to": [ - { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", - }, - ], "id": "AwsSolutions-IAM5", "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", }, + { + "id": "AwsPrototyping-IAMNoWildcardPermissions", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + }, { "applies_to": [ { - "regex": "/^Resource::arn::s3:.*/1b379c070728ce6e390dc775a85f16303a2625450133ff14c948409d76eb41c8.json-prepared/*/g", + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", }, ], - "id": "AwsSolutions-IAM5", - "reason": "S3 resources have been scoped down to the appropriate prefix in the CDK asset bucket, however * is still needed as since the prepared spec hash is not known until deploy time.", + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", }, { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", }, ], - "id": "AwsPrototyping-IAMNoWildcardPermissions", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", }, { - "applies_to": [ + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ { - "regex": "/^Resource::arn::s3:.*/1b379c070728ce6e390dc775a85f16303a2625450133ff14c948409d76eb41c8.json-prepared/*/g", + "Fn::GetAtt": [ + "ApiTestPrepareSpecHandler46C6FEB5", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ApiTestPrepareSpecHandler46C6FEB5", + "Arn", + ], + }, + ":*", + ], + ], }, ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", + "Roles": [ + { + "Ref": "ApiTestPrepareSpecProviderRoleF47822B8", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, + "ApiTestPrepareSpecProviderRoleF47822B8": { + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "id": "AwsSolutions-IAM5", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + }, + { "id": "AwsPrototyping-IAMNoWildcardPermissions", - "reason": "S3 resources have been scoped down to the appropriate prefix in the CDK asset bucket, however * is still needed as since the prepared spec hash is not known until deploy time.", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", }, { "applies_to": [ @@ -6403,7 +6190,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", ], ], }, @@ -6419,7 +6206,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", ], ], }, @@ -6430,142 +6217,355 @@ exports[`Type Safe Rest Api Construct Unit Tests Should add header parameters to }, "PolicyName": "logs", }, - { - "PolicyDocument": { - "Statement": [ - { - "Action": "s3:getObject", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "/1b379c070728ce6e390dc775a85f16303a2625450133ff14c948409d76eb41c8.json", - ], - ], - }, - }, - { - "Action": "s3:putObject", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":s3:::", - { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "/1b379c070728ce6e390dc775a85f16303a2625450133ff14c948409d76eb41c8.json-prepared/*", - ], - ], - }, - }, - ], - "Version": "2012-10-17", - }, - "PolicyName": "s3", - }, ], }, "Type": "AWS::IAM::Role", }, - "Lambda1DB8E9965": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ - "Lambda1ServiceRoleF188C4B8", + "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", + "ApiTestPrepareSpecProviderRoleF47822B8", ], - "Properties": { - "Code": { - "ZipFile": "code", - }, - "Handler": "handler", - "Role": { - "Fn::GetAtt": [ - "Lambda1ServiceRoleF188C4B8", - "Arn", - ], - }, - "Runtime": "nodejs16.x", - }, - "Type": "AWS::Lambda::Function", - }, - "Lambda1ServiceRoleF188C4B8": { - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com", - }, + "id": "AwsSolutions-L1", + "reason": "Latest runtime cannot be configured. CDK will need to upgrade the Provider construct accordingly.", }, - ], - "Version": "2012-10-17", - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", + { + "id": "AwsPrototyping-LambdaLatestVersion", + "reason": "Latest runtime cannot be configured. CDK will need to upgrade the Provider construct accordingly.", + }, + { + "applies_to": [ { - "Ref": "AWS::Partition", + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", ], - ], - }, - ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, }, - "Type": "AWS::IAM::Role", - }, - "Lambda217CFB423": { - "DependsOn": [ - "Lambda2ServiceRole31A072E1", - ], "Properties": { "Code": { - "ZipFile": "code", + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Handler": "handler", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "ApiTestPrepareSpecHandler46C6FEB5", + "Arn", + ], + }, + }, + }, + "FunctionName": "Default-3E755E54PrepSpecProvider", + "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ - "Lambda2ServiceRole31A072E1", + "ApiTestPrepareSpecProviderRoleF47822B8", "Arn", ], }, - "Runtime": "nodejs16.x", + "Runtime": "nodejs18.x", + "Timeout": 900, }, "Type": "AWS::Lambda::Function", }, - "Lambda2ServiceRole31A072E1": { - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ + "ApiTestPrepareSpecRole44D562E5": { + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com", - }, - }, - ], - "Version": "2012-10-17", - }, - "ManagedPolicyArns": [ + "applies_to": [ + { + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", + }, + ], + "id": "AwsSolutions-IAM5", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + }, + { + "applies_to": [ + { + "regex": "/^Resource::arn::s3:.*/1b379c070728ce6e390dc775a85f16303a2625450133ff14c948409d76eb41c8.json-prepared/*/g", + }, + ], + "id": "AwsSolutions-IAM5", + "reason": "S3 resources have been scoped down to the appropriate prefix in the CDK asset bucket, however * is still needed as since the prepared spec hash is not known until deploy time.", + }, + { + "applies_to": [ + { + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", + }, + ], + "id": "AwsPrototyping-IAMNoWildcardPermissions", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + }, + { + "applies_to": [ + { + "regex": "/^Resource::arn::s3:.*/1b379c070728ce6e390dc775a85f16303a2625450133ff14c948409d76eb41c8.json-prepared/*/g", + }, + ], + "id": "AwsPrototyping-IAMNoWildcardPermissions", + "reason": "S3 resources have been scoped down to the appropriate prefix in the CDK asset bucket, however * is still needed as since the prepared spec hash is not known until deploy time.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com", + }, + }, + ], + "Version": "2012-10-17", + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents", + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:logs:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", + ], + ], + }, + { + "Fn::Join": [ + "", + [ + "arn:aws:logs:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "logs", + }, + { + "PolicyDocument": { + "Statement": [ + { + "Action": "s3:getObject", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "/1b379c070728ce6e390dc775a85f16303a2625450133ff14c948409d76eb41c8.json", + ], + ], + }, + }, + { + "Action": "s3:putObject", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "/1b379c070728ce6e390dc775a85f16303a2625450133ff14c948409d76eb41c8.json-prepared/*", + ], + ], + }, + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "s3", + }, + ], + }, + "Type": "AWS::IAM::Role", + }, + "Lambda1DB8E9965": { + "DependsOn": [ + "Lambda1ServiceRoleF188C4B8", + ], + "Properties": { + "Code": { + "ZipFile": "code", + }, + "Handler": "handler", + "Role": { + "Fn::GetAtt": [ + "Lambda1ServiceRoleF188C4B8", + "Arn", + ], + }, + "Runtime": "nodejs16.x", + }, + "Type": "AWS::Lambda::Function", + }, + "Lambda1ServiceRoleF188C4B8": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com", + }, + }, + ], + "Version": "2012-10-17", + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", + ], + ], + }, + ], + }, + "Type": "AWS::IAM::Role", + }, + "Lambda217CFB423": { + "DependsOn": [ + "Lambda2ServiceRole31A072E1", + ], + "Properties": { + "Code": { + "ZipFile": "code", + }, + "Handler": "handler", + "Role": { + "Fn::GetAtt": [ + "Lambda2ServiceRole31A072E1", + "Arn", + ], + }, + "Runtime": "nodejs16.x", + }, + "Type": "AWS::Lambda::Function", + }, + "Lambda2ServiceRole31A072E1": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com", + }, + }, + ], + "Version": "2012-10-17", + }, + "ManagedPolicyArns": [ { "Fn::Join": [ "", @@ -7186,7 +7186,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -7367,7 +7367,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -7432,9 +7432,9 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC478dc93de2fef0f82ebbfb635f6bbddb176": { + "ApiTestDeployment153EC4783909f7c5ff6f3e4849abee9771dfb63a": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -7479,7 +7479,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -7524,7 +7524,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC478dc93de2fef0f82ebbfb635f6bbddb176", + "Ref": "ApiTestDeployment153EC4783909f7c5ff6f3e4849abee9771dfb63a", }, "MethodSettings": [ { @@ -7543,7 +7543,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -7584,7 +7584,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], }, @@ -7729,9 +7729,207 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions ], }, }, - "Type": "AWS::Lambda::Permission", + "Type": "AWS::Lambda::Permission", + }, + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", + "Arn", + ], + }, + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "59c8d7b10656c48be66a3a7cb22540b5dc6f56cfa67229affa21977c6567f30e.json", + }, + "integrations": { + "deleteOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Lambda1DB8E9965", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + "getOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Lambda1DB8E9965", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + "postOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Lambda217CFB423", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + "putOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "Lambda1DB8E9965", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + }, + "operationLookup": { + "deleteOperation": { + "method": "delete", + "path": "/test", + }, + "getOperation": { + "method": "get", + "path": "/test", + }, + "postOperation": { + "method": "post", + "path": "/test", + }, + "putOperation": { + "method": "put", + "path": "/test", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "59c8d7b10656c48be66a3a7cb22540b5dc6f56cfa67229affa21977c6567f30e.json-prepared", + }, + "securitySchemes": {}, + }, + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", }, - "ApiTestPrepareSpecA3536D2B": { + "ApiTestPrepareSpecHandler46C6FEB5": { "DependsOn": [ "ApiTestPrepareSpecRole44D562E5", ], @@ -7774,7 +7972,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions }, "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", }, - "FunctionName": "Default-PrepareSpec3E755E54", + "FunctionName": "Default-3E755E54PrepSpec", "Handler": "index.handler", "Role": { "Fn::GetAtt": [ @@ -7837,7 +8035,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions "Resource": [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -7847,336 +8045,138 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, ":*", ], ], - }, - ], - }, - ], - "Version": "2012-10-17", - }, - "PolicyName": "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", - "Roles": [ - { - "Ref": "ApiTestPrepareSpecProviderRoleF47822B8", - }, - ], - }, - "Type": "AWS::IAM::Policy", - }, - "ApiTestPrepareSpecProviderRoleF47822B8": { - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "id": "AwsSolutions-IAM5", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", - }, - { - "id": "AwsPrototyping-IAMNoWildcardPermissions", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com", - }, - }, - ], - "Version": "2012-10-17", - }, - "Policies": [ - { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents", - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:aws:logs:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", - ], - ], - }, - { - "Fn::Join": [ - "", - [ - "arn:aws:logs:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", - ], - ], - }, - ], - }, - ], - "Version": "2012-10-17", - }, - "PolicyName": "logs", - }, - ], - }, - "Type": "AWS::IAM::Role", - }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", - "Arn", - ], - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "59c8d7b10656c48be66a3a7cb22540b5dc6f56cfa67229affa21977c6567f30e.json", - }, - "integrations": { - "deleteOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "Lambda1DB8E9965", - "Arn", - ], - }, - "/invocations", - ], - ], - }, - }, - }, - "getOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "Lambda1DB8E9965", - "Arn", - ], - }, - "/invocations", - ], - ], - }, + }, + ], }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", + "Roles": [ + { + "Ref": "ApiTestPrepareSpecProviderRoleF47822B8", }, - "postOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "Lambda217CFB423", - "Arn", - ], - }, - "/invocations", - ], - ], + ], + }, + "Type": "AWS::IAM::Policy", + }, + "ApiTestPrepareSpecProviderRoleF47822B8": { + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "id": "AwsSolutions-IAM5", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + }, + { + "id": "AwsPrototyping-IAMNoWildcardPermissions", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com", }, }, - }, - "putOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", + ], + "Version": "2012-10-17", + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents", + ], + "Effect": "Allow", + "Resource": [ { - "Ref": "AWS::Region", + "Fn::Join": [ + "", + [ + "arn:aws:logs:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", + ], + ], }, - ":lambda:path/2015-03-31/functions/", { - "Fn::GetAtt": [ - "Lambda1DB8E9965", - "Arn", + "Fn::Join": [ + "", + [ + "arn:aws:logs:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", + ], ], }, - "/invocations", ], - ], - }, + }, + ], + "Version": "2012-10-17", }, + "PolicyName": "logs", }, - }, - "operationLookup": { - "deleteOperation": { - "method": "delete", - "path": "/test", - }, - "getOperation": { - "method": "get", - "path": "/test", - }, - "postOperation": { - "method": "post", - "path": "/test", - }, - "putOperation": { - "method": "put", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "59c8d7b10656c48be66a3a7cb22540b5dc6f56cfa67229affa21977c6567f30e.json-prepared", - }, - "securitySchemes": {}, + ], }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", + "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -8228,18 +8228,18 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -8259,7 +8259,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -8277,7 +8277,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -8358,7 +8358,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -8374,7 +8374,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should consolidate permissions { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, @@ -8650,7 +8650,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -8831,7 +8831,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -8896,9 +8896,9 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC478e7ffe1cfd3a74c45e7b50a4ea8ddf8e2": { + "ApiTestDeployment153EC478faa243d7b88abc45cdf0192565d77ac9": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -8943,7 +8943,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -8988,7 +8988,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC478e7ffe1cfd3a74c45e7b50a4ea8ddf8e2", + "Ref": "ApiTestDeployment153EC478faa243d7b88abc45cdf0192565d77ac9", }, "MethodSettings": [ { @@ -9007,7 +9007,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -9048,17 +9048,87 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], }, }, - "MinimumCompressionSize": 20, - "Name": "ApiTest", + "MinimumCompressionSize": 20, + "Name": "ApiTest", + }, + "Type": "AWS::ApiGateway::RestApi", + }, + "ApiTestLambdaPermissiontestOperationECAC1A2D": { + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":execute-api:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":", + { + "Ref": "ApiTestEE73F324", + }, + "/*/GET/test", + ], + ], + }, }, - "Type": "AWS::ApiGateway::RestApi", + "Type": "AWS::Lambda::Permission", }, - "ApiTestLambdaPermissiontestOperationECAC1A2D": { + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", "Metadata": { "cdk_nag": { "rules_to_suppress": [ @@ -9092,42 +9162,68 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = }, }, "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { + "ServiceToken": { "Fn::GetAtt": [ - "LambdaD247545B", + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", "Arn", ], }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":execute-api:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":", - { - "Ref": "ApiTestEE73F324", + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", + }, + "integrations": { + "testOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "/invocations", + ], + ], }, - "/*/GET/test", - ], - ], + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", }, + "securitySchemes": {}, }, - "Type": "AWS::Lambda::Permission", + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", }, - "ApiTestPrepareSpecA3536D2B": { + "ApiTestPrepareSpecHandler46C6FEB5": { "DependsOn": [ "ApiTestPrepareSpecRole44D562E5", ], @@ -9170,7 +9266,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = }, "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", }, - "FunctionName": "Default-PrepareSpec3E755E54", + "FunctionName": "Default-3E755E54PrepSpec", "Handler": "index.handler", "Role": { "Fn::GetAtt": [ @@ -9233,7 +9329,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = "Resource": [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -9243,7 +9339,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -9343,7 +9439,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", ], ], }, @@ -9359,7 +9455,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", ], ], }, @@ -9374,103 +9470,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = }, "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", - "Arn", - ], - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", - }, - "integrations": { - "testOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "LambdaD247545B", - "Arn", - ], - }, - "/invocations", - ], - ], - }, - }, - }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", - }, - "securitySchemes": {}, - }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", - }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -9522,18 +9522,18 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -9553,7 +9553,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -9571,7 +9571,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -9652,7 +9652,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -9668,7 +9668,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Should enable compression 1`] = { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, @@ -9894,7 +9894,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -10075,7 +10075,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -10140,9 +10140,9 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC478950afb915db24dc651450ed2227b1233": { + "ApiTestDeployment153EC478ba688c73ecd411d6bc46f33941546de6": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -10187,7 +10187,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -10232,7 +10232,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC478950afb915db24dc651450ed2227b1233", + "Ref": "ApiTestDeployment153EC478ba688c73ecd411d6bc46f33941546de6", }, "MethodSettings": [ { @@ -10251,7 +10251,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -10292,7 +10292,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], }, @@ -10363,14 +10363,110 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` { "Ref": "ApiTestEE73F324", }, - "/*/GET/test", - ], - ], + "/*/GET/test", + ], + ], + }, + }, + "Type": "AWS::Lambda::Permission", + }, + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", + "Arn", + ], + }, + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", + }, + "integrations": { + "testOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test", + }, }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", + }, + "securitySchemes": {}, }, - "Type": "AWS::Lambda::Permission", + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", }, - "ApiTestPrepareSpecA3536D2B": { + "ApiTestPrepareSpecHandler46C6FEB5": { "DependsOn": [ "ApiTestPrepareSpecRole44D562E5", ], @@ -10413,7 +10509,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` }, "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", }, - "FunctionName": "Default-PrepareSpec3E755E54", + "FunctionName": "Default-3E755E54PrepSpec", "Handler": "index.handler", "Role": { "Fn::GetAtt": [ @@ -10476,7 +10572,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` "Resource": [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -10486,7 +10582,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -10586,7 +10682,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", ], ], }, @@ -10602,7 +10698,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", ], ], }, @@ -10617,103 +10713,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` }, "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", - "Arn", - ], - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", - }, - "integrations": { - "testOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "LambdaD247545B", - "Arn", - ], - }, - "/invocations", - ], - ], - }, - }, - }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", - }, - "securitySchemes": {}, - }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", - }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -10765,18 +10765,18 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -10796,7 +10796,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -10814,7 +10814,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -10895,7 +10895,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -10911,7 +10911,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Synth 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, @@ -12236,7 +12236,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -12417,7 +12417,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -12482,9 +12482,9 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC47838831ee40913844aca2242aa92d1dbc5": { + "ApiTestDeployment153EC4782f7f76b22669fc980f9f7456fe1deff4": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -12529,7 +12529,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -12574,7 +12574,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC47838831ee40913844aca2242aa92d1dbc5", + "Ref": "ApiTestDeployment153EC4782f7f76b22669fc980f9f7456fe1deff4", }, "MethodSettings": [ { @@ -12593,7 +12593,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -12634,7 +12634,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], }, @@ -12659,60 +12659,177 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` { "applies_to": [ { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":execute-api:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":", + { + "Ref": "ApiTestEE73F324", + }, + "/*/GET/test", + ], + ], + }, + }, + "Type": "AWS::Lambda::Permission", + }, + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", + "Arn", + ], + }, + "defaultAuthorizerReference": { + "authorizerId": "myCognitoAuthorizer", + }, + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", + }, + "integrations": { + "testOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", + }, + "securitySchemes": { + "myCognitoAuthorizer": { + "in": "header", + "name": "Authorization", + "type": "apiKey", + "x-amazon-apigateway-authorizer": { + "providerARNs": [ + { + "Fn::GetAtt": [ + "pool056F3F7E", + "Arn", + ], }, ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", + "type": "COGNITO_USER_POOLS", }, - ], - }, - }, - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "LambdaD247545B", - "Arn", - ], - }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":execute-api:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":", - { - "Ref": "ApiTestEE73F324", - }, - "/*/GET/test", - ], - ], + "x-amazon-apigateway-authtype": "COGNITO_USER_POOLS", + }, }, }, - "Type": "AWS::Lambda::Permission", + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", }, - "ApiTestPrepareSpecA3536D2B": { + "ApiTestPrepareSpecHandler46C6FEB5": { "DependsOn": [ "ApiTestPrepareSpecRole44D562E5", ], @@ -12755,7 +12872,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` }, "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", }, - "FunctionName": "Default-PrepareSpec3E755E54", + "FunctionName": "Default-3E755E54PrepSpec", "Handler": "index.handler", "Role": { "Fn::GetAtt": [ @@ -12818,7 +12935,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` "Resource": [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -12828,7 +12945,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -12928,7 +13045,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", ], ], }, @@ -12944,7 +13061,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", ], ], }, @@ -12959,124 +13076,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` }, "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", - "Arn", - ], - }, - "defaultAuthorizerReference": { - "authorizerId": "myCognitoAuthorizer", - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", - }, - "integrations": { - "testOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "LambdaD247545B", - "Arn", - ], - }, - "/invocations", - ], - ], - }, - }, - }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", - }, - "securitySchemes": { - "myCognitoAuthorizer": { - "in": "header", - "name": "Authorization", - "type": "apiKey", - "x-amazon-apigateway-authorizer": { - "providerARNs": [ - { - "Fn::GetAtt": [ - "pool056F3F7E", - "Arn", - ], - }, - ], - "type": "COGNITO_USER_POOLS", - }, - "x-amazon-apigateway-authtype": "COGNITO_USER_POOLS", - }, - }, - }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", - }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -13128,18 +13128,18 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -13159,7 +13159,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -13177,7 +13177,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -13258,7 +13258,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -13274,7 +13274,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Cognito Auth 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, @@ -13608,7 +13608,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -13789,7 +13789,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -13854,9 +13854,9 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC4789abd2506c995fb1e3f8048cbc34a252c": { + "ApiTestDeployment153EC47803e8a90fd243402c01d0e16cbd6e0535": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -13901,7 +13901,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -13946,7 +13946,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC4789abd2506c995fb1e3f8048cbc34a252c", + "Ref": "ApiTestDeployment153EC47803e8a90fd243402c01d0e16cbd6e0535", }, "MethodSettings": [ { @@ -13965,7 +13965,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -14006,7 +14006,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], }, @@ -14015,7 +14015,76 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` }, "Type": "AWS::ApiGateway::RestApi", }, - "ApiTestLambdaPermissionmyCustomAuthorizer2D3D850D": { + "ApiTestLambdaPermissionmyCustomAuthorizer2D3D850D": { + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "AuthorizerBD825682", + "Arn", + ], + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":execute-api:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":", + { + "Ref": "ApiTestEE73F324", + }, + "/*/*", + ], + ], + }, + }, + "Type": "AWS::Lambda::Permission", + }, + "ApiTestLambdaPermissiontestOperationECAC1A2D": { "Metadata": { "cdk_nag": { "rules_to_suppress": [ @@ -14052,7 +14121,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` "Action": "lambda:InvokeFunction", "FunctionName": { "Fn::GetAtt": [ - "AuthorizerBD825682", + "LambdaD247545B", "Arn", ], }, @@ -14077,14 +14146,15 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` { "Ref": "ApiTestEE73F324", }, - "/*/*", + "/*/GET/test", ], ], }, }, "Type": "AWS::Lambda::Permission", }, - "ApiTestLambdaPermissiontestOperationECAC1A2D": { + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", "Metadata": { "cdk_nag": { "rules_to_suppress": [ @@ -14118,42 +14188,106 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` }, }, "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { + "ServiceToken": { "Fn::GetAtt": [ - "LambdaD247545B", + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", "Arn", ], }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":execute-api:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", + "defaultAuthorizerReference": { + "authorizerId": "myCustomAuthorizer", + }, + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", + }, + "integrations": { + "testOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "/invocations", + ], + ], }, - ":", - { - "Ref": "ApiTestEE73F324", + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", + }, + "securitySchemes": { + "myCustomAuthorizer": { + "in": "header", + "name": "Authorization", + "type": "apiKey", + "x-amazon-apigateway-authorizer": { + "authorizerResultTtlInSeconds": 300, + "authorizerUri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "AuthorizerBD825682", + "Arn", + ], + }, + "/invocations", + ], + ], }, - "/*/GET/test", - ], - ], + "identitySource": "method.request.header.Authorization", + "type": "token", + }, + "x-amazon-apigateway-authtype": "CUSTOM", + }, }, }, - "Type": "AWS::Lambda::Permission", + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", }, - "ApiTestPrepareSpecA3536D2B": { + "ApiTestPrepareSpecHandler46C6FEB5": { "DependsOn": [ "ApiTestPrepareSpecRole44D562E5", ], @@ -14196,7 +14330,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` }, "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", }, - "FunctionName": "Default-PrepareSpec3E755E54", + "FunctionName": "Default-3E755E54PrepSpec", "Handler": "index.handler", "Role": { "Fn::GetAtt": [ @@ -14259,7 +14393,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` "Resource": [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -14269,7 +14403,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -14369,7 +14503,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", ], ], }, @@ -14385,7 +14519,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", ], ], }, @@ -14396,145 +14530,11 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` }, "PolicyName": "logs", }, - ], - }, - "Type": "AWS::IAM::Role", - }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", - "Arn", - ], - }, - "defaultAuthorizerReference": { - "authorizerId": "myCustomAuthorizer", - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", - }, - "integrations": { - "testOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "LambdaD247545B", - "Arn", - ], - }, - "/invocations", - ], - ], - }, - }, - }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", - }, - "securitySchemes": { - "myCustomAuthorizer": { - "in": "header", - "name": "Authorization", - "type": "apiKey", - "x-amazon-apigateway-authorizer": { - "authorizerResultTtlInSeconds": 300, - "authorizerUri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "AuthorizerBD825682", - "Arn", - ], - }, - "/invocations", - ], - ], - }, - "identitySource": "method.request.header.Authorization", - "type": "token", - }, - "x-amazon-apigateway-authtype": "CUSTOM", - }, - }, + ], }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", + "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -14586,18 +14586,18 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -14617,7 +14617,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -14635,7 +14635,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -14716,7 +14716,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -14732,7 +14732,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Auth 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, @@ -15085,7 +15085,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -15284,7 +15284,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -15349,9 +15349,9 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC478950afb915db24dc651450ed2227b1233": { + "ApiTestDeployment153EC478ba688c73ecd411d6bc46f33941546de6": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -15396,7 +15396,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -15441,7 +15441,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC478950afb915db24dc651450ed2227b1233", + "Ref": "ApiTestDeployment153EC478ba688c73ecd411d6bc46f33941546de6", }, "MethodSettings": [ { @@ -15460,7 +15460,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -15501,7 +15501,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], }, @@ -15579,7 +15579,103 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = }, "Type": "AWS::Lambda::Permission", }, - "ApiTestPrepareSpecA3536D2B": { + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", + "Arn", + ], + }, + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", + }, + "integrations": { + "testOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", + }, + "securitySchemes": {}, + }, + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", + }, + "ApiTestPrepareSpecHandler46C6FEB5": { "DependsOn": [ "ApiTestPrepareSpecRole44D562E5", ], @@ -15622,7 +15718,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = }, "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", }, - "FunctionName": "Default-PrepareSpec3E755E54", + "FunctionName": "Default-3E755E54PrepSpec", "Handler": "index.handler", "Role": { "Fn::GetAtt": [ @@ -15685,7 +15781,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = "Resource": [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -15695,7 +15791,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -15795,7 +15891,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", ], ], }, @@ -15811,7 +15907,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", ], ], }, @@ -15826,103 +15922,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = }, "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", - "Arn", - ], - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", - }, - "integrations": { - "testOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "LambdaD247545B", - "Arn", - ], - }, - "/invocations", - ], - ], - }, - }, - }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", - }, - "securitySchemes": {}, - }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", - }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -15974,18 +15974,18 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -16005,7 +16005,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -16023,7 +16023,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -16104,7 +16104,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -16120,7 +16120,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Custom Managed Rules 1`] = { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, @@ -16346,7 +16346,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -16527,7 +16527,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -16592,9 +16592,9 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC478d03cfc098ec71622fc8a95b5e8d6d66b": { + "ApiTestDeployment153EC478a540cf96c2f3638f1db06413ff4bc26e": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -16639,7 +16639,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -16684,7 +16684,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC478d03cfc098ec71622fc8a95b5e8d6d66b", + "Ref": "ApiTestDeployment153EC478a540cf96c2f3638f1db06413ff4bc26e", }, "MethodSettings": [ { @@ -16703,7 +16703,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -16744,16 +16744,86 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], - }, + }, + }, + "Name": "ApiTest", + }, + "Type": "AWS::ApiGateway::RestApi", + }, + "ApiTestLambdaPermissiontestOperationECAC1A2D": { + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "Principal": "apigateway.amazonaws.com", + "SourceArn": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":execute-api:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":", + { + "Ref": "ApiTestEE73F324", + }, + "/*/GET/test", + ], + ], }, - "Name": "ApiTest", }, - "Type": "AWS::ApiGateway::RestApi", + "Type": "AWS::Lambda::Permission", }, - "ApiTestLambdaPermissiontestOperationECAC1A2D": { + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", "Metadata": { "cdk_nag": { "rules_to_suppress": [ @@ -16787,42 +16857,102 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` }, }, "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { + "ServiceToken": { "Fn::GetAtt": [ - "LambdaD247545B", + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", "Arn", ], }, - "Principal": "apigateway.amazonaws.com", - "SourceArn": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":execute-api:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":", - { - "Ref": "ApiTestEE73F324", - }, - "/*/GET/test", - ], + "corsOptions": { + "allowHeaders": [ + "Content-Type", + "X-Amz-Date", + "Authorization", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent", + "x-amz-content-sha256", + ], + "allowMethods": [ + "OPTIONS", + "GET", + "PUT", + "POST", + "DELETE", + "PATCH", + "HEAD", + ], + "allowOrigins": [ + "*", ], + "statusCode": 200, + }, + "defaultAuthorizerReference": { + "authorizerId": "aws.auth.sigv4", + }, + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", + }, + "integrations": { + "testOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", + }, + "securitySchemes": { + "aws.auth.sigv4": { + "in": "header", + "name": "Authorization", + "type": "apiKey", + "x-amazon-apigateway-authtype": "awsSigv4", + }, }, }, - "Type": "AWS::Lambda::Permission", + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", }, - "ApiTestPrepareSpecA3536D2B": { + "ApiTestPrepareSpecHandler46C6FEB5": { "DependsOn": [ "ApiTestPrepareSpecRole44D562E5", ], @@ -16865,7 +16995,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` }, "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", }, - "FunctionName": "Default-PrepareSpec3E755E54", + "FunctionName": "Default-3E755E54PrepSpec", "Handler": "index.handler", "Role": { "Fn::GetAtt": [ @@ -16928,7 +17058,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` "Resource": [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -16938,7 +17068,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -17038,7 +17168,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", ], ], }, @@ -17054,152 +17184,22 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", ], ], }, ], }, ], - "Version": "2012-10-17", - }, - "PolicyName": "logs", - }, - ], - }, - "Type": "AWS::IAM::Role", - }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", - "Arn", - ], - }, - "corsOptions": { - "allowHeaders": [ - "Content-Type", - "X-Amz-Date", - "Authorization", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent", - "x-amz-content-sha256", - ], - "allowMethods": [ - "OPTIONS", - "GET", - "PUT", - "POST", - "DELETE", - "PATCH", - "HEAD", - ], - "allowOrigins": [ - "*", - ], - "statusCode": 200, - }, - "defaultAuthorizerReference": { - "authorizerId": "aws.auth.sigv4", - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", - }, - "integrations": { - "testOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "LambdaD247545B", - "Arn", - ], - }, - "/invocations", - ], - ], - }, - }, - }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", - }, - "securitySchemes": { - "aws.auth.sigv4": { - "in": "header", - "name": "Authorization", - "type": "apiKey", - "x-amazon-apigateway-authtype": "awsSigv4", + "Version": "2012-10-17", + }, + "PolicyName": "logs", }, - }, + ], }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", + "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -17251,18 +17251,18 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -17282,7 +17282,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -17300,7 +17300,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -17381,7 +17381,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -17397,7 +17397,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With IAM Auth and CORS 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, @@ -17765,7 +17765,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -17946,7 +17946,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -18011,9 +18011,9 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC4785add1d36cd869d400a7b7fed7f178c12": { + "ApiTestDeployment153EC47818452aad75ab6cbc8f46ee5fe2293a71": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -18058,7 +18058,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -18103,7 +18103,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC4785add1d36cd869d400a7b7fed7f178c12", + "Ref": "ApiTestDeployment153EC47818452aad75ab6cbc8f46ee5fe2293a71", }, "MethodSettings": [ { @@ -18122,7 +18122,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -18163,7 +18163,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], }, @@ -18507,264 +18507,17 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` "Ref": "AWS::AccountId", }, ":", - { - "Ref": "ApiTestEE73F324", - }, - "/*/PUT/test", - ], - ], - }, - }, - "Type": "AWS::Lambda::Permission", - }, - "ApiTestPrepareSpecA3536D2B": { - "DependsOn": [ - "ApiTestPrepareSpecRole44D562E5", - ], - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", - }, - "FunctionName": "Default-PrepareSpec3E755E54", - "Handler": "index.handler", - "Role": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecRole44D562E5", - "Arn", - ], - }, - "Runtime": "nodejs18.x", - "Timeout": 30, - }, - "Type": "AWS::Lambda::Function", - }, - "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78": { - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "id": "AwsSolutions-IAM5", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", - }, - { - "id": "AwsPrototyping-IAMNoWildcardPermissions", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "lambda:InvokeFunction", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", - "Arn", - ], - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", - "Arn", - ], - }, - ":*", - ], - ], - }, - ], - }, - ], - "Version": "2012-10-17", - }, - "PolicyName": "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", - "Roles": [ - { - "Ref": "ApiTestPrepareSpecProviderRoleF47822B8", - }, - ], - }, - "Type": "AWS::IAM::Policy", - }, - "ApiTestPrepareSpecProviderRoleF47822B8": { - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "id": "AwsSolutions-IAM5", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", - }, - { - "id": "AwsPrototyping-IAMNoWildcardPermissions", - "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com", - }, - }, - ], - "Version": "2012-10-17", - }, - "Policies": [ - { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents", - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:aws:logs:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", - ], - ], - }, - { - "Fn::Join": [ - "", - [ - "arn:aws:logs:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", - ], - ], - }, - ], - }, - ], - "Version": "2012-10-17", - }, - "PolicyName": "logs", - }, - ], + { + "Ref": "ApiTestEE73F324", + }, + "/*/PUT/test", + ], + ], + }, }, - "Type": "AWS::IAM::Role", + "Type": "AWS::Lambda::Permission", }, - "ApiTestPrepareSpecResource58706514": { + "ApiTestPrepareSpecCustomResourceC9800EE6": { "DeletionPolicy": "Delete", "Metadata": { "cdk_nag": { @@ -18801,7 +18554,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` "Properties": { "ServiceToken": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", "Arn", ], }, @@ -18975,70 +18728,317 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` }, "key": "59c8d7b10656c48be66a3a7cb22540b5dc6f56cfa67229affa21977c6567f30e.json-prepared", }, - "securitySchemes": { - "aws.auth.sigv4": { - "in": "header", - "name": "Authorization", - "type": "apiKey", - "x-amazon-apigateway-authtype": "awsSigv4", - }, - "myCognitoAuthorizer": { - "in": "header", - "name": "Authorization", - "type": "apiKey", - "x-amazon-apigateway-authorizer": { - "providerARNs": [ + "securitySchemes": { + "aws.auth.sigv4": { + "in": "header", + "name": "Authorization", + "type": "apiKey", + "x-amazon-apigateway-authtype": "awsSigv4", + }, + "myCognitoAuthorizer": { + "in": "header", + "name": "Authorization", + "type": "apiKey", + "x-amazon-apigateway-authorizer": { + "providerARNs": [ + { + "Fn::GetAtt": [ + "pool056F3F7E", + "Arn", + ], + }, + ], + "type": "COGNITO_USER_POOLS", + }, + "x-amazon-apigateway-authtype": "COGNITO_USER_POOLS", + }, + "myCustomAuthorizer": { + "in": "header", + "name": "Unused", + "type": "apiKey", + "x-amazon-apigateway-authorizer": { + "authorizerResultTtlInSeconds": 60, + "authorizerUri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "LambdaAuthorizerB5870E9B", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + "identitySource": "method.request.querystring.QueryString1", + "type": "request", + }, + "x-amazon-apigateway-authtype": "CUSTOM", + }, + }, + }, + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", + }, + "ApiTestPrepareSpecHandler46C6FEB5": { + "DependsOn": [ + "ApiTestPrepareSpecRole44D562E5", + ], + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", + }, + "FunctionName": "Default-3E755E54PrepSpec", + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "ApiTestPrepareSpecRole44D562E5", + "Arn", + ], + }, + "Runtime": "nodejs18.x", + "Timeout": 30, + }, + "Type": "AWS::Lambda::Function", + }, + "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78": { + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "id": "AwsSolutions-IAM5", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + }, + { + "id": "AwsPrototyping-IAMNoWildcardPermissions", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "ApiTestPrepareSpecHandler46C6FEB5", + "Arn", + ], + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "ApiTestPrepareSpecHandler46C6FEB5", + "Arn", + ], + }, + ":*", + ], + ], + }, + ], + }, + ], + "Version": "2012-10-17", + }, + "PolicyName": "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", + "Roles": [ + { + "Ref": "ApiTestPrepareSpecProviderRoleF47822B8", + }, + ], + }, + "Type": "AWS::IAM::Policy", + }, + "ApiTestPrepareSpecProviderRoleF47822B8": { + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "id": "AwsSolutions-IAM5", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + }, + { + "id": "AwsPrototyping-IAMNoWildcardPermissions", + "reason": "Cloudwatch resources have been scoped down to the LogGroup level, however * is still needed as stream names are created just in time.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com", + }, + }, + ], + "Version": "2012-10-17", + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ { - "Fn::GetAtt": [ - "pool056F3F7E", - "Arn", + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents", ], - }, - ], - "type": "COGNITO_USER_POOLS", - }, - "x-amazon-apigateway-authtype": "COGNITO_USER_POOLS", - }, - "myCustomAuthorizer": { - "in": "header", - "name": "Unused", - "type": "apiKey", - "x-amazon-apigateway-authorizer": { - "authorizerResultTtlInSeconds": 60, - "authorizerUri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", + "Effect": "Allow", + "Resource": [ { - "Ref": "AWS::Region", + "Fn::Join": [ + "", + [ + "arn:aws:logs:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", + ], + ], }, - ":lambda:path/2015-03-31/functions/", { - "Fn::GetAtt": [ - "LambdaAuthorizerB5870E9B", - "Arn", + "Fn::Join": [ + "", + [ + "arn:aws:logs:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", + ], ], }, - "/invocations", ], - ], - }, - "identitySource": "method.request.querystring.QueryString1", - "type": "request", + }, + ], + "Version": "2012-10-17", }, - "x-amazon-apigateway-authtype": "CUSTOM", + "PolicyName": "logs", }, - }, + ], }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", + "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -19090,18 +19090,18 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -19121,7 +19121,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -19139,7 +19139,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -19220,7 +19220,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -19236,7 +19236,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mixed Auth 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, @@ -19888,7 +19888,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -20069,7 +20069,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -20134,9 +20134,9 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC478ceb82d8af49203a3c6f0cbcb8e11f21c": { + "ApiTestDeployment153EC478a28890a7ac67f65a56f78d242bf067d5": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -20181,7 +20181,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -20226,7 +20226,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC478ceb82d8af49203a3c6f0cbcb8e11f21c", + "Ref": "ApiTestDeployment153EC478a28890a7ac67f65a56f78d242bf067d5", }, "MethodSettings": [ { @@ -20245,7 +20245,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -20286,7 +20286,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], }, @@ -20295,7 +20295,90 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` }, "Type": "AWS::ApiGateway::RestApi", }, - "ApiTestPrepareSpecA3536D2B": { + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", + "Arn", + ], + }, + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", + }, + "integrations": { + "testOperation": { + "integration": { + "requestTemplates": { + "application/json": "{"statusCode": 200}", + }, + "responses": { + "default": { + "responseParameters": {}, + "responseTemplates": { + "application/json": "{"message":"message"}", + }, + "statusCode": "200", + }, + }, + "type": "MOCK", + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", + }, + "securitySchemes": {}, + }, + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", + }, + "ApiTestPrepareSpecHandler46C6FEB5": { "DependsOn": [ "ApiTestPrepareSpecRole44D562E5", ], @@ -20338,7 +20421,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` }, "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", }, - "FunctionName": "Default-PrepareSpec3E755E54", + "FunctionName": "Default-3E755E54PrepSpec", "Handler": "index.handler", "Role": { "Fn::GetAtt": [ @@ -20401,7 +20484,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` "Resource": [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -20411,7 +20494,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -20511,7 +20594,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", ], ], }, @@ -20527,7 +20610,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", ], ], }, @@ -20536,96 +20619,13 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` ], "Version": "2012-10-17", }, - "PolicyName": "logs", - }, - ], - }, - "Type": "AWS::IAM::Role", - }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", - "Arn", - ], - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", - }, - "integrations": { - "testOperation": { - "integration": { - "requestTemplates": { - "application/json": "{"statusCode": 200}", - }, - "responses": { - "default": { - "responseParameters": {}, - "responseTemplates": { - "application/json": "{"message":"message"}", - }, - "statusCode": "200", - }, - }, - "type": "MOCK", - }, - }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + "PolicyName": "logs", }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", - }, - "securitySchemes": {}, + ], }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", + "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -20677,18 +20677,18 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -20708,7 +20708,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -20726,7 +20726,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -20807,7 +20807,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -20823,7 +20823,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, @@ -21067,7 +21067,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -21248,7 +21248,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -21313,9 +21313,9 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC47872a7f3a0ed9dc65fe43142c523ae46d2": { + "ApiTestDeployment153EC4783e3e5eeaa8a8e6d23441a25ca55384d3": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -21360,7 +21360,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -21405,7 +21405,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC47872a7f3a0ed9dc65fe43142c523ae46d2", + "Ref": "ApiTestDeployment153EC4783e3e5eeaa8a8e6d23441a25ca55384d3", }, "MethodSettings": [ { @@ -21424,7 +21424,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -21465,7 +21465,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], }, @@ -21474,7 +21474,118 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS }, "Type": "AWS::ApiGateway::RestApi", }, - "ApiTestPrepareSpecA3536D2B": { + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", + "Arn", + ], + }, + "corsOptions": { + "allowHeaders": [ + "Content-Type", + "X-Amz-Date", + "Authorization", + "X-Api-Key", + "X-Amz-Security-Token", + "X-Amz-User-Agent", + "x-amz-content-sha256", + ], + "allowMethods": [ + "OPTIONS", + "GET", + "PUT", + "POST", + "DELETE", + "PATCH", + "HEAD", + ], + "allowOrigins": [ + "*", + ], + "statusCode": 204, + }, + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", + }, + "integrations": { + "testOperation": { + "integration": { + "requestTemplates": { + "application/json": "{"statusCode": 200}", + }, + "responses": { + "default": { + "responseParameters": { + "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent,x-amz-content-sha256'", + "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET,PUT,POST,DELETE,PATCH,HEAD'", + "method.response.header.Access-Control-Allow-Origin": "'*'", + }, + "responseTemplates": { + "application/json": "{"message":"message"}", + }, + "statusCode": "200", + }, + }, + "type": "MOCK", + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", + }, + "securitySchemes": {}, + }, + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", + }, + "ApiTestPrepareSpecHandler46C6FEB5": { "DependsOn": [ "ApiTestPrepareSpecRole44D562E5", ], @@ -21517,7 +21628,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS }, "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", }, - "FunctionName": "Default-PrepareSpec3E755E54", + "FunctionName": "Default-3E755E54PrepSpec", "Handler": "index.handler", "Role": { "Fn::GetAtt": [ @@ -21580,7 +21691,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS "Resource": [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -21590,7 +21701,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -21666,173 +21777,62 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS ], "Version": "2012-10-17", }, - "Policies": [ - { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents", - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:aws:logs:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", - ], - ], - }, - { - "Fn::Join": [ - "", - [ - "arn:aws:logs:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", - ], - ], - }, - ], - }, - ], - "Version": "2012-10-17", - }, - "PolicyName": "logs", - }, - ], - }, - "Type": "AWS::IAM::Role", - }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", - "Arn", - ], - }, - "corsOptions": { - "allowHeaders": [ - "Content-Type", - "X-Amz-Date", - "Authorization", - "X-Api-Key", - "X-Amz-Security-Token", - "X-Amz-User-Agent", - "x-amz-content-sha256", - ], - "allowMethods": [ - "OPTIONS", - "GET", - "PUT", - "POST", - "DELETE", - "PATCH", - "HEAD", - ], - "allowOrigins": [ - "*", - ], - "statusCode": 204, - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", - }, - "integrations": { - "testOperation": { - "integration": { - "requestTemplates": { - "application/json": "{"statusCode": 200}", - }, - "responses": { - "default": { - "responseParameters": { - "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent,x-amz-content-sha256'", - "method.response.header.Access-Control-Allow-Methods": "'OPTIONS,GET,PUT,POST,DELETE,PATCH,HEAD'", - "method.response.header.Access-Control-Allow-Origin": "'*'", - }, - "responseTemplates": { - "application/json": "{"message":"message"}", - }, - "statusCode": "200", + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents", + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:aws:logs:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", + ], + ], + }, + { + "Fn::Join": [ + "", + [ + "arn:aws:logs:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", + ], + ], + }, + ], }, - }, - "type": "MOCK", + ], + "Version": "2012-10-17", }, + "PolicyName": "logs", }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", - }, - "securitySchemes": {}, + ], }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", + "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -21884,18 +21884,18 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -21915,7 +21915,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -21933,7 +21933,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -22014,7 +22014,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -22030,7 +22030,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Mock Integration and CORS { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, @@ -22349,7 +22349,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -22530,7 +22530,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -22595,9 +22595,9 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC47813942105e6971276a23d1a170029add6": { + "ApiTestDeployment153EC478ed5e71f4a5bc4f71e07a9dafbe8ea425": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -22642,7 +22642,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -22687,7 +22687,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC47813942105e6971276a23d1a170029add6", + "Ref": "ApiTestDeployment153EC478ed5e71f4a5bc4f71e07a9dafbe8ea425", }, "MethodSettings": [ { @@ -22706,7 +22706,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -22747,7 +22747,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], }, @@ -22825,7 +22825,103 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` }, "Type": "AWS::Lambda::Permission", }, - "ApiTestPrepareSpecA3536D2B": { + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", + "Arn", + ], + }, + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "6060611f34e7c9e9000a19922d48dfd8d47d66cbf3715fb30e173c4b51d9061b.json", + }, + "integrations": { + "testOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test/{param1}/fixed/{param2}/{param3}", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "6060611f34e7c9e9000a19922d48dfd8d47d66cbf3715fb30e173c4b51d9061b.json-prepared", + }, + "securitySchemes": {}, + }, + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", + }, + "ApiTestPrepareSpecHandler46C6FEB5": { "DependsOn": [ "ApiTestPrepareSpecRole44D562E5", ], @@ -22868,7 +22964,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` }, "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", }, - "FunctionName": "Default-PrepareSpec3E755E54", + "FunctionName": "Default-3E755E54PrepSpec", "Handler": "index.handler", "Role": { "Fn::GetAtt": [ @@ -22931,7 +23027,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` "Resource": [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -22941,7 +23037,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -23036,139 +23132,43 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` "arn:aws:logs:", { "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", - ], - ], - }, - { - "Fn::Join": [ - "", - [ - "arn:aws:logs:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", - ], - ], - }, - ], - }, - ], - "Version": "2012-10-17", - }, - "PolicyName": "logs", - }, - ], - }, - "Type": "AWS::IAM::Role", - }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", - "Arn", - ], - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "6060611f34e7c9e9000a19922d48dfd8d47d66cbf3715fb30e173c4b51d9061b.json", - }, - "integrations": { - "testOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", + ], + ], }, - ":lambda:path/2015-03-31/functions/", { - "Fn::GetAtt": [ - "LambdaD247545B", - "Arn", + "Fn::Join": [ + "", + [ + "arn:aws:logs:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", + ], ], }, - "/invocations", ], - ], - }, + }, + ], + "Version": "2012-10-17", }, + "PolicyName": "logs", }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test/{param1}/fixed/{param2}/{param3}", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "6060611f34e7c9e9000a19922d48dfd8d47d66cbf3715fb30e173c4b51d9061b.json-prepared", - }, - "securitySchemes": {}, + ], }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", + "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -23220,18 +23220,18 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -23251,7 +23251,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -23269,7 +23269,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -23350,7 +23350,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -23366,7 +23366,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Path Parameters 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, @@ -23651,7 +23651,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -23901,7 +23901,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -23966,9 +23966,9 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC478950afb915db24dc651450ed2227b1233": { + "ApiTestDeployment153EC478ba688c73ecd411d6bc46f33941546de6": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -24013,7 +24013,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -24058,7 +24058,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC478950afb915db24dc651450ed2227b1233", + "Ref": "ApiTestDeployment153EC478ba688c73ecd411d6bc46f33941546de6", }, "MethodSettings": [ { @@ -24077,7 +24077,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -24118,7 +24118,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], }, @@ -24196,7 +24196,103 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` }, "Type": "AWS::Lambda::Permission", }, - "ApiTestPrepareSpecA3536D2B": { + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", + "Arn", + ], + }, + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", + }, + "integrations": { + "testOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", + }, + "securitySchemes": {}, + }, + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", + }, + "ApiTestPrepareSpecHandler46C6FEB5": { "DependsOn": [ "ApiTestPrepareSpecRole44D562E5", ], @@ -24239,7 +24335,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` }, "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", }, - "FunctionName": "Default-PrepareSpec3E755E54", + "FunctionName": "Default-3E755E54PrepSpec", "Handler": "index.handler", "Role": { "Fn::GetAtt": [ @@ -24302,7 +24398,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` "Resource": [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -24312,7 +24408,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -24387,159 +24483,63 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` }, ], "Version": "2012-10-17", - }, - "Policies": [ - { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents", - ], - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:aws:logs:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", - ], - ], - }, - { - "Fn::Join": [ - "", - [ - "arn:aws:logs:", - { - "Ref": "AWS::Region", - }, - ":", - { - "Ref": "AWS::AccountId", - }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", - ], - ], - }, - ], - }, - ], - "Version": "2012-10-17", - }, - "PolicyName": "logs", - }, - ], - }, - "Type": "AWS::IAM::Role", - }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", - "Arn", - ], - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", - }, - "integrations": { - "testOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", + }, + "Policies": [ + { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents", + ], + "Effect": "Allow", + "Resource": [ { - "Ref": "AWS::Region", + "Fn::Join": [ + "", + [ + "arn:aws:logs:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", + ], + ], }, - ":lambda:path/2015-03-31/functions/", { - "Fn::GetAtt": [ - "LambdaD247545B", - "Arn", + "Fn::Join": [ + "", + [ + "arn:aws:logs:", + { + "Ref": "AWS::Region", + }, + ":", + { + "Ref": "AWS::AccountId", + }, + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", + ], ], }, - "/invocations", ], - ], - }, + }, + ], + "Version": "2012-10-17", }, + "PolicyName": "logs", }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", - }, - "securitySchemes": {}, + ], }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", + "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -24591,18 +24591,18 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -24622,7 +24622,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -24640,7 +24640,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -24721,7 +24721,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -24737,7 +24737,7 @@ exports[`Type Safe Rest Api Construct Unit Tests With Waf IP Set 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, @@ -24963,7 +24963,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` "DeletionPolicy": "Retain", "DependsOn": [ "ApiTestEE73F324", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -25011,7 +25011,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` "ApiTestCloudWatchRole56ED0814": { "DeletionPolicy": "Retain", "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -25076,9 +25076,9 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` "Type": "AWS::IAM::Role", "UpdateReplacePolicy": "Retain", }, - "ApiTestDeployment153EC478950afb915db24dc651450ed2227b1233": { + "ApiTestDeployment153EC478ba688c73ecd411d6bc46f33941546de6": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -25123,7 +25123,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` "ApiTestDeploymentStageprod660267A6": { "DependsOn": [ "ApiTestAccount272B5CDD", - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -25168,7 +25168,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` "Format": "$context.identity.sourceIp $context.identity.caller $context.identity.user [$context.requestTime] "$context.httpMethod $context.resourcePath $context.protocol" $context.status $context.responseLength $context.requestId", }, "DeploymentId": { - "Ref": "ApiTestDeployment153EC478950afb915db24dc651450ed2227b1233", + "Ref": "ApiTestDeployment153EC478ba688c73ecd411d6bc46f33941546de6", }, "MethodSettings": [ { @@ -25187,7 +25187,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` }, "ApiTestEE73F324": { "DependsOn": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", ], "Metadata": { "cdk_nag": { @@ -25228,7 +25228,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` }, "Key": { "Fn::GetAtt": [ - "ApiTestPrepareSpecResource58706514", + "ApiTestPrepareSpecCustomResourceC9800EE6", "outputSpecKey", ], }, @@ -25306,7 +25306,103 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` }, "Type": "AWS::Lambda::Permission", }, - "ApiTestPrepareSpecA3536D2B": { + "ApiTestPrepareSpecCustomResourceC9800EE6": { + "DeletionPolicy": "Delete", + "Metadata": { + "cdk_nag": { + "rules_to_suppress": [ + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsSolutions-IAM4", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "applies_to": [ + { + "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", + }, + ], + "id": "AwsPrototyping-IAMNoManagedPolicies", + "reason": "Cloudwatch Role requires access to create/read groups at the root level.", + }, + { + "id": "AwsSolutions-APIG2", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + { + "id": "AwsPrototyping-APIGWRequestValidation", + "reason": "This construct implements fine grained validation via OpenApi.", + }, + ], + }, + }, + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188", + "Arn", + ], + }, + "inputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", + }, + "integrations": { + "testOperation": { + "integration": { + "httpMethod": "POST", + "passthroughBehavior": "WHEN_NO_MATCH", + "type": "AWS_PROXY", + "uri": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition", + }, + ":apigateway:", + { + "Ref": "AWS::Region", + }, + ":lambda:path/2015-03-31/functions/", + { + "Fn::GetAtt": [ + "LambdaD247545B", + "Arn", + ], + }, + "/invocations", + ], + ], + }, + }, + }, + }, + "operationLookup": { + "testOperation": { + "method": "get", + "path": "/test", + }, + }, + "outputSpecLocation": { + "bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", + }, + "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", + }, + "securitySchemes": {}, + }, + "Type": "AWS::CloudFormation::CustomResource", + "UpdateReplacePolicy": "Delete", + }, + "ApiTestPrepareSpecHandler46C6FEB5": { "DependsOn": [ "ApiTestPrepareSpecRole44D562E5", ], @@ -25349,7 +25445,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` }, "S3Key": "7f5f734c4b1912c2e0519cc77c4a123953110c510f49ff2b58500ae796674fbf.zip", }, - "FunctionName": "Default-PrepareSpec3E755E54", + "FunctionName": "Default-3E755E54PrepSpec", "Handler": "index.handler", "Role": { "Fn::GetAtt": [ @@ -25412,7 +25508,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` "Resource": [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -25422,7 +25518,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` [ { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, @@ -25522,7 +25618,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider", ], ], }, @@ -25538,7 +25634,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54-Provider:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpecProvider:*", ], ], }, @@ -25553,103 +25649,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` }, "Type": "AWS::IAM::Role", }, - "ApiTestPrepareSpecResource58706514": { - "DeletionPolicy": "Delete", - "Metadata": { - "cdk_nag": { - "rules_to_suppress": [ - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsSolutions-IAM4", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "applies_to": [ - { - "regex": "/^Policy::arn::iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs$/g", - }, - ], - "id": "AwsPrototyping-IAMNoManagedPolicies", - "reason": "Cloudwatch Role requires access to create/read groups at the root level.", - }, - { - "id": "AwsSolutions-APIG2", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - { - "id": "AwsPrototyping-APIGWRequestValidation", - "reason": "This construct implements fine grained validation via OpenApi.", - }, - ], - }, - }, - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300", - "Arn", - ], - }, - "inputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json", - }, - "integrations": { - "testOperation": { - "integration": { - "httpMethod": "POST", - "passthroughBehavior": "WHEN_NO_MATCH", - "type": "AWS_PROXY", - "uri": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition", - }, - ":apigateway:", - { - "Ref": "AWS::Region", - }, - ":lambda:path/2015-03-31/functions/", - { - "Fn::GetAtt": [ - "LambdaD247545B", - "Arn", - ], - }, - "/invocations", - ], - ], - }, - }, - }, - }, - "operationLookup": { - "testOperation": { - "method": "get", - "path": "/test", - }, - }, - "outputSpecLocation": { - "bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}", - }, - "key": "ec22714a0fde30e0834df19bc639f3cb3519abd3ccd6dcf6b761d105827ca227.json-prepared", - }, - "securitySchemes": {}, - }, - "Type": "AWS::CloudFormation::CustomResource", - "UpdateReplacePolicy": "Delete", - }, - "ApiTestPrepareSpecResourceProviderframeworkonEventDB3DA300": { + "ApiTestPrepareSpecProviderframeworkonEvent2FA9E188": { "DependsOn": [ "ApiTestPrepareSpecProviderRoleDefaultPolicy99662E78", "ApiTestPrepareSpecProviderRoleF47822B8", @@ -25701,18 +25701,18 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` }, "S3Key": "f2d30cfc360482320a52a4fcde8a70f3569df79ab30be24650fda58eb60052cf.zip", }, - "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecResourceProvider)", + "Description": "AWS CDK resource provider framework - onEvent (Default/ApiTest/PrepareSpecProvider)", "Environment": { "Variables": { "USER_ON_EVENT_FUNCTION_ARN": { "Fn::GetAtt": [ - "ApiTestPrepareSpecA3536D2B", + "ApiTestPrepareSpecHandler46C6FEB5", "Arn", ], }, }, }, - "FunctionName": "Default-PrepareSpec3E755E54-Provider", + "FunctionName": "Default-3E755E54PrepSpecProvider", "Handler": "framework.onEvent", "Role": { "Fn::GetAtt": [ @@ -25732,7 +25732,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsSolutions-IAM5", @@ -25750,7 +25750,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` { "applies_to": [ { - "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-PrepareSpec3E755E54:*/g", + "regex": "/^Resource::arn:aws:logs:::log-group:/aws/lambda/Default-3E755E54PrepSpec:*/g", }, ], "id": "AwsPrototyping-IAMNoWildcardPermissions", @@ -25831,7 +25831,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec", ], ], }, @@ -25847,7 +25847,7 @@ exports[`Type Safe Rest Api Construct Unit Tests Without Waf 1`] = ` { "Ref": "AWS::AccountId", }, - ":log-group:/aws/lambda/Default-PrepareSpec3E755E54:*", + ":log-group:/aws/lambda/Default-3E755E54PrepSpec:*", ], ], }, diff --git a/packages/type-safe-api/test/construct/type-safe-rest-api.test.ts b/packages/type-safe-api/test/construct/type-safe-rest-api.test.ts index eb507b1e5..8eaa97abf 100644 --- a/packages/type-safe-api/test/construct/type-safe-rest-api.test.ts +++ b/packages/type-safe-api/test/construct/type-safe-rest-api.test.ts @@ -1262,4 +1262,39 @@ describe("Type Safe Rest Api Construct Unit Tests", () => { snapshotExtendedSpec(api); }); }); + + it("Should not create any lambdas with names longer than 64 characters", () => { + const stack = new Stack(undefined, "Id", { + stackName: [...new Array(100).keys()] + .map(() => `Long`) + .join("") + .slice(0, 128), + }); + + const func = new Function(stack, "Lambda", { + code: Code.fromInline("code"), + handler: "handler", + runtime: Runtime.NODEJS_16_X, + }); + withTempSpec(sampleSpec, (specPath) => { + new TypeSafeRestApi(stack, "ApiTest", { + specPath, + operationLookup, + integrations: { + testOperation: { + integration: Integrations.lambda(func), + }, + }, + }); + }); + + const functionNames = Object.values( + Template.fromStack(stack).findResources("AWS::Lambda::Function") + ) + .map((r) => r.Properties.FunctionName) + .filter((x) => x); + functionNames.forEach((functionName) => { + expect(functionName.length).toBeLessThanOrEqual(64); + }); + }); }); From 8709f3efab351f0280c2d5cc3bf89efef5e4c45b Mon Sep 17 00:00:00 2001 From: Adrian Dimech <51220968+agdimech@users.noreply.github.com> Date: Mon, 30 Oct 2023 16:04:04 +1100 Subject: [PATCH 14/21] fix: ensure bundleddeps are correctly included in dist (#620) --- packages/pdk/.projen/deps.json | 25 ------------------------- packages/pdk/package.json | 6 ------ projenrc/projects/pdk-project.ts | 15 +++++++++++---- 3 files changed, 11 insertions(+), 35 deletions(-) diff --git a/packages/pdk/.projen/deps.json b/packages/pdk/.projen/deps.json index cf74efb6d..e404bebd1 100644 --- a/packages/pdk/.projen/deps.json +++ b/packages/pdk/.projen/deps.json @@ -179,15 +179,6 @@ "version": "^8", "type": "build" }, - { - "name": "execa", - "version": "5.1.1", - "type": "build" - }, - { - "name": "fs-extra", - "type": "build" - }, { "name": "generate-license-file", "type": "build" @@ -229,14 +220,6 @@ "name": "license-checker", "type": "build" }, - { - "name": "lodash", - "type": "build" - }, - { - "name": "mustache", - "type": "build" - }, { "name": "node-fetch", "version": "^2.6.7", @@ -267,10 +250,6 @@ "version": "1.6.1", "type": "build" }, - { - "name": "sharp", - "type": "build" - }, { "name": "tree-cli", "type": "build" @@ -284,10 +263,6 @@ "name": "ts-jest", "type": "build" }, - { - "name": "ts-node", - "type": "build" - }, { "name": "typescript", "type": "build" diff --git a/packages/pdk/package.json b/packages/pdk/package.json index 6dd0d2e73..c1482fd3f 100644 --- a/packages/pdk/package.json +++ b/packages/pdk/package.json @@ -82,8 +82,6 @@ "eslint-import-resolver-typescript": "^3.6.0", "eslint-plugin-import": "^2.28.1", "eslint-plugin-prettier": "^4.2.1", - "execa": "5.1.1", - "fs-extra": "^11.1.1", "generate-license-file": "^2.0.0", "jest": "^29.6.4", "jest-image-snapshot": "^6.2.0", @@ -94,8 +92,6 @@ "jsii-pacmak": "^1.88.0", "jsii-rosetta": "^1.88.0", "license-checker": "^25.0.1", - "lodash": "^4.17.21", - "mustache": "^4.2.0", "node-fetch": "^2.6.7", "nx": "^16", "prebuild": "^11.0.4", @@ -103,11 +99,9 @@ "prettier": "^2.8.8", "projen": "^0.73", "reregexp": "1.6.1", - "sharp": "^0.32.5", "tree-cli": "^0.6.7", "ts-command-line-args": "2.4.2", "ts-jest": "^29.1.1", - "ts-node": "^10.9.1", "typescript": "^5.2.2", "unzipper": "^0.10.14", "xml-flow": "^1.0.4" diff --git a/projenrc/projects/pdk-project.ts b/projenrc/projects/pdk-project.ts index 408f4f031..5de56b50e 100644 --- a/projenrc/projects/pdk-project.ts +++ b/projenrc/projects/pdk-project.ts @@ -139,8 +139,8 @@ export class PdkProject extends PDKProject { ); jsiiProjects?.forEach((subProject) => { this.copyProjectSource(subProject); - this.addProjectDeps(subProject); }); + this.addProjectDeps((jsiiProjects || []).flatMap((p) => p.deps.all)); this.emitIndexFile(jsiiProjects); } @@ -201,14 +201,21 @@ export class PdkProject extends PDKProject { ); } - private addProjectDeps(project: JsiiProject) { - project.deps.all + private addProjectDeps(deps: Dependency[]) { + const bundledDeps = new Set( + deps + .filter((dep) => dep.type === DependencyType.BUNDLED) + .map((dep) => dep.name) + ); + + deps .filter((dep) => !dep.name.startsWith(PDK_NAMESPACE)) .forEach((dep) => { switch (dep.type) { case DependencyType.BUILD: case DependencyType.TEST: - this.addDevDeps(this.renderDependency(dep)); + !bundledDeps.has(dep.name) && + this.addDevDeps(this.renderDependency(dep)); break; case DependencyType.BUNDLED: this.addBundledDeps(this.renderDependency(dep)); From f7a20d6d945cb376016644de7b2e5e65245fb1f5 Mon Sep 17 00:00:00 2001 From: Adrian Dimech <51220968+agdimech@users.noreply.github.com> Date: Tue, 31 Oct 2023 10:51:33 +1100 Subject: [PATCH 15/21] fix(cdk-graph-plugin-diagram): ensure package.json is included as a cache output (#622) --- packages/cdk-graph-plugin-diagram/project.json | 1 + projenrc/projects/cdk-graph-plugin-diagram-project.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/cdk-graph-plugin-diagram/project.json b/packages/cdk-graph-plugin-diagram/project.json index 2e1ae5296..d35b60977 100644 --- a/packages/cdk-graph-plugin-diagram/project.json +++ b/packages/cdk-graph-plugin-diagram/project.json @@ -23,6 +23,7 @@ "{projectRoot}/coverage", "{projectRoot}/test-reports", "{projectRoot}/docs/api", + "{projectRoot}/node_modules/sharp/package.json", "{projectRoot}/node_modules/sharp/build", "{projectRoot}/node_modules/sharp/vendor" ], diff --git a/projenrc/projects/cdk-graph-plugin-diagram-project.ts b/projenrc/projects/cdk-graph-plugin-diagram-project.ts index ddd376b8b..968866966 100644 --- a/projenrc/projects/cdk-graph-plugin-diagram-project.ts +++ b/projenrc/projects/cdk-graph-plugin-diagram-project.ts @@ -94,6 +94,7 @@ export class CdkGraphPluginDiagramProject extends CdkGraphPluginProject { }, ], outputs: [ + "{projectRoot}/node_modules/sharp/package.json", "{projectRoot}/node_modules/sharp/build", "{projectRoot}/node_modules/sharp/vendor", ], From b78ac014d91211bd927b3d97e144d465371da649 Mon Sep 17 00:00:00 2001 From: Jack Stevenson Date: Wed, 1 Nov 2023 16:13:43 +1100 Subject: [PATCH 16/21] chore: upgrade projen to 0.76 (#626) Upgrades projen peer dependency to 0.76 Fixes #612 --- .eslintrc.json | 2 +- .gitattributes | 2 +- .gitignore | 2 +- .npmignore | 2 +- .npmrc | 2 +- .nxignore | 2 +- .prettierignore | 2 +- .projen/deps.json | 12 +- .projen/files.json | 2 +- .projen/tasks.json | 2 +- .syncpackrc.json | 2 +- docs/.eslintrc.json | 2 +- docs/.gitattributes | 2 +- docs/.gitignore | 2 +- docs/.npmignore | 2 +- docs/.projen/deps.json | 7 +- docs/.projen/files.json | 2 +- docs/.projen/tasks.json | 2 +- docs/package.json | 5 +- docs/project.json | 2 +- docs/tsconfig.dev.json | 2 +- docs/tsconfig.json | 2 +- nx.json | 2 +- package.json | 7 +- packages/aws-arch/.eslintrc.json | 2 +- packages/aws-arch/.gitattributes | 2 +- packages/aws-arch/.gitignore | 2 +- packages/aws-arch/.npmignore | 2 +- packages/aws-arch/.prettierignore | 2 +- packages/aws-arch/.projen/deps.json | 6 +- packages/aws-arch/.projen/files.json | 2 +- packages/aws-arch/.projen/tasks.json | 2 +- packages/aws-arch/package.json | 8 +- packages/aws-arch/project.json | 2 +- packages/aws-arch/tsconfig.dev.json | 2 +- .../cdk-graph-plugin-diagram/.eslintrc.json | 2 +- .../cdk-graph-plugin-diagram/.gitattributes | 2 +- packages/cdk-graph-plugin-diagram/.gitignore | 2 +- packages/cdk-graph-plugin-diagram/.npmignore | 2 +- .../cdk-graph-plugin-diagram/.prettierignore | 2 +- .../.projen/deps.json | 6 +- .../.projen/files.json | 2 +- .../.projen/tasks.json | 2 +- .../cdk-graph-plugin-diagram/package.json | 6 +- .../cdk-graph-plugin-diagram/project.json | 2 +- .../tsconfig.dev.json | 2 +- packages/cdk-graph/.eslintrc.json | 2 +- packages/cdk-graph/.gitattributes | 2 +- packages/cdk-graph/.gitignore | 2 +- packages/cdk-graph/.npmignore | 2 +- packages/cdk-graph/.prettierignore | 2 +- packages/cdk-graph/.projen/deps.json | 2 +- packages/cdk-graph/.projen/files.json | 2 +- packages/cdk-graph/.projen/tasks.json | 2 +- packages/cdk-graph/package.json | 6 +- packages/cdk-graph/project.json | 2 +- packages/cdk-graph/tsconfig.dev.json | 2 +- .../.eslintrc.json | 2 +- .../.gitattributes | 2 +- .../cloudscape-react-ts-website/.gitignore | 2 +- .../cloudscape-react-ts-website/.npmignore | 2 +- .../.prettierignore | 2 +- .../.projen/deps.json | 6 +- .../.projen/files.json | 2 +- .../.projen/tasks.json | 2 +- .../cloudscape-react-ts-website/package.json | 8 +- .../cloudscape-react-ts-website/project.json | 2 +- .../src/react-ts-project-options.ts | 17 +- ...cape-react-ts-website-project.test.ts.snap | 39 +- .../tsconfig.dev.json | 2 +- packages/identity/.eslintrc.json | 2 +- packages/identity/.gitattributes | 2 +- packages/identity/.gitignore | 2 +- packages/identity/.npmignore | 2 +- packages/identity/.prettierignore | 2 +- packages/identity/.projen/deps.json | 2 +- packages/identity/.projen/files.json | 2 +- packages/identity/.projen/tasks.json | 2 +- packages/identity/package.json | 6 +- packages/identity/project.json | 2 +- packages/identity/tsconfig.dev.json | 2 +- packages/infrastructure/.eslintrc.json | 2 +- packages/infrastructure/.gitattributes | 2 +- packages/infrastructure/.gitignore | 2 +- packages/infrastructure/.npmignore | 2 +- packages/infrastructure/.prettierignore | 2 +- packages/infrastructure/.projen/deps.json | 6 +- packages/infrastructure/.projen/files.json | 2 +- packages/infrastructure/.projen/tasks.json | 2 +- packages/infrastructure/package.json | 8 +- packages/infrastructure/project.json | 2 +- .../projects/java/aws-cdk-java-app-options.ts | 4 +- .../projects/python/aws-cdk-py-app-options.ts | 4 +- .../typescript/aws-cdk-ts-app-options.ts | 23 +- packages/infrastructure/tsconfig.dev.json | 2 +- packages/monorepo/.eslintrc.json | 2 +- packages/monorepo/.gitattributes | 2 +- packages/monorepo/.gitignore | 2 +- packages/monorepo/.npmignore | 2 +- packages/monorepo/.prettierignore | 2 +- packages/monorepo/.projen/deps.json | 6 +- packages/monorepo/.projen/files.json | 2 +- packages/monorepo/.projen/tasks.json | 2 +- packages/monorepo/package.json | 8 +- packages/monorepo/project.json | 2 +- .../src/projects/java/java-project-options.ts | 4 +- .../projects/python/python-project-options.ts | 4 +- .../src/projects/typescript/monorepo-ts.ts | 10 +- .../typescript/typescript-project-options.ts | 17 +- packages/monorepo/src/utils/node.ts | 13 + .../test/__snapshots__/monorepo.test.ts.snap | 398 +++-- packages/monorepo/test/monorepo.test.ts | 4 +- packages/monorepo/tsconfig.dev.json | 2 +- packages/pdk-nag/.eslintrc.json | 2 +- packages/pdk-nag/.gitattributes | 2 +- packages/pdk-nag/.gitignore | 2 +- packages/pdk-nag/.npmignore | 2 +- packages/pdk-nag/.prettierignore | 2 +- packages/pdk-nag/.projen/deps.json | 10 +- packages/pdk-nag/.projen/files.json | 2 +- packages/pdk-nag/.projen/tasks.json | 2 +- packages/pdk-nag/package.json | 2 +- packages/pdk-nag/project.json | 2 +- packages/pdk-nag/tsconfig.dev.json | 2 +- packages/pdk/.gitattributes | 2 +- packages/pdk/.gitignore | 2 +- packages/pdk/.npmignore | 2 +- packages/pdk/.prettierignore | 2 +- packages/pdk/.projen/deps.json | 2 +- packages/pdk/.projen/files.json | 2 +- packages/pdk/.projen/tasks.json | 2 +- packages/pdk/package.json | 6 +- packages/pdk/project.json | 2 +- packages/pdk/tsconfig.dev.json | 2 +- packages/pipeline/.eslintrc.json | 2 +- packages/pipeline/.gitattributes | 2 +- packages/pipeline/.gitignore | 2 +- packages/pipeline/.npmignore | 2 +- packages/pipeline/.prettierignore | 2 +- packages/pipeline/.projen/deps.json | 2 +- packages/pipeline/.projen/files.json | 2 +- packages/pipeline/.projen/tasks.json | 2 +- packages/pipeline/package.json | 6 +- packages/pipeline/project.json | 2 +- packages/pipeline/src/codepipeline-props.ts | 2 +- packages/pipeline/tsconfig.dev.json | 2 +- packages/static-website/.eslintrc.json | 2 +- packages/static-website/.gitattributes | 2 +- packages/static-website/.gitignore | 2 +- packages/static-website/.npmignore | 2 +- packages/static-website/.prettierignore | 2 +- packages/static-website/.projen/deps.json | 2 +- packages/static-website/.projen/files.json | 2 +- packages/static-website/.projen/tasks.json | 2 +- packages/static-website/package.json | 6 +- packages/static-website/project.json | 2 +- .../src/bucket-deployment-props.ts | 2 +- .../static-website/src/distribution-props.ts | 2 +- packages/static-website/tsconfig.dev.json | 2 +- packages/type-safe-api/.eslintrc.json | 2 +- packages/type-safe-api/.gitattributes | 2 +- packages/type-safe-api/.gitignore | 2 +- packages/type-safe-api/.npmignore | 2 +- packages/type-safe-api/.prettierignore | 2 +- packages/type-safe-api/.projen/deps.json | 2 +- packages/type-safe-api/.projen/files.json | 2 +- packages/type-safe-api/.projen/tasks.json | 2 +- packages/type-safe-api/package.json | 6 +- packages/type-safe-api/project.json | 2 +- .../generated-typescript-handlers-project.ts | 2 + ...d-typescript-cdk-infrastructure-project.ts | 2 + .../typescript-react-query-hooks-library.ts | 2 + .../generated-typescript-runtime-project.ts | 2 + .../src/project/java-project-options.ts | 4 +- .../src/project/python-project-options.ts | 4 +- .../src/project/type-safe-api-project.ts | 8 +- .../src/project/typescript-project-options.ts | 17 +- .../type-safe-api-project.test.ts.snap | 1346 ++++++++++------- ...d-typescript-handlers-project.test.ts.snap | 17 +- ...pt-cdk-infrastructure-project.test.ts.snap | 17 +- ...ed-typescript-runtime-project.test.ts.snap | 15 +- .../project/type-safe-api-project.test.ts | 8 +- .../typescript-react-query-hooks.test.ts.snap | 8 +- packages/type-safe-api/tsconfig.dev.json | 2 +- pnpm-lock.yaml | 94 +- pnpm-workspace.yaml | 2 +- projenrc/projects/aws-arch-project.ts | 2 +- .../cloudscape-react-ts-website-project.ts | 2 +- projenrc/projects/infrastructure-project.ts | 1 + projenrc/projects/monorepo-project.ts | 2 +- tsconfig.dev.json | 2 +- tsconfig.json | 2 +- 192 files changed, 1452 insertions(+), 1063 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index df7b3ead2..37206a25c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". { "env": { "jest": true, diff --git a/.gitattributes b/.gitattributes index 8413bb4d8..126744fe8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". *.snap linguist-generated /.eslintrc.json linguist-generated diff --git a/.gitignore b/.gitignore index 7db3460a2..4ba011080 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json diff --git a/.npmignore b/.npmignore index b3a612af0..1346ce2ff 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". /.projen/ /test/ /tsconfig.dev.json diff --git a/.npmrc b/.npmrc index 99f3bac73..dd0728008 100644 --- a/.npmrc +++ b/.npmrc @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". resolution-mode=highest yes=true diff --git a/.nxignore b/.nxignore index c1c49fe1a..8bf04ee96 100644 --- a/.nxignore +++ b/.nxignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". .tmp .env .pytest_cache diff --git a/.prettierignore b/.prettierignore index 3385eb821..0712332ed 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1 @@ -# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". diff --git a/.projen/deps.json b/.projen/deps.json index a583255ff..7dab4bdb7 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -50,6 +50,11 @@ "name": "commitizen", "type": "build" }, + { + "name": "constructs", + "version": "^10.0.0", + "type": "build" + }, { "name": "cz-conventional-changelog", "type": "build" @@ -101,12 +106,11 @@ "type": "build" }, { - "name": "nx-cloud", + "name": "nx", "type": "build" }, { - "name": "nx", - "version": "16.0.0", + "name": "nx-cloud", "type": "build" }, { @@ -244,5 +248,5 @@ "type": "runtime" } ], - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"pnpm exec projen\"." } diff --git a/.projen/files.json b/.projen/files.json index 3447806dd..57f4aaf80 100644 --- a/.projen/files.json +++ b/.projen/files.json @@ -18,5 +18,5 @@ "tsconfig.dev.json", "tsconfig.json" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"pnpm exec projen\"." } diff --git a/.projen/tasks.json b/.projen/tasks.json index bc5330b4d..d6af918b1 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -252,5 +252,5 @@ "env": { "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")" }, - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"pnpm exec projen\"." } diff --git a/.syncpackrc.json b/.syncpackrc.json index 346b9b2f4..531105125 100644 --- a/.syncpackrc.json +++ b/.syncpackrc.json @@ -28,5 +28,5 @@ ], "source": [], "versionGroups": [], - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"pnpm exec projen\"." } diff --git a/docs/.eslintrc.json b/docs/.eslintrc.json index 629afe2ba..722ec0504 100644 --- a/docs/.eslintrc.json +++ b/docs/.eslintrc.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "env": { "jest": true, diff --git a/docs/.gitattributes b/docs/.gitattributes index 866cfe8f2..5e876437f 100644 --- a/docs/.gitattributes +++ b/docs/.gitattributes @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated diff --git a/docs/.gitignore b/docs/.gitignore index 141c68894..7597cf007 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json diff --git a/docs/.npmignore b/docs/.npmignore index 53def1c57..76e8c267a 100644 --- a/docs/.npmignore +++ b/docs/.npmignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.projen/ /test/ /tsconfig.dev.json diff --git a/docs/.projen/deps.json b/docs/.projen/deps.json index ac1bb6aa1..9c97f0d81 100644 --- a/docs/.projen/deps.json +++ b/docs/.projen/deps.json @@ -15,6 +15,11 @@ "version": "^6", "type": "build" }, + { + "name": "constructs", + "version": "^10.0.0", + "type": "build" + }, { "name": "eslint-import-resolver-node", "type": "build" @@ -114,5 +119,5 @@ "type": "runtime" } ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/docs/.projen/files.json b/docs/.projen/files.json index 1d6db55ab..f76bd0fb4 100644 --- a/docs/.projen/files.json +++ b/docs/.projen/files.json @@ -12,5 +12,5 @@ "tsconfig.dev.json", "tsconfig.json" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/docs/.projen/tasks.json b/docs/.projen/tasks.json index 1f7bb8878..df4950fd2 100644 --- a/docs/.projen/tasks.json +++ b/docs/.projen/tasks.json @@ -90,5 +90,5 @@ "env": { "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")" }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/docs/package.json b/docs/package.json index 2b188c1c6..bcc4a3816 100644 --- a/docs/package.json +++ b/docs/package.json @@ -15,12 +15,13 @@ "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-import-resolver-node": "^0.3.9", "eslint-import-resolver-typescript": "^3.6.0", "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.28.1", - "projen": "^0.73", + "projen": "^0.76", "typescript": "^5.2.2" }, "dependencies": { @@ -48,5 +49,5 @@ "version": "0.0.0", "types": "lib/index.d.ts", "private": true, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/docs/project.json b/docs/project.json index f53ab1208..3ca6010ef 100644 --- a/docs/project.json +++ b/docs/project.json @@ -80,5 +80,5 @@ "@aws/infrastructure", "@aws/docs" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/docs/tsconfig.dev.json b/docs/tsconfig.dev.json index 3bd367166..0123e6e26 100644 --- a/docs/tsconfig.dev.json +++ b/docs/tsconfig.dev.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "compilerOptions": { "alwaysStrict": true, diff --git a/docs/tsconfig.json b/docs/tsconfig.json index ec5bd9cf0..658bf9263 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "compilerOptions": { "rootDir": "src", diff --git a/nx.json b/nx.json index 93637f02c..699eed1cf 100644 --- a/nx.json +++ b/nx.json @@ -55,5 +55,5 @@ } } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"pnpm exec projen\"." } diff --git a/package.json b/package.json index 900e5b5a6..f67f42013 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", "commitizen": "^4.3.0", + "constructs": "^10.0.0", "cz-conventional-changelog": "^3.3.0", "eslint": "^8", "eslint-config-prettier": "^8.10.0", @@ -49,7 +50,7 @@ "nx": "16.0.0", "nx-cloud": "^16.3.0", "prettier": "^2.8.8", - "projen": "^0.73", + "projen": "^0.76", "syncpack": "^9.8.6", "ts-node": "^10.9.1", "typescript": "^5.2.2" @@ -64,7 +65,7 @@ "cdk-nag": "^2.27.115", "constructs": "^10.2.70", "fast-xml-parser": "^4.2.7", - "projen": "^0.73" + "projen": "^0.76" }, "pnpm": { "overrides": { @@ -122,5 +123,5 @@ "packages/type-safe-api" ] }, - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"pnpm exec projen\"." } diff --git a/packages/aws-arch/.eslintrc.json b/packages/aws-arch/.eslintrc.json index b0aad6504..8c659093a 100644 --- a/packages/aws-arch/.eslintrc.json +++ b/packages/aws-arch/.eslintrc.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "env": { "jest": true, diff --git a/packages/aws-arch/.gitattributes b/packages/aws-arch/.gitattributes index ba58a72ad..ed73610ac 100644 --- a/packages/aws-arch/.gitattributes +++ b/packages/aws-arch/.gitattributes @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated diff --git a/packages/aws-arch/.gitignore b/packages/aws-arch/.gitignore index 0a29cb116..e11116326 100644 --- a/packages/aws-arch/.gitignore +++ b/packages/aws-arch/.gitignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json diff --git a/packages/aws-arch/.npmignore b/packages/aws-arch/.npmignore index ce1133297..5ae15d9ea 100644 --- a/packages/aws-arch/.npmignore +++ b/packages/aws-arch/.npmignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.projen/ /test-reports/ junit.xml diff --git a/packages/aws-arch/.prettierignore b/packages/aws-arch/.prettierignore index 46704c733..17fe1524d 100644 --- a/packages/aws-arch/.prettierignore +++ b/packages/aws-arch/.prettierignore @@ -1 +1 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". diff --git a/packages/aws-arch/.projen/deps.json b/packages/aws-arch/.projen/deps.json index 81758b64f..09ec393b8 100644 --- a/packages/aws-arch/.projen/deps.json +++ b/packages/aws-arch/.projen/deps.json @@ -222,10 +222,14 @@ "version": "^1.12.1", "type": "override" }, + { + "name": "constructs", + "type": "peer" + }, { "name": "projen", "type": "peer" } ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/aws-arch/.projen/files.json b/packages/aws-arch/.projen/files.json index ba598efa6..026057b8c 100644 --- a/packages/aws-arch/.projen/files.json +++ b/packages/aws-arch/.projen/files.json @@ -13,5 +13,5 @@ "README.md", "tsconfig.dev.json" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/aws-arch/.projen/tasks.json b/packages/aws-arch/.projen/tasks.json index f9c453e16..70dbdc27d 100644 --- a/packages/aws-arch/.projen/tasks.json +++ b/packages/aws-arch/.projen/tasks.json @@ -273,5 +273,5 @@ "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")", "JSII_SUPPRESS_UPGRADE_PROMPT": "true" }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/aws-arch/package.json b/packages/aws-arch/package.json index 26808e0ad..ad8d6a4b7 100644 --- a/packages/aws-arch/package.json +++ b/packages/aws-arch/package.json @@ -48,6 +48,7 @@ "@types/xml-flow": "^1.0.2", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "10.2.70", "eslint": "^8", "eslint-config-prettier": "^8.10.0", "eslint-import-resolver-node": "^0.3.9", @@ -67,7 +68,7 @@ "lodash": "^4.17.21", "node-fetch": "^2.6.7", "prettier": "^2.8.8", - "projen": "^0.73", + "projen": "^0.76", "sharp": "^0.32.5", "tree-cli": "^0.6.7", "ts-jest": "^29.1.1", @@ -76,7 +77,8 @@ "xml-flow": "^1.0.4" }, "peerDependencies": { - "projen": "^0.73" + "constructs": "^10.2.70", + "projen": "^0.76" }, "pnpm": { "overrides": { @@ -178,5 +180,5 @@ "NOTICE", ".jsii" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/aws-arch/project.json b/packages/aws-arch/project.json index 3b4f0da96..7fb927c59 100644 --- a/packages/aws-arch/project.json +++ b/packages/aws-arch/project.json @@ -211,5 +211,5 @@ } } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/aws-arch/tsconfig.dev.json b/packages/aws-arch/tsconfig.dev.json index 3bd367166..0123e6e26 100644 --- a/packages/aws-arch/tsconfig.dev.json +++ b/packages/aws-arch/tsconfig.dev.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "compilerOptions": { "alwaysStrict": true, diff --git a/packages/cdk-graph-plugin-diagram/.eslintrc.json b/packages/cdk-graph-plugin-diagram/.eslintrc.json index b0aad6504..8c659093a 100644 --- a/packages/cdk-graph-plugin-diagram/.eslintrc.json +++ b/packages/cdk-graph-plugin-diagram/.eslintrc.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "env": { "jest": true, diff --git a/packages/cdk-graph-plugin-diagram/.gitattributes b/packages/cdk-graph-plugin-diagram/.gitattributes index ba58a72ad..ed73610ac 100644 --- a/packages/cdk-graph-plugin-diagram/.gitattributes +++ b/packages/cdk-graph-plugin-diagram/.gitattributes @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated diff --git a/packages/cdk-graph-plugin-diagram/.gitignore b/packages/cdk-graph-plugin-diagram/.gitignore index bbb37422e..670defbf4 100644 --- a/packages/cdk-graph-plugin-diagram/.gitignore +++ b/packages/cdk-graph-plugin-diagram/.gitignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json diff --git a/packages/cdk-graph-plugin-diagram/.npmignore b/packages/cdk-graph-plugin-diagram/.npmignore index f49e56fcf..e5ff9bb11 100644 --- a/packages/cdk-graph-plugin-diagram/.npmignore +++ b/packages/cdk-graph-plugin-diagram/.npmignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.projen/ /test-reports/ junit.xml diff --git a/packages/cdk-graph-plugin-diagram/.prettierignore b/packages/cdk-graph-plugin-diagram/.prettierignore index 46704c733..17fe1524d 100644 --- a/packages/cdk-graph-plugin-diagram/.prettierignore +++ b/packages/cdk-graph-plugin-diagram/.prettierignore @@ -1 +1 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". diff --git a/packages/cdk-graph-plugin-diagram/.projen/deps.json b/packages/cdk-graph-plugin-diagram/.projen/deps.json index 92a37d843..d7d81d25e 100644 --- a/packages/cdk-graph-plugin-diagram/.projen/deps.json +++ b/packages/cdk-graph-plugin-diagram/.projen/deps.json @@ -2,12 +2,12 @@ "dependencies": [ { "name": "@aws/aws-arch", - "version": "0.0.0", + "version": "^0.x", "type": "build" }, { "name": "@aws/cdk-graph", - "version": "0.0.0", + "version": "^0.x", "type": "build" }, { @@ -328,5 +328,5 @@ "type": "peer" } ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cdk-graph-plugin-diagram/.projen/files.json b/packages/cdk-graph-plugin-diagram/.projen/files.json index ba598efa6..026057b8c 100644 --- a/packages/cdk-graph-plugin-diagram/.projen/files.json +++ b/packages/cdk-graph-plugin-diagram/.projen/files.json @@ -13,5 +13,5 @@ "README.md", "tsconfig.dev.json" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cdk-graph-plugin-diagram/.projen/tasks.json b/packages/cdk-graph-plugin-diagram/.projen/tasks.json index bdcc55bbe..ba97f9e8c 100644 --- a/packages/cdk-graph-plugin-diagram/.projen/tasks.json +++ b/packages/cdk-graph-plugin-diagram/.projen/tasks.json @@ -219,5 +219,5 @@ "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")", "JSII_SUPPRESS_UPGRADE_PROMPT": "true" }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cdk-graph-plugin-diagram/package.json b/packages/cdk-graph-plugin-diagram/package.json index 0fd2e5ed8..027fe9d6b 100644 --- a/packages/cdk-graph-plugin-diagram/package.json +++ b/packages/cdk-graph-plugin-diagram/package.json @@ -70,7 +70,7 @@ "prebuild": "^11.0.4", "prebuild-install": "^7.1.1", "prettier": "^2.8.8", - "projen": "^0.73", + "projen": "^0.76", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", "typescript": "^5.2.2" @@ -80,7 +80,7 @@ "@aws/cdk-graph": "^0.x", "aws-cdk-lib": "^2.93.0", "constructs": "^10.2.70", - "projen": "^0.73" + "projen": "^0.76" }, "dependencies": { "@hpcc-js/wasm": "^2.13.1", @@ -223,5 +223,5 @@ "rootDir": "src" } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cdk-graph-plugin-diagram/project.json b/packages/cdk-graph-plugin-diagram/project.json index d35b60977..92f68564a 100644 --- a/packages/cdk-graph-plugin-diagram/project.json +++ b/packages/cdk-graph-plugin-diagram/project.json @@ -163,5 +163,5 @@ } } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cdk-graph-plugin-diagram/tsconfig.dev.json b/packages/cdk-graph-plugin-diagram/tsconfig.dev.json index df5894d72..8d6bdbf3f 100644 --- a/packages/cdk-graph-plugin-diagram/tsconfig.dev.json +++ b/packages/cdk-graph-plugin-diagram/tsconfig.dev.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "compilerOptions": { "alwaysStrict": true, diff --git a/packages/cdk-graph/.eslintrc.json b/packages/cdk-graph/.eslintrc.json index b0aad6504..8c659093a 100644 --- a/packages/cdk-graph/.eslintrc.json +++ b/packages/cdk-graph/.eslintrc.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "env": { "jest": true, diff --git a/packages/cdk-graph/.gitattributes b/packages/cdk-graph/.gitattributes index ba58a72ad..ed73610ac 100644 --- a/packages/cdk-graph/.gitattributes +++ b/packages/cdk-graph/.gitattributes @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated diff --git a/packages/cdk-graph/.gitignore b/packages/cdk-graph/.gitignore index a7ef26cbd..bd67e77b2 100644 --- a/packages/cdk-graph/.gitignore +++ b/packages/cdk-graph/.gitignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json diff --git a/packages/cdk-graph/.npmignore b/packages/cdk-graph/.npmignore index ce1133297..5ae15d9ea 100644 --- a/packages/cdk-graph/.npmignore +++ b/packages/cdk-graph/.npmignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.projen/ /test-reports/ junit.xml diff --git a/packages/cdk-graph/.prettierignore b/packages/cdk-graph/.prettierignore index 46704c733..17fe1524d 100644 --- a/packages/cdk-graph/.prettierignore +++ b/packages/cdk-graph/.prettierignore @@ -1 +1 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". diff --git a/packages/cdk-graph/.projen/deps.json b/packages/cdk-graph/.projen/deps.json index 77e36780d..42ff969c6 100644 --- a/packages/cdk-graph/.projen/deps.json +++ b/packages/cdk-graph/.projen/deps.json @@ -283,5 +283,5 @@ "type": "peer" } ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cdk-graph/.projen/files.json b/packages/cdk-graph/.projen/files.json index ba598efa6..026057b8c 100644 --- a/packages/cdk-graph/.projen/files.json +++ b/packages/cdk-graph/.projen/files.json @@ -13,5 +13,5 @@ "README.md", "tsconfig.dev.json" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cdk-graph/.projen/tasks.json b/packages/cdk-graph/.projen/tasks.json index aa0713a86..277d0236a 100644 --- a/packages/cdk-graph/.projen/tasks.json +++ b/packages/cdk-graph/.projen/tasks.json @@ -194,5 +194,5 @@ "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")", "JSII_SUPPRESS_UPGRADE_PROMPT": "true" }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cdk-graph/package.json b/packages/cdk-graph/package.json index 9768668e7..662038cb2 100644 --- a/packages/cdk-graph/package.json +++ b/packages/cdk-graph/package.json @@ -63,14 +63,14 @@ "jsii-pacmak": "^1.88.0", "jsii-rosetta": "^1.88.0", "prettier": "^2.8.8", - "projen": "^0.73", + "projen": "^0.76", "ts-jest": "^29.1.1", "typescript": "^5.2.2" }, "peerDependencies": { "aws-cdk-lib": "^2.93.0", "constructs": "^10.2.70", - "projen": "^0.73" + "projen": "^0.76" }, "dependencies": { "chalk": "^4.x", @@ -196,5 +196,5 @@ "rootDir": "src" } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cdk-graph/project.json b/packages/cdk-graph/project.json index 403a9e913..d282d0e19 100644 --- a/packages/cdk-graph/project.json +++ b/packages/cdk-graph/project.json @@ -143,5 +143,5 @@ } } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cdk-graph/tsconfig.dev.json b/packages/cdk-graph/tsconfig.dev.json index df5894d72..8d6bdbf3f 100644 --- a/packages/cdk-graph/tsconfig.dev.json +++ b/packages/cdk-graph/tsconfig.dev.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "compilerOptions": { "alwaysStrict": true, diff --git a/packages/cloudscape-react-ts-website/.eslintrc.json b/packages/cloudscape-react-ts-website/.eslintrc.json index 26d677f87..e428a3706 100644 --- a/packages/cloudscape-react-ts-website/.eslintrc.json +++ b/packages/cloudscape-react-ts-website/.eslintrc.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "env": { "jest": true, diff --git a/packages/cloudscape-react-ts-website/.gitattributes b/packages/cloudscape-react-ts-website/.gitattributes index bd8c07bdf..387331e61 100644 --- a/packages/cloudscape-react-ts-website/.gitattributes +++ b/packages/cloudscape-react-ts-website/.gitattributes @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated diff --git a/packages/cloudscape-react-ts-website/.gitignore b/packages/cloudscape-react-ts-website/.gitignore index 4df3eeb82..9040c38ad 100644 --- a/packages/cloudscape-react-ts-website/.gitignore +++ b/packages/cloudscape-react-ts-website/.gitignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json diff --git a/packages/cloudscape-react-ts-website/.npmignore b/packages/cloudscape-react-ts-website/.npmignore index ce1133297..5ae15d9ea 100644 --- a/packages/cloudscape-react-ts-website/.npmignore +++ b/packages/cloudscape-react-ts-website/.npmignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.projen/ /test-reports/ junit.xml diff --git a/packages/cloudscape-react-ts-website/.prettierignore b/packages/cloudscape-react-ts-website/.prettierignore index 46704c733..17fe1524d 100644 --- a/packages/cloudscape-react-ts-website/.prettierignore +++ b/packages/cloudscape-react-ts-website/.prettierignore @@ -1 +1 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". diff --git a/packages/cloudscape-react-ts-website/.projen/deps.json b/packages/cloudscape-react-ts-website/.projen/deps.json index a0238d795..40b20f6f0 100644 --- a/packages/cloudscape-react-ts-website/.projen/deps.json +++ b/packages/cloudscape-react-ts-website/.projen/deps.json @@ -176,6 +176,10 @@ "version": "^0.x", "type": "peer" }, + { + "name": "constructs", + "type": "peer" + }, { "name": "projen", "type": "peer" @@ -186,5 +190,5 @@ "type": "runtime" } ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cloudscape-react-ts-website/.projen/files.json b/packages/cloudscape-react-ts-website/.projen/files.json index ba598efa6..026057b8c 100644 --- a/packages/cloudscape-react-ts-website/.projen/files.json +++ b/packages/cloudscape-react-ts-website/.projen/files.json @@ -13,5 +13,5 @@ "README.md", "tsconfig.dev.json" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cloudscape-react-ts-website/.projen/tasks.json b/packages/cloudscape-react-ts-website/.projen/tasks.json index f2826940b..09b57df3d 100644 --- a/packages/cloudscape-react-ts-website/.projen/tasks.json +++ b/packages/cloudscape-react-ts-website/.projen/tasks.json @@ -194,5 +194,5 @@ "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")", "JSII_SUPPRESS_UPGRADE_PROMPT": "true" }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cloudscape-react-ts-website/package.json b/packages/cloudscape-react-ts-website/package.json index 03970776c..22b67ed20 100644 --- a/packages/cloudscape-react-ts-website/package.json +++ b/packages/cloudscape-react-ts-website/package.json @@ -35,6 +35,7 @@ "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "10.2.70", "eslint": "^8", "eslint-config-prettier": "^8.10.0", "eslint-import-resolver-node": "^0.3.9", @@ -50,13 +51,14 @@ "jsii-pacmak": "^1.88.0", "jsii-rosetta": "^1.88.0", "prettier": "^2.8.8", - "projen": "^0.73", + "projen": "^0.76", "ts-jest": "^29.1.1", "typescript": "^5.2.2" }, "peerDependencies": { "@aws/type-safe-api": "^0.x", - "projen": "^0.73" + "constructs": "^10.2.70", + "projen": "^0.76" }, "dependencies": { "@aws/type-safe-api": "^0.x", @@ -153,5 +155,5 @@ "rootDir": "src" } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cloudscape-react-ts-website/project.json b/packages/cloudscape-react-ts-website/project.json index 2ff378d0e..039c6b9e5 100644 --- a/packages/cloudscape-react-ts-website/project.json +++ b/packages/cloudscape-react-ts-website/project.json @@ -143,5 +143,5 @@ } } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/cloudscape-react-ts-website/src/react-ts-project-options.ts b/packages/cloudscape-react-ts-website/src/react-ts-project-options.ts index 4e67e1276..39cedcd9f 100644 --- a/packages/cloudscape-react-ts-website/src/react-ts-project-options.ts +++ b/packages/cloudscape-react-ts-website/src/react-ts-project-options.ts @@ -1,5 +1,5 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". -import { github, GitOptions, IgnoreFileOptions, javascript, LoggerOptions, Project, ProjectType, ProjenrcJsonOptions, ReleasableCommits, release, RenovatebotOptions, SampleReadmeProps, typescript } from 'projen'; +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". +import { github, GitOptions, GroupRunnerOptions, IgnoreFileOptions, javascript, LoggerOptions, Project, ProjectType, ProjenrcJsonOptions, ReleasableCommits, release, RenovatebotOptions, SampleReadmeProps, typescript } from 'projen'; /** * ReactTypeScriptProjectOptions @@ -364,10 +364,19 @@ export interface ReactTypeScriptProjectOptions { * @stability experimental */ readonly defaultReleaseBranch?: string; + /** + * Github Runner Group selection options. + * @stability experimental + * @description Defines a target Runner Group by name and/or labels + * @throws {Error} if both `runsOn` and `runsOnGroup` are specified + */ + readonly workflowRunsOnGroup?: GroupRunnerOptions; /** * Github Runner selection labels. * @default ["ubuntu-latest"] * @stability experimental + * @description Defines a target Runner by labels + * @throws {Error} if both `runsOn` and `runsOnGroup` are specified */ readonly workflowRunsOn?: Array; /** @@ -585,7 +594,7 @@ export interface ReactTypeScriptProjectOptions { readonly packageName?: string; /** * The Node Package Manager used to execute scripts. - * @default NodePackageManager.YARN + * @default NodePackageManager.YARN_CLASSIC * @stability experimental */ readonly packageManager?: javascript.NodePackageManager; @@ -930,7 +939,7 @@ export interface ReactTypeScriptProjectOptions { * * If this project has a parent, this directory is relative to the parent * directory and it cannot be the same as the parent or any of it's other - * sub-projects. + * subprojects. * @default "." * @stability experimental */ diff --git a/packages/cloudscape-react-ts-website/test/__snapshots__/cloudscape-react-ts-website-project.test.ts.snap b/packages/cloudscape-react-ts-website/test/__snapshots__/cloudscape-react-ts-website-project.test.ts.snap index 8c2e338ef..c5587b980 100644 --- a/packages/cloudscape-react-ts-website/test/__snapshots__/cloudscape-react-ts-website-project.test.ts.snap +++ b/packages/cloudscape-react-ts-website/test/__snapshots__/cloudscape-react-ts-website-project.test.ts.snap @@ -154,7 +154,6 @@ exports[`CloudscapeReactTsWebsiteProject Unit Tests Custom Options 1`] = ` /.gitignore linguist-generated /.mergify.yml linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated /.projen/** linguist-generated @@ -396,7 +395,6 @@ public/api.json !/.github/pull_request_template.md !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -498,6 +496,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -602,7 +605,6 @@ tsconfig.tsbuildinfo ".gitignore", ".mergify.yml", ".npmignore", - ".npmrc", ".prettierignore", ".prettierrc.json", ".projen/deps.json", @@ -785,13 +787,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@testing-library/jest-dom,@testing-library/react,@testing-library/user-event,@types/jest,@types/node,@types/react,@types/react-dom,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,typescript,@aws-northstar/ui,@cloudscape-design/board-components,@cloudscape-design/components,aws-prototoyping-sdk,react,react-dom,react-router-dom,react-scripts,web-vitals", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@testing-library/jest-dom,@testing-library/react,@testing-library/user-event,@types/jest,@types/node,@types/react,@types/react-dom,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,typescript,@aws-northstar/ui,@cloudscape-design/board-components,@cloudscape-design/components,aws-prototoyping-sdk,react,react-dom,react-router-dom,react-scripts,web-vitals", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @testing-library/jest-dom @testing-library/react @testing-library/user-event @types/jest @types/node @types/react @types/react-dom @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen typescript @aws-northstar/ui @cloudscape-design/board-components @cloudscape-design/components aws-prototoyping-sdk react react-dom react-router-dom react-scripts web-vitals", + "exec": "yarn upgrade @testing-library/jest-dom @testing-library/react @testing-library/user-event @types/jest @types/node @types/react @types/react-dom @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen typescript @aws-northstar/ui @cloudscape-design/board-components @cloudscape-design/components aws-prototoyping-sdk react react-dom react-router-dom react-scripts web-vitals", }, { "exec": "npx projen", @@ -1053,6 +1055,7 @@ Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/clouds "@types/react-dom": "*", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -1690,7 +1693,6 @@ exports[`CloudscapeReactTsWebsiteProject Unit Tests Defaults 1`] = ` /.gitignore linguist-generated /.mergify.yml linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated /.projen/** linguist-generated @@ -1932,7 +1934,6 @@ public/api.json !/.github/pull_request_template.md !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -2034,6 +2035,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -2134,7 +2140,6 @@ tsconfig.tsbuildinfo ".gitignore", ".mergify.yml", ".npmignore", - ".npmrc", ".prettierignore", ".prettierrc.json", ".projen/deps.json", @@ -2317,13 +2322,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@testing-library/jest-dom,@testing-library/react,@testing-library/user-event,@types/jest,@types/node,@types/react,@types/react-dom,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,typescript,@aws-northstar/ui,@cloudscape-design/board-components,@cloudscape-design/components,react,react-dom,react-router-dom,react-scripts,web-vitals", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@testing-library/jest-dom,@testing-library/react,@testing-library/user-event,@types/jest,@types/node,@types/react,@types/react-dom,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,typescript,@aws-northstar/ui,@cloudscape-design/board-components,@cloudscape-design/components,react,react-dom,react-router-dom,react-scripts,web-vitals", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @testing-library/jest-dom @testing-library/react @testing-library/user-event @types/jest @types/node @types/react @types/react-dom @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen typescript @aws-northstar/ui @cloudscape-design/board-components @cloudscape-design/components react react-dom react-router-dom react-scripts web-vitals", + "exec": "yarn upgrade @testing-library/jest-dom @testing-library/react @testing-library/user-event @types/jest @types/node @types/react @types/react-dom @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen typescript @aws-northstar/ui @cloudscape-design/board-components @cloudscape-design/components react react-dom react-router-dom react-scripts web-vitals", }, { "exec": "npx projen", @@ -2584,6 +2589,7 @@ Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/clouds "@types/react-dom": "*", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -3207,7 +3213,6 @@ exports[`CloudscapeReactTsWebsiteProject Unit Tests With TypeSafeApi 1`] = ` /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated /.projen/** linguist-generated @@ -3255,7 +3260,6 @@ public/api.json !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -3334,6 +3338,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -3442,7 +3451,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".prettierignore", ".prettierrc.json", ".projen/deps.json", @@ -3579,13 +3587,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@testing-library/jest-dom,@testing-library/react,@testing-library/user-event,@types/jest,@types/node,@types/react,@types/react-dom,@types/swagger-ui-react,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,typescript,@aws-northstar/ui,@cloudscape-design/board-components,@cloudscape-design/components,aws4fetch,react,react-dom,react-router-dom,react-scripts,testapi-typescript-react-query-hooks,web-vitals", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@testing-library/jest-dom,@testing-library/react,@testing-library/user-event,@types/jest,@types/node,@types/react,@types/react-dom,@types/swagger-ui-react,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,typescript,@aws-northstar/ui,@cloudscape-design/board-components,@cloudscape-design/components,aws4fetch,react,react-dom,react-router-dom,react-scripts,testapi-typescript-react-query-hooks,web-vitals", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @testing-library/jest-dom @testing-library/react @testing-library/user-event @types/jest @types/node @types/react @types/react-dom @types/swagger-ui-react @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen typescript @aws-northstar/ui @cloudscape-design/board-components @cloudscape-design/components aws4fetch react react-dom react-router-dom react-scripts testapi-typescript-react-query-hooks web-vitals", + "exec": "yarn upgrade @testing-library/jest-dom @testing-library/react @testing-library/user-event @types/jest @types/node @types/react @types/react-dom @types/swagger-ui-react @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen typescript @aws-northstar/ui @cloudscape-design/board-components @cloudscape-design/components aws4fetch react react-dom react-router-dom react-scripts testapi-typescript-react-query-hooks web-vitals", }, { "exec": "npx projen", @@ -3850,6 +3858,7 @@ Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/clouds "@types/swagger-ui-react": "*", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", diff --git a/packages/cloudscape-react-ts-website/tsconfig.dev.json b/packages/cloudscape-react-ts-website/tsconfig.dev.json index 3bd367166..0123e6e26 100644 --- a/packages/cloudscape-react-ts-website/tsconfig.dev.json +++ b/packages/cloudscape-react-ts-website/tsconfig.dev.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "compilerOptions": { "alwaysStrict": true, diff --git a/packages/identity/.eslintrc.json b/packages/identity/.eslintrc.json index 6964f0cf8..6f69ddb6d 100644 --- a/packages/identity/.eslintrc.json +++ b/packages/identity/.eslintrc.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "env": { "jest": true, diff --git a/packages/identity/.gitattributes b/packages/identity/.gitattributes index ba58a72ad..ed73610ac 100644 --- a/packages/identity/.gitattributes +++ b/packages/identity/.gitattributes @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated diff --git a/packages/identity/.gitignore b/packages/identity/.gitignore index a7ef26cbd..bd67e77b2 100644 --- a/packages/identity/.gitignore +++ b/packages/identity/.gitignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json diff --git a/packages/identity/.npmignore b/packages/identity/.npmignore index ce1133297..5ae15d9ea 100644 --- a/packages/identity/.npmignore +++ b/packages/identity/.npmignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.projen/ /test-reports/ junit.xml diff --git a/packages/identity/.prettierignore b/packages/identity/.prettierignore index 46704c733..17fe1524d 100644 --- a/packages/identity/.prettierignore +++ b/packages/identity/.prettierignore @@ -1 +1 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". diff --git a/packages/identity/.projen/deps.json b/packages/identity/.projen/deps.json index 750f0c546..fbf84149a 100644 --- a/packages/identity/.projen/deps.json +++ b/packages/identity/.projen/deps.json @@ -200,5 +200,5 @@ "type": "runtime" } ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/identity/.projen/files.json b/packages/identity/.projen/files.json index ba598efa6..026057b8c 100644 --- a/packages/identity/.projen/files.json +++ b/packages/identity/.projen/files.json @@ -13,5 +13,5 @@ "README.md", "tsconfig.dev.json" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/identity/.projen/tasks.json b/packages/identity/.projen/tasks.json index a83f0285f..02a36e425 100644 --- a/packages/identity/.projen/tasks.json +++ b/packages/identity/.projen/tasks.json @@ -191,5 +191,5 @@ "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")", "JSII_SUPPRESS_UPGRADE_PROMPT": "true" }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/identity/package.json b/packages/identity/package.json index f8d909254..cc1760d0b 100644 --- a/packages/identity/package.json +++ b/packages/identity/package.json @@ -52,7 +52,7 @@ "jsii-pacmak": "^1.88.0", "jsii-rosetta": "^1.88.0", "prettier": "^2.8.8", - "projen": "^0.73", + "projen": "^0.76", "ts-jest": "^29.1.1", "typescript": "^5.2.2" }, @@ -61,7 +61,7 @@ "aws-cdk-lib": "^2.93.0", "cdk-nag": "^2.27.115", "constructs": "^10.2.70", - "projen": "^0.73" + "projen": "^0.76" }, "dependencies": { "@aws/pdk-nag": "^0.x" @@ -154,5 +154,5 @@ "rootDir": "src" } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/identity/project.json b/packages/identity/project.json index 68c77179f..a3a54bb81 100644 --- a/packages/identity/project.json +++ b/packages/identity/project.json @@ -143,5 +143,5 @@ } } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/identity/tsconfig.dev.json b/packages/identity/tsconfig.dev.json index 3bd367166..0123e6e26 100644 --- a/packages/identity/tsconfig.dev.json +++ b/packages/identity/tsconfig.dev.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "compilerOptions": { "alwaysStrict": true, diff --git a/packages/infrastructure/.eslintrc.json b/packages/infrastructure/.eslintrc.json index 9c0e7481b..c75a80897 100644 --- a/packages/infrastructure/.eslintrc.json +++ b/packages/infrastructure/.eslintrc.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "env": { "jest": true, diff --git a/packages/infrastructure/.gitattributes b/packages/infrastructure/.gitattributes index 5481fc4cd..8e0b1952c 100644 --- a/packages/infrastructure/.gitattributes +++ b/packages/infrastructure/.gitattributes @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated diff --git a/packages/infrastructure/.gitignore b/packages/infrastructure/.gitignore index 4d8708e8f..627b415b9 100644 --- a/packages/infrastructure/.gitignore +++ b/packages/infrastructure/.gitignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json diff --git a/packages/infrastructure/.npmignore b/packages/infrastructure/.npmignore index ce1133297..5ae15d9ea 100644 --- a/packages/infrastructure/.npmignore +++ b/packages/infrastructure/.npmignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.projen/ /test-reports/ junit.xml diff --git a/packages/infrastructure/.prettierignore b/packages/infrastructure/.prettierignore index 46704c733..17fe1524d 100644 --- a/packages/infrastructure/.prettierignore +++ b/packages/infrastructure/.prettierignore @@ -1 +1 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". diff --git a/packages/infrastructure/.projen/deps.json b/packages/infrastructure/.projen/deps.json index cdf29a3d1..5ec5939ab 100644 --- a/packages/infrastructure/.projen/deps.json +++ b/packages/infrastructure/.projen/deps.json @@ -181,6 +181,10 @@ "version": "^0.x", "type": "peer" }, + { + "name": "constructs", + "type": "peer" + }, { "name": "projen", "type": "peer" @@ -201,5 +205,5 @@ "type": "runtime" } ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/infrastructure/.projen/files.json b/packages/infrastructure/.projen/files.json index ba598efa6..026057b8c 100644 --- a/packages/infrastructure/.projen/files.json +++ b/packages/infrastructure/.projen/files.json @@ -13,5 +13,5 @@ "README.md", "tsconfig.dev.json" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/infrastructure/.projen/tasks.json b/packages/infrastructure/.projen/tasks.json index 627507726..6e873ca35 100644 --- a/packages/infrastructure/.projen/tasks.json +++ b/packages/infrastructure/.projen/tasks.json @@ -194,5 +194,5 @@ "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")", "JSII_SUPPRESS_UPGRADE_PROMPT": "true" }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/infrastructure/package.json b/packages/infrastructure/package.json index ced1d4d6a..9d0c6dd0c 100644 --- a/packages/infrastructure/package.json +++ b/packages/infrastructure/package.json @@ -34,6 +34,7 @@ "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "10.2.70", "eslint": "^8", "eslint-config-prettier": "^8.10.0", "eslint-import-resolver-node": "^0.3.9", @@ -49,7 +50,7 @@ "jsii-pacmak": "^1.88.0", "jsii-rosetta": "^1.88.0", "prettier": "^2.8.8", - "projen": "^0.73", + "projen": "^0.76", "ts-jest": "^29.1.1", "typescript": "^5.2.2" }, @@ -57,7 +58,8 @@ "@aws/cloudscape-react-ts-website": "^0.x", "@aws/monorepo": "^0.x", "@aws/type-safe-api": "^0.x", - "projen": "^0.73" + "constructs": "^10.2.70", + "projen": "^0.76" }, "dependencies": { "@aws/cloudscape-react-ts-website": "^0.x", @@ -156,5 +158,5 @@ "rootDir": "src" } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/infrastructure/project.json b/packages/infrastructure/project.json index ed1121ae6..7b275304b 100644 --- a/packages/infrastructure/project.json +++ b/packages/infrastructure/project.json @@ -143,5 +143,5 @@ } } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/infrastructure/src/projects/java/aws-cdk-java-app-options.ts b/packages/infrastructure/src/projects/java/aws-cdk-java-app-options.ts index 11b48e47b..38001f9e6 100644 --- a/packages/infrastructure/src/projects/java/aws-cdk-java-app-options.ts +++ b/packages/infrastructure/src/projects/java/aws-cdk-java-app-options.ts @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". import { awscdk, github, GitOptions, IgnoreFileOptions, java, LoggerOptions, Project, ProjectType, ProjenrcJsonOptions, RenovatebotOptions, SampleReadmeProps } from 'projen'; /** @@ -420,7 +420,7 @@ export interface AwsCdkJavaAppOptions { * * If this project has a parent, this directory is relative to the parent * directory and it cannot be the same as the parent or any of it's other - * sub-projects. + * subprojects. * @default "." * @stability experimental */ diff --git a/packages/infrastructure/src/projects/python/aws-cdk-py-app-options.ts b/packages/infrastructure/src/projects/python/aws-cdk-py-app-options.ts index d15185a14..e7d67cfcc 100644 --- a/packages/infrastructure/src/projects/python/aws-cdk-py-app-options.ts +++ b/packages/infrastructure/src/projects/python/aws-cdk-py-app-options.ts @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". import { awscdk, github, GitOptions, IgnoreFileOptions, LoggerOptions, Project, ProjectType, ProjenrcJsonOptions, python, RenovatebotOptions, SampleReadmeProps } from 'projen'; /** @@ -396,7 +396,7 @@ export interface AwsCdkPythonAppOptions { * * If this project has a parent, this directory is relative to the parent * directory and it cannot be the same as the parent or any of it's other - * sub-projects. + * subprojects. * @default "." * @stability experimental */ diff --git a/packages/infrastructure/src/projects/typescript/aws-cdk-ts-app-options.ts b/packages/infrastructure/src/projects/typescript/aws-cdk-ts-app-options.ts index 238c4753e..c99f95fdd 100644 --- a/packages/infrastructure/src/projects/typescript/aws-cdk-ts-app-options.ts +++ b/packages/infrastructure/src/projects/typescript/aws-cdk-ts-app-options.ts @@ -1,5 +1,5 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". -import { awscdk, github, GitOptions, IgnoreFileOptions, javascript, LoggerOptions, Project, ProjectType, ProjenrcJsonOptions, ReleasableCommits, release, RenovatebotOptions, SampleReadmeProps, typescript } from 'projen'; +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". +import { awscdk, github, GitOptions, GroupRunnerOptions, IgnoreFileOptions, javascript, LoggerOptions, Project, ProjectType, ProjenrcJsonOptions, ReleasableCommits, release, RenovatebotOptions, SampleReadmeProps, typescript } from 'projen'; /** * AwsCdkTypeScriptAppOptions @@ -29,6 +29,12 @@ export interface AwsCdkTypeScriptAppOptions { * @stability experimental */ readonly integrationTestAutoDiscover?: boolean; + /** + * Enable experimental support for the AWS CDK integ-runner. + * @default false + * @stability experimental + */ + readonly experimentalIntegRunner?: boolean; /** * Automatically adds an `cloudfront.experimental.EdgeFunction` for each `.edge-lambda.ts` handler in your source tree. If this is disabled, you can manually add an `awscdk.AutoDiscover` component to your project. * @default true @@ -484,10 +490,19 @@ export interface AwsCdkTypeScriptAppOptions { * @stability experimental */ readonly defaultReleaseBranch?: string; + /** + * Github Runner Group selection options. + * @stability experimental + * @description Defines a target Runner Group by name and/or labels + * @throws {Error} if both `runsOn` and `runsOnGroup` are specified + */ + readonly workflowRunsOnGroup?: GroupRunnerOptions; /** * Github Runner selection labels. * @default ["ubuntu-latest"] * @stability experimental + * @description Defines a target Runner by labels + * @throws {Error} if both `runsOn` and `runsOnGroup` are specified */ readonly workflowRunsOn?: Array; /** @@ -705,7 +720,7 @@ export interface AwsCdkTypeScriptAppOptions { readonly packageName?: string; /** * The Node Package Manager used to execute scripts. - * @default NodePackageManager.YARN + * @default NodePackageManager.YARN_CLASSIC * @stability experimental */ readonly packageManager?: javascript.NodePackageManager; @@ -1050,7 +1065,7 @@ export interface AwsCdkTypeScriptAppOptions { * * If this project has a parent, this directory is relative to the parent * directory and it cannot be the same as the parent or any of it's other - * sub-projects. + * subprojects. * @default "." * @stability experimental */ diff --git a/packages/infrastructure/tsconfig.dev.json b/packages/infrastructure/tsconfig.dev.json index 3bd367166..0123e6e26 100644 --- a/packages/infrastructure/tsconfig.dev.json +++ b/packages/infrastructure/tsconfig.dev.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "compilerOptions": { "alwaysStrict": true, diff --git a/packages/monorepo/.eslintrc.json b/packages/monorepo/.eslintrc.json index 9d620a658..8ad04b7a5 100644 --- a/packages/monorepo/.eslintrc.json +++ b/packages/monorepo/.eslintrc.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "env": { "jest": true, diff --git a/packages/monorepo/.gitattributes b/packages/monorepo/.gitattributes index 3d4ccf23b..6a756284c 100644 --- a/packages/monorepo/.gitattributes +++ b/packages/monorepo/.gitattributes @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated diff --git a/packages/monorepo/.gitignore b/packages/monorepo/.gitignore index 12980a7ca..cae4bf9d0 100644 --- a/packages/monorepo/.gitignore +++ b/packages/monorepo/.gitignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json diff --git a/packages/monorepo/.npmignore b/packages/monorepo/.npmignore index ce1133297..5ae15d9ea 100644 --- a/packages/monorepo/.npmignore +++ b/packages/monorepo/.npmignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.projen/ /test-reports/ junit.xml diff --git a/packages/monorepo/.prettierignore b/packages/monorepo/.prettierignore index 46704c733..17fe1524d 100644 --- a/packages/monorepo/.prettierignore +++ b/packages/monorepo/.prettierignore @@ -1 +1 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". diff --git a/packages/monorepo/.projen/deps.json b/packages/monorepo/.projen/deps.json index b4c8b835e..ba9ab6e42 100644 --- a/packages/monorepo/.projen/deps.json +++ b/packages/monorepo/.projen/deps.json @@ -186,10 +186,14 @@ "version": "^1.12.1", "type": "override" }, + { + "name": "constructs", + "type": "peer" + }, { "name": "projen", "type": "peer" } ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/monorepo/.projen/files.json b/packages/monorepo/.projen/files.json index ba598efa6..026057b8c 100644 --- a/packages/monorepo/.projen/files.json +++ b/packages/monorepo/.projen/files.json @@ -13,5 +13,5 @@ "README.md", "tsconfig.dev.json" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/monorepo/.projen/tasks.json b/packages/monorepo/.projen/tasks.json index 5622f3400..288659a89 100644 --- a/packages/monorepo/.projen/tasks.json +++ b/packages/monorepo/.projen/tasks.json @@ -197,5 +197,5 @@ "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")", "JSII_SUPPRESS_UPGRADE_PROMPT": "true" }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/monorepo/package.json b/packages/monorepo/package.json index b31f0118f..498f663e7 100644 --- a/packages/monorepo/package.json +++ b/packages/monorepo/package.json @@ -40,6 +40,7 @@ "@types/semver": "^7.5.1", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "10.2.70", "eslint": "^8", "eslint-config-prettier": "^8.10.0", "eslint-import-resolver-node": "^0.3.9", @@ -56,12 +57,13 @@ "jsii-rosetta": "^1.88.0", "nx": "^16", "prettier": "^2.8.8", - "projen": "^0.73", + "projen": "^0.76", "ts-jest": "^29.1.1", "typescript": "^5.2.2" }, "peerDependencies": { - "projen": "^0.73" + "constructs": "^10.2.70", + "projen": "^0.76" }, "dependencies": { "@pnpm/reviewing.dependencies-hierarchy": "^2.0.10", @@ -161,5 +163,5 @@ "rootDir": "src" } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/monorepo/project.json b/packages/monorepo/project.json index f261c9ef5..4c3b9c241 100644 --- a/packages/monorepo/project.json +++ b/packages/monorepo/project.json @@ -143,5 +143,5 @@ } } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/monorepo/src/projects/java/java-project-options.ts b/packages/monorepo/src/projects/java/java-project-options.ts index d6d3d9828..850fc5327 100644 --- a/packages/monorepo/src/projects/java/java-project-options.ts +++ b/packages/monorepo/src/projects/java/java-project-options.ts @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". import { github, GitOptions, IgnoreFileOptions, java, LoggerOptions, Project, ProjectType, ProjenrcJsonOptions, RenovatebotOptions, SampleReadmeProps } from 'projen'; /** @@ -313,7 +313,7 @@ export interface JavaProjectOptions { * * If this project has a parent, this directory is relative to the parent * directory and it cannot be the same as the parent or any of it's other - * sub-projects. + * subprojects. * @default "." * @stability experimental */ diff --git a/packages/monorepo/src/projects/python/python-project-options.ts b/packages/monorepo/src/projects/python/python-project-options.ts index 2be7c1c27..fedbcd9fb 100644 --- a/packages/monorepo/src/projects/python/python-project-options.ts +++ b/packages/monorepo/src/projects/python/python-project-options.ts @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". import { github, GitOptions, IgnoreFileOptions, LoggerOptions, Project, ProjectType, ProjenrcJsonOptions, python, RenovatebotOptions, SampleReadmeProps } from 'projen'; /** @@ -280,7 +280,7 @@ export interface PythonProjectOptions { * * If this project has a parent, this directory is relative to the parent * directory and it cannot be the same as the parent or any of it's other - * sub-projects. + * subprojects. * @default "." * @stability experimental */ diff --git a/packages/monorepo/src/projects/typescript/monorepo-ts.ts b/packages/monorepo/src/projects/typescript/monorepo-ts.ts index 47b92e5d7..5a5795278 100644 --- a/packages/monorepo/src/projects/typescript/monorepo-ts.ts +++ b/packages/monorepo/src/projects/typescript/monorepo-ts.ts @@ -190,10 +190,12 @@ export class MonorepoTsProject this.package.addEngine("pnpm", ">=8"); break; } + case NodePackageManager.YARN_CLASSIC: case NodePackageManager.YARN: { this.package.addEngine("yarn", ">=1 <2"); break; } + case NodePackageManager.YARN_BERRY: case NodePackageManager.YARN2: { this.package.addEngine("yarn", ">=2"); this.gitignore.addPatterns( @@ -593,8 +595,12 @@ export class MonorepoTsProject // Automatically add all sub-project "bundledDependencies" to workspace "hohoist", otherwise they are not bundled in npm package if ( this.workspaceConfig?.yarn?.disableNoHoistBundled !== true && - (this.package.packageManager === NodePackageManager.YARN || - this.package.packageManager === NodePackageManager.YARN2) + [ + NodePackageManager.YARN, + NodePackageManager.YARN2, + NodePackageManager.YARN_BERRY, + NodePackageManager.YARN_CLASSIC, + ].includes(this.package.packageManager) ) { const noHoistBundled = this.subprojects.flatMap((sub) => { if (ProjectUtils.isNamedInstanceOf(sub, NodeProject)) { diff --git a/packages/monorepo/src/projects/typescript/typescript-project-options.ts b/packages/monorepo/src/projects/typescript/typescript-project-options.ts index eadc61975..d4cb0d4dd 100644 --- a/packages/monorepo/src/projects/typescript/typescript-project-options.ts +++ b/packages/monorepo/src/projects/typescript/typescript-project-options.ts @@ -1,5 +1,5 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". -import { github, GitOptions, IgnoreFileOptions, javascript, LoggerOptions, Project, ProjectType, ProjenrcJsonOptions, ReleasableCommits, release, RenovatebotOptions, SampleReadmeProps, typescript } from 'projen'; +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". +import { github, GitOptions, GroupRunnerOptions, IgnoreFileOptions, javascript, LoggerOptions, Project, ProjectType, ProjenrcJsonOptions, ReleasableCommits, release, RenovatebotOptions, SampleReadmeProps, typescript } from 'projen'; /** * TypeScriptProjectOptions @@ -341,10 +341,19 @@ export interface TypeScriptProjectOptions { * @stability experimental */ readonly defaultReleaseBranch?: string; + /** + * Github Runner Group selection options. + * @stability experimental + * @description Defines a target Runner Group by name and/or labels + * @throws {Error} if both `runsOn` and `runsOnGroup` are specified + */ + readonly workflowRunsOnGroup?: GroupRunnerOptions; /** * Github Runner selection labels. * @default ["ubuntu-latest"] * @stability experimental + * @description Defines a target Runner by labels + * @throws {Error} if both `runsOn` and `runsOnGroup` are specified */ readonly workflowRunsOn?: Array; /** @@ -562,7 +571,7 @@ export interface TypeScriptProjectOptions { readonly packageName?: string; /** * The Node Package Manager used to execute scripts. - * @default NodePackageManager.YARN + * @default NodePackageManager.YARN_CLASSIC * @stability experimental */ readonly packageManager?: javascript.NodePackageManager; @@ -907,7 +916,7 @@ export interface TypeScriptProjectOptions { * * If this project has a parent, this directory is relative to the parent * directory and it cannot be the same as the parent or any of it's other - * sub-projects. + * subprojects. * @default "." * @stability experimental */ diff --git a/packages/monorepo/src/utils/node.ts b/packages/monorepo/src/utils/node.ts index c7a357b88..4948c8e2a 100644 --- a/packages/monorepo/src/utils/node.ts +++ b/packages/monorepo/src/utils/node.ts @@ -119,6 +119,8 @@ export namespace NodePackageUtils { switch (packageManager) { case NodePackageManager.YARN: case NodePackageManager.YARN2: + case NodePackageManager.YARN_BERRY: + case NodePackageManager.YARN_CLASSIC: return withArgs("yarn run", args); case NodePackageManager.PNPM: return withArgs("pnpm run", args); @@ -146,9 +148,11 @@ export namespace NodePackageUtils { ): string { switch (packageManager) { case NodePackageManager.YARN: + case NodePackageManager.YARN_CLASSIC: // "yarn exec" is not propagating transient args (`yarn exec nx run-many --target=build` does not receive `--target=build`) return withArgs("yarn", args); case NodePackageManager.YARN2: + case NodePackageManager.YARN_BERRY: return withArgs("yarn exec", args); case NodePackageManager.PNPM: return withArgs("pnpm exec", args); @@ -166,6 +170,7 @@ export namespace NodePackageUtils { ): string { switch (packageManager) { case NodePackageManager.YARN2: + case NodePackageManager.YARN_BERRY: return withArgs("yarn dlx", args); case NodePackageManager.PNPM: return withArgs("pnpm dlx", args); @@ -183,6 +188,8 @@ export namespace NodePackageUtils { switch (packageManager) { case NodePackageManager.YARN: case NodePackageManager.YARN2: + case NodePackageManager.YARN_CLASSIC: + case NodePackageManager.YARN_BERRY: return withArgs("yarn install", args); case NodePackageManager.PNPM: return withArgs("pnpm i", args); @@ -201,6 +208,8 @@ export namespace NodePackageUtils { switch (packageManager) { case NodePackageManager.YARN: case NodePackageManager.YARN2: + case NodePackageManager.YARN_CLASSIC: + case NodePackageManager.YARN_BERRY: return withArgs("yarn", args); case NodePackageManager.PNPM: return withArgs("pnpm", args); @@ -217,6 +226,8 @@ export namespace NodePackageUtils { switch (packageManager) { case NodePackageManager.YARN: case NodePackageManager.YARN2: + case NodePackageManager.YARN_CLASSIC: + case NodePackageManager.YARN_BERRY: return withArgs("yarn workspace", [packageName, ...args]); case NodePackageManager.PNPM: return withArgs("pnpm", [ @@ -240,6 +251,8 @@ export namespace NodePackageUtils { switch (packageManager) { case NodePackageManager.YARN: case NodePackageManager.YARN2: + case NodePackageManager.YARN_CLASSIC: + case NodePackageManager.YARN_BERRY: return `$(yarn bin)/${_cmd}`; case NodePackageManager.PNPM: return `$(pnpm bin)/${_cmd}`; diff --git a/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap b/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap index 41907fd86..c0409a3af 100644 --- a/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap +++ b/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap @@ -142,7 +142,7 @@ exports[`NX Monorepo Unit Tests Additional Workspace Packages 1`] = ` }, }, }, - ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". *.snap linguist-generated /.eslintrc.json linguist-generated @@ -165,7 +165,7 @@ exports[`NX Monorepo Unit Tests Additional Workspace Packages 1`] = ` /pnpm-workspace.yaml linguist-generated /tsconfig.dev.json linguist-generated /tsconfig.json linguist-generated", - ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json @@ -214,7 +214,7 @@ jspm_packages/ !/.syncpackrc.json !/pnpm-workspace.yaml ", - ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". /.projen/ /test/ /tsconfig.dev.json @@ -231,22 +231,22 @@ dist tsconfig.tsbuildinfo /.eslintrc.json ", - ".npmrc": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".npmrc": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". resolution-mode=highest ", - ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". .tmp .env .pytest_cache ", - ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". ", ".prettierrc.json": { "overrides": [], }, ".projen/deps.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencies": [ { "name": "@aws/pdk", @@ -268,6 +268,11 @@ resolution-mode=highest "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -300,7 +305,7 @@ resolution-mode=highest { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -357,7 +362,7 @@ resolution-mode=highest ], }, ".projen/files.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "files": [ ".eslintrc.json", ".gitattributes", @@ -379,7 +384,7 @@ resolution-mode=highest ], }, ".projen/tasks.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "env": { "PATH": "$(pnpm -c exec "node --print process.env.PATH")", }, @@ -560,13 +565,13 @@ resolution-mode=highest "exec": "pnpm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "pnpm i --no-frozen-lockfile", }, { - "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "pnpm exec projen", @@ -606,7 +611,7 @@ resolution-mode=highest }, }, ".syncpackrc.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencyTypes": [], "dev": true, "filter": ".", @@ -842,7 +847,7 @@ resolution-mode=highest ", "README.md": "# replace this", "nx.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "affected": { "defaultBase": "mainline", }, @@ -889,7 +894,7 @@ resolution-mode=highest }, }, "package.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencies": { "aws-cdk-lib": "*", "cdk-nag": "*", @@ -900,6 +905,7 @@ resolution-mode=highest "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -1287,6 +1293,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-import-resolver-node", "type": "build", @@ -1472,13 +1483,13 @@ tsconfig.tsbuildinfo "exec": "pnpm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", }, { "exec": "pnpm i --no-frozen-lockfile", }, { - "exec": "pnpm update @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", + "exec": "pnpm update @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", }, { "exec": "npx projen", @@ -1710,6 +1721,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-import-resolver-node": "*", "eslint-import-resolver-typescript": "*", @@ -1951,7 +1963,7 @@ test('hello', () => { "src/**/*.ts", ], }, - "pnpm-workspace.yaml": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + "pnpm-workspace.yaml": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". packages: - my/custom/package @@ -2179,14 +2191,13 @@ exports[`NX Monorepo Unit Tests Additional Workspace Packages 2`] = ` }, }, }, - ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen". *.snap linguist-generated /.eslintrc.json linguist-generated /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -2201,7 +2212,7 @@ exports[`NX Monorepo Unit Tests Additional Workspace Packages 2`] = ` /tsconfig.dev.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", - ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json @@ -2236,7 +2247,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -2249,7 +2259,7 @@ jspm_packages/ !/.nxignore !/.syncpackrc.json ", - ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen". /.projen/ /test/ /tsconfig.dev.json @@ -2266,18 +2276,18 @@ dist tsconfig.tsbuildinfo /.eslintrc.json ", - ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen". .tmp .env .pytest_cache ", - ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen". ", ".prettierrc.json": { "overrides": [], }, ".projen/deps.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "dependencies": [ { "name": "@aws/pdk", @@ -2299,6 +2309,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -2331,7 +2346,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -2388,13 +2403,12 @@ tsconfig.tsbuildinfo ], }, ".projen/files.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "files": [ ".eslintrc.json", ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -2409,7 +2423,7 @@ tsconfig.tsbuildinfo ], }, ".projen/tasks.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "env": { "PATH": "$(npx -c "node --print process.env.PATH")", }, @@ -2590,13 +2604,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "yarn projen", @@ -2636,7 +2650,7 @@ tsconfig.tsbuildinfo }, }, ".syncpackrc.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "dependencyTypes": [], "dev": true, "filter": ".", @@ -2872,7 +2886,7 @@ tsconfig.tsbuildinfo ", "README.md": "# replace this", "nx.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "affected": { "defaultBase": "mainline", }, @@ -2919,7 +2933,7 @@ tsconfig.tsbuildinfo }, }, "package.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "dependencies": { "aws-cdk-lib": "*", "cdk-nag": "*", @@ -2930,6 +2944,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -3217,7 +3232,6 @@ tsconfig.tsbuildinfo /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated /.projen/files.json linguist-generated @@ -3263,7 +3277,6 @@ jspm_packages/ /test-reports/ junit.xml /coverage/ -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -3315,6 +3328,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-import-resolver-node", "type": "build", @@ -3500,13 +3518,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", + "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", }, { "exec": "npx projen", @@ -3738,6 +3756,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-import-resolver-node": "*", "eslint-import-resolver-typescript": "*", @@ -4198,14 +4217,13 @@ exports[`NX Monorepo Unit Tests Additional Workspace Packages 3`] = ` }, }, }, - ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen". *.snap linguist-generated /.eslintrc.json linguist-generated /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -4220,7 +4238,7 @@ exports[`NX Monorepo Unit Tests Additional Workspace Packages 3`] = ` /tsconfig.dev.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", - ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json @@ -4255,7 +4273,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -4272,7 +4289,7 @@ jspm_packages/ !.yarn/plugins !/.syncpackrc.json ", - ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen". /.projen/ /test/ /tsconfig.dev.json @@ -4289,18 +4306,18 @@ dist tsconfig.tsbuildinfo /.eslintrc.json ", - ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen". .tmp .env .pytest_cache ", - ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen". ", ".prettierrc.json": { "overrides": [], }, ".projen/deps.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "dependencies": [ { "name": "@aws/pdk", @@ -4322,6 +4339,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -4354,7 +4376,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -4411,13 +4433,12 @@ tsconfig.tsbuildinfo ], }, ".projen/files.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "files": [ ".eslintrc.json", ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -4432,7 +4453,7 @@ tsconfig.tsbuildinfo ], }, ".projen/tasks.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "env": { "PATH": "$(npx -c "node --print process.env.PATH")", }, @@ -4613,13 +4634,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "yarn exec projen", @@ -4659,7 +4680,7 @@ tsconfig.tsbuildinfo }, }, ".syncpackrc.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "dependencyTypes": [], "dev": true, "filter": ".", @@ -4895,7 +4916,7 @@ tsconfig.tsbuildinfo ", "README.md": "# replace this", "nx.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "affected": { "defaultBase": "mainline", }, @@ -4942,7 +4963,7 @@ tsconfig.tsbuildinfo }, }, "package.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "dependencies": { "aws-cdk-lib": "*", "cdk-nag": "*", @@ -4953,6 +4974,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -5240,7 +5262,6 @@ tsconfig.tsbuildinfo /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated /.projen/files.json linguist-generated @@ -5286,7 +5307,6 @@ jspm_packages/ /test-reports/ junit.xml /coverage/ -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -5338,6 +5358,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-import-resolver-node", "type": "build", @@ -5523,13 +5548,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", }, { "exec": "yarn install", }, { - "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", + "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", }, { "exec": "npx projen", @@ -5761,6 +5786,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-import-resolver-node": "*", "eslint-import-resolver-typescript": "*", @@ -6227,7 +6253,6 @@ exports[`NX Monorepo Unit Tests Adds Java Dependencies 1`] = ` /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -6277,7 +6302,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -6340,6 +6364,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -6372,7 +6401,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -6435,7 +6464,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -6631,13 +6659,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -6971,6 +6999,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -8073,7 +8102,6 @@ exports[`NX Monorepo Unit Tests Adds Python Poetry Dependencies 1`] = ` /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -8123,7 +8151,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -8186,6 +8213,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -8218,7 +8250,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -8281,7 +8313,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -8485,13 +8516,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -8825,6 +8856,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -9217,7 +9249,6 @@ version = "1.0.0" description = "" authors = [ "test " ] readme = "README.md" -dev-dependencies = { } [tool.poetry.dependencies] python = "^3.7" @@ -9225,6 +9256,9 @@ dev-dependencies = { } [tool.poetry.dependencies.library] path = "../library" develop = true + + [tool.poetry.dev-dependencies] + pytest = "6.2.1" ", "packages/consumer/tests/__init__.py": "", "packages/consumer/tests/test_example.py": "import pytest @@ -9567,10 +9601,12 @@ version = "1.0.0" description = "" authors = [ "test " ] readme = "README.md" -dev-dependencies = { } [tool.poetry.dependencies] python = "^3.7" + + [tool.poetry.dev-dependencies] + pytest = "6.2.1" ", "packages/library/tests/__init__.py": "", "packages/library/tests/test_example.py": "import pytest @@ -9815,7 +9851,6 @@ exports[`NX Monorepo Unit Tests Affected Branch 1`] = ` /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -9865,7 +9900,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -9928,6 +9962,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -9960,7 +9999,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -10023,7 +10062,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -10219,13 +10257,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -10559,6 +10597,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -10842,7 +10881,6 @@ exports[`NX Monorepo Unit Tests Composite 1`] = ` /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -10892,7 +10930,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -10955,6 +10992,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -10987,7 +11029,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -11050,7 +11092,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -11254,13 +11295,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -11594,6 +11635,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -11934,6 +11976,7 @@ if __name__ == "__main__": return f"Hello {name}!" ", "packages/py-subproject/requirements-dev.txt": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +pytest==6.2.1 ", "packages/py-subproject/requirements.txt": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". ", @@ -12180,7 +12223,6 @@ def test_hello(name, expected): /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated /.projen/files.json linguist-generated @@ -12226,7 +12268,6 @@ jspm_packages/ /test-reports/ junit.xml /coverage/ -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -12278,6 +12319,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-import-resolver-node", "type": "build", @@ -12463,13 +12509,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", + "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", }, { "exec": "npx projen", @@ -12701,6 +12747,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-import-resolver-node": "*", "eslint-import-resolver-typescript": "*", @@ -13170,7 +13217,6 @@ test('hello', () => { /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated /.projen/files.json linguist-generated @@ -13216,7 +13262,6 @@ jspm_packages/ /test-reports/ junit.xml /coverage/ -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -13268,6 +13313,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-import-resolver-node", "type": "build", @@ -13457,13 +13507,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,ts-subproject,typescript", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,ts-subproject,typescript", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest ts-subproject typescript", + "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest ts-subproject typescript", }, { "exec": "npx projen", @@ -13695,6 +13745,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-import-resolver-node": "*", "eslint-import-resolver-typescript": "*", @@ -14162,7 +14213,6 @@ exports[`NX Monorepo Unit Tests Disable Node Warnings 1`] = ` /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -14212,7 +14262,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -14275,6 +14324,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -14307,7 +14361,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -14370,7 +14424,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -14567,13 +14620,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -14907,6 +14960,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -15189,7 +15243,6 @@ exports[`NX Monorepo Unit Tests Empty Monorepo 1`] = ` /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -15239,7 +15292,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -15302,6 +15354,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -15334,7 +15391,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -15397,7 +15454,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -15593,13 +15649,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -15933,6 +15989,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -16215,7 +16272,6 @@ exports[`NX Monorepo Unit Tests Ignore Patterns 1`] = ` /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -16266,7 +16322,6 @@ another !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -16331,6 +16386,11 @@ pattern1.txt "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -16363,7 +16423,7 @@ pattern1.txt { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -16426,7 +16486,6 @@ pattern1.txt ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -16622,13 +16681,13 @@ pattern1.txt "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -16962,6 +17021,7 @@ pattern1.txt "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -17238,7 +17298,7 @@ exports[`NX Monorepo Unit Tests PNPM 1`] = ` }, }, }, - ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". *.snap linguist-generated /.eslintrc.json linguist-generated @@ -17261,7 +17321,7 @@ exports[`NX Monorepo Unit Tests PNPM 1`] = ` /pnpm-workspace.yaml linguist-generated /tsconfig.dev.json linguist-generated /tsconfig.json linguist-generated", - ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json @@ -17310,7 +17370,7 @@ jspm_packages/ !/.syncpackrc.json !/pnpm-workspace.yaml ", - ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". /.projen/ /test/ /tsconfig.dev.json @@ -17327,22 +17387,22 @@ dist tsconfig.tsbuildinfo /.eslintrc.json ", - ".npmrc": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".npmrc": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". resolution-mode=highest ", - ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". .tmp .env .pytest_cache ", - ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". ", ".prettierrc.json": { "overrides": [], }, ".projen/deps.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencies": [ { "name": "@aws/pdk", @@ -17364,6 +17424,11 @@ resolution-mode=highest "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -17396,7 +17461,7 @@ resolution-mode=highest { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -17453,7 +17518,7 @@ resolution-mode=highest ], }, ".projen/files.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "files": [ ".eslintrc.json", ".gitattributes", @@ -17475,7 +17540,7 @@ resolution-mode=highest ], }, ".projen/tasks.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "env": { "PATH": "$(pnpm -c exec "node --print process.env.PATH")", }, @@ -17656,13 +17721,13 @@ resolution-mode=highest "exec": "pnpm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "pnpm i --no-frozen-lockfile", }, { - "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "pnpm exec projen", @@ -17702,7 +17767,7 @@ resolution-mode=highest }, }, ".syncpackrc.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencyTypes": [], "dev": true, "filter": ".", @@ -17938,7 +18003,7 @@ resolution-mode=highest ", "README.md": "# replace this", "nx.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "affected": { "defaultBase": "mainline", }, @@ -17985,7 +18050,7 @@ resolution-mode=highest }, }, "package.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencies": { "aws-cdk-lib": "*", "cdk-nag": "*", @@ -17996,6 +18061,7 @@ resolution-mode=highest "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -18380,6 +18446,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-import-resolver-node", "type": "build", @@ -18565,13 +18636,13 @@ tsconfig.tsbuildinfo "exec": "pnpm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", }, { "exec": "pnpm i --no-frozen-lockfile", }, { - "exec": "pnpm update @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", + "exec": "pnpm update @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", }, { "exec": "npx projen", @@ -18803,6 +18874,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-import-resolver-node": "*", "eslint-import-resolver-typescript": "*", @@ -19044,7 +19116,7 @@ test('hello', () => { "src/**/*.ts", ], }, - "pnpm-workspace.yaml": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + "pnpm-workspace.yaml": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". packages: - packages/ts-subproject @@ -19275,7 +19347,6 @@ exports[`NX Monorepo Unit Tests Target Dependencies 1`] = ` /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -19325,7 +19396,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -19388,6 +19458,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -19420,7 +19495,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -19483,7 +19558,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -19679,13 +19753,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -20032,6 +20106,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -20315,7 +20390,6 @@ exports[`NX Monorepo Unit Tests Workspace Package Order 1`] = ` /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -20365,7 +20439,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -20428,6 +20501,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -20460,7 +20538,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -20523,7 +20601,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -20719,13 +20796,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -21059,6 +21136,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -21349,7 +21427,6 @@ tsconfig.tsbuildinfo /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated /.projen/files.json linguist-generated @@ -21395,7 +21472,6 @@ jspm_packages/ /test-reports/ junit.xml /coverage/ -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -21447,6 +21523,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-import-resolver-node", "type": "build", @@ -21632,13 +21713,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", + "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", }, { "exec": "npx projen", @@ -21870,6 +21951,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-import-resolver-node": "*", "eslint-import-resolver-typescript": "*", @@ -22336,7 +22418,6 @@ test('hello', () => { /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated /.projen/files.json linguist-generated @@ -22382,7 +22463,6 @@ jspm_packages/ /test-reports/ junit.xml /coverage/ -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -22434,6 +22514,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-import-resolver-node", "type": "build", @@ -22619,13 +22704,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", + "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", }, { "exec": "npx projen", @@ -22857,6 +22942,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-import-resolver-node": "*", "eslint-import-resolver-typescript": "*", @@ -23323,7 +23409,6 @@ test('hello', () => { /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated /.projen/files.json linguist-generated @@ -23369,7 +23454,6 @@ jspm_packages/ /test-reports/ junit.xml /coverage/ -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -23421,6 +23505,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-import-resolver-node", "type": "build", @@ -23606,13 +23695,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", + "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", }, { "exec": "npx projen", @@ -23844,6 +23933,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-import-resolver-node": "*", "eslint-import-resolver-typescript": "*", diff --git a/packages/monorepo/test/monorepo.test.ts b/packages/monorepo/test/monorepo.test.ts index ec16bdeda..0bc49917a 100644 --- a/packages/monorepo/test/monorepo.test.ts +++ b/packages/monorepo/test/monorepo.test.ts @@ -66,8 +66,8 @@ describe("NX Monorepo Unit Tests", () => { it.each([ NodePackageManager.PNPM, - NodePackageManager.YARN, - NodePackageManager.YARN2, + NodePackageManager.YARN_CLASSIC, + NodePackageManager.YARN_BERRY, ])("Additional Workspace Packages", (packageManager) => { const project = new MonorepoTsProject({ defaultReleaseBranch: "mainline", diff --git a/packages/monorepo/tsconfig.dev.json b/packages/monorepo/tsconfig.dev.json index 3bd367166..0123e6e26 100644 --- a/packages/monorepo/tsconfig.dev.json +++ b/packages/monorepo/tsconfig.dev.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "compilerOptions": { "alwaysStrict": true, diff --git a/packages/pdk-nag/.eslintrc.json b/packages/pdk-nag/.eslintrc.json index 59daedea3..bd69ea53b 100644 --- a/packages/pdk-nag/.eslintrc.json +++ b/packages/pdk-nag/.eslintrc.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "env": { "jest": true, diff --git a/packages/pdk-nag/.gitattributes b/packages/pdk-nag/.gitattributes index ba58a72ad..ed73610ac 100644 --- a/packages/pdk-nag/.gitattributes +++ b/packages/pdk-nag/.gitattributes @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated diff --git a/packages/pdk-nag/.gitignore b/packages/pdk-nag/.gitignore index a7ef26cbd..bd67e77b2 100644 --- a/packages/pdk-nag/.gitignore +++ b/packages/pdk-nag/.gitignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json diff --git a/packages/pdk-nag/.npmignore b/packages/pdk-nag/.npmignore index ce1133297..5ae15d9ea 100644 --- a/packages/pdk-nag/.npmignore +++ b/packages/pdk-nag/.npmignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.projen/ /test-reports/ junit.xml diff --git a/packages/pdk-nag/.prettierignore b/packages/pdk-nag/.prettierignore index 46704c733..17fe1524d 100644 --- a/packages/pdk-nag/.prettierignore +++ b/packages/pdk-nag/.prettierignore @@ -1 +1 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". diff --git a/packages/pdk-nag/.projen/deps.json b/packages/pdk-nag/.projen/deps.json index e7964cbba..13bdd094f 100644 --- a/packages/pdk-nag/.projen/deps.json +++ b/packages/pdk-nag/.projen/deps.json @@ -31,18 +31,10 @@ "version": "^6", "type": "build" }, - { - "name": "aws-cdk-lib", - "type": "build" - }, { "name": "cdk-nag", "type": "build" }, - { - "name": "constructs", - "type": "build" - }, { "name": "eslint-config-prettier", "type": "build" @@ -203,5 +195,5 @@ "type": "peer" } ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pdk-nag/.projen/files.json b/packages/pdk-nag/.projen/files.json index ba598efa6..026057b8c 100644 --- a/packages/pdk-nag/.projen/files.json +++ b/packages/pdk-nag/.projen/files.json @@ -13,5 +13,5 @@ "README.md", "tsconfig.dev.json" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pdk-nag/.projen/tasks.json b/packages/pdk-nag/.projen/tasks.json index 201343586..4b8ac5d47 100644 --- a/packages/pdk-nag/.projen/tasks.json +++ b/packages/pdk-nag/.projen/tasks.json @@ -194,5 +194,5 @@ "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")", "JSII_SUPPRESS_UPGRADE_PROMPT": "true" }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pdk-nag/package.json b/packages/pdk-nag/package.json index 7763b8e95..8d7fbe72f 100644 --- a/packages/pdk-nag/package.json +++ b/packages/pdk-nag/package.json @@ -147,5 +147,5 @@ "rootDir": "src" } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pdk-nag/project.json b/packages/pdk-nag/project.json index af60a87e0..f8a34a862 100644 --- a/packages/pdk-nag/project.json +++ b/packages/pdk-nag/project.json @@ -143,5 +143,5 @@ } } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pdk-nag/tsconfig.dev.json b/packages/pdk-nag/tsconfig.dev.json index e089892d4..34c20ba31 100644 --- a/packages/pdk-nag/tsconfig.dev.json +++ b/packages/pdk-nag/tsconfig.dev.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "compilerOptions": { "alwaysStrict": true, diff --git a/packages/pdk/.gitattributes b/packages/pdk/.gitattributes index b308a81c3..7e3d01c65 100644 --- a/packages/pdk/.gitattributes +++ b/packages/pdk/.gitattributes @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.gitattributes linguist-generated /.gitignore linguist-generated diff --git a/packages/pdk/.gitignore b/packages/pdk/.gitignore index e881f8b20..73a7ce8cb 100644 --- a/packages/pdk/.gitignore +++ b/packages/pdk/.gitignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json diff --git a/packages/pdk/.npmignore b/packages/pdk/.npmignore index 8f746af5e..32638c3fc 100644 --- a/packages/pdk/.npmignore +++ b/packages/pdk/.npmignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.projen/ /test/ /tsconfig.dev.json diff --git a/packages/pdk/.prettierignore b/packages/pdk/.prettierignore index 46704c733..17fe1524d 100644 --- a/packages/pdk/.prettierignore +++ b/packages/pdk/.prettierignore @@ -1 +1 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". diff --git a/packages/pdk/.projen/deps.json b/packages/pdk/.projen/deps.json index e404bebd1..97282c227 100644 --- a/packages/pdk/.projen/deps.json +++ b/packages/pdk/.projen/deps.json @@ -492,5 +492,5 @@ "type": "runtime" } ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pdk/.projen/files.json b/packages/pdk/.projen/files.json index f43cc8fc2..06c26b9b4 100644 --- a/packages/pdk/.projen/files.json +++ b/packages/pdk/.projen/files.json @@ -12,5 +12,5 @@ "README.md", "tsconfig.dev.json" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pdk/.projen/tasks.json b/packages/pdk/.projen/tasks.json index 8264e15c8..d63975f87 100644 --- a/packages/pdk/.projen/tasks.json +++ b/packages/pdk/.projen/tasks.json @@ -397,5 +397,5 @@ "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")", "JSII_SUPPRESS_UPGRADE_PROMPT": "true" }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pdk/package.json b/packages/pdk/package.json index c1482fd3f..2ae5aa6eb 100644 --- a/packages/pdk/package.json +++ b/packages/pdk/package.json @@ -97,7 +97,7 @@ "prebuild": "^11.0.4", "prebuild-install": "^7.1.1", "prettier": "^2.8.8", - "projen": "^0.73", + "projen": "^0.76", "reregexp": "1.6.1", "tree-cli": "^0.6.7", "ts-command-line-args": "2.4.2", @@ -111,7 +111,7 @@ "aws-cdk-lib": "^2.93.0", "cdk-nag": "^2.27.115", "constructs": "^10.2.70", - "projen": "^0.73" + "projen": "^0.76" }, "dependencies": { "@hpcc-js/wasm": "^2.13.1", @@ -282,5 +282,5 @@ "**/scripts/**/*.ts" ] }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pdk/project.json b/packages/pdk/project.json index 52045c29b..80b5a857d 100644 --- a/packages/pdk/project.json +++ b/packages/pdk/project.json @@ -145,5 +145,5 @@ "@aws/pipeline", "@aws/infrastructure" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pdk/tsconfig.dev.json b/packages/pdk/tsconfig.dev.json index 0fe6f4cea..d451215f9 100644 --- a/packages/pdk/tsconfig.dev.json +++ b/packages/pdk/tsconfig.dev.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "compilerOptions": { "alwaysStrict": true, diff --git a/packages/pipeline/.eslintrc.json b/packages/pipeline/.eslintrc.json index a6612fa62..b03358ca7 100644 --- a/packages/pipeline/.eslintrc.json +++ b/packages/pipeline/.eslintrc.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "env": { "jest": true, diff --git a/packages/pipeline/.gitattributes b/packages/pipeline/.gitattributes index 288b08ffc..f7845f6e6 100644 --- a/packages/pipeline/.gitattributes +++ b/packages/pipeline/.gitattributes @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated diff --git a/packages/pipeline/.gitignore b/packages/pipeline/.gitignore index 106abe9a1..8ed77c7c0 100644 --- a/packages/pipeline/.gitignore +++ b/packages/pipeline/.gitignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json diff --git a/packages/pipeline/.npmignore b/packages/pipeline/.npmignore index ce1133297..5ae15d9ea 100644 --- a/packages/pipeline/.npmignore +++ b/packages/pipeline/.npmignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.projen/ /test-reports/ junit.xml diff --git a/packages/pipeline/.prettierignore b/packages/pipeline/.prettierignore index 46704c733..17fe1524d 100644 --- a/packages/pipeline/.prettierignore +++ b/packages/pipeline/.prettierignore @@ -1 +1 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". diff --git a/packages/pipeline/.projen/deps.json b/packages/pipeline/.projen/deps.json index 0cf0c0189..a72751dd6 100644 --- a/packages/pipeline/.projen/deps.json +++ b/packages/pipeline/.projen/deps.json @@ -192,5 +192,5 @@ "type": "runtime" } ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pipeline/.projen/files.json b/packages/pipeline/.projen/files.json index ba598efa6..026057b8c 100644 --- a/packages/pipeline/.projen/files.json +++ b/packages/pipeline/.projen/files.json @@ -13,5 +13,5 @@ "README.md", "tsconfig.dev.json" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pipeline/.projen/tasks.json b/packages/pipeline/.projen/tasks.json index cdce1e737..3072b19a7 100644 --- a/packages/pipeline/.projen/tasks.json +++ b/packages/pipeline/.projen/tasks.json @@ -194,5 +194,5 @@ "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")", "JSII_SUPPRESS_UPGRADE_PROMPT": "true" }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pipeline/package.json b/packages/pipeline/package.json index 855e7c23e..91b9fff41 100644 --- a/packages/pipeline/package.json +++ b/packages/pipeline/package.json @@ -51,7 +51,7 @@ "jsii-pacmak": "^1.88.0", "jsii-rosetta": "^1.88.0", "prettier": "^2.8.8", - "projen": "^0.73", + "projen": "^0.76", "ts-jest": "^29.1.1", "typescript": "^5.2.2" }, @@ -59,7 +59,7 @@ "aws-cdk-lib": "^2.93.0", "cdk-nag": "^2.27.115", "constructs": "^10.2.70", - "projen": "^0.73" + "projen": "^0.76" }, "dependencies": { "@aws/pdk-nag": "^0.x" @@ -152,5 +152,5 @@ "rootDir": "src" } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pipeline/project.json b/packages/pipeline/project.json index 821b2abcc..30498c311 100644 --- a/packages/pipeline/project.json +++ b/packages/pipeline/project.json @@ -143,5 +143,5 @@ } } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/pipeline/src/codepipeline-props.ts b/packages/pipeline/src/codepipeline-props.ts index 60e0d8d25..2b05fcb6a 100644 --- a/packages/pipeline/src/codepipeline-props.ts +++ b/packages/pipeline/src/codepipeline-props.ts @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". import { aws_codepipeline, aws_iam, aws_s3, pipelines } from 'aws-cdk-lib'; /** diff --git a/packages/pipeline/tsconfig.dev.json b/packages/pipeline/tsconfig.dev.json index 3bd367166..0123e6e26 100644 --- a/packages/pipeline/tsconfig.dev.json +++ b/packages/pipeline/tsconfig.dev.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "compilerOptions": { "alwaysStrict": true, diff --git a/packages/static-website/.eslintrc.json b/packages/static-website/.eslintrc.json index 90bbec1be..0ffa1f968 100644 --- a/packages/static-website/.eslintrc.json +++ b/packages/static-website/.eslintrc.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "env": { "jest": true, diff --git a/packages/static-website/.gitattributes b/packages/static-website/.gitattributes index a8b955d61..3bd5cb360 100644 --- a/packages/static-website/.gitattributes +++ b/packages/static-website/.gitattributes @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated diff --git a/packages/static-website/.gitignore b/packages/static-website/.gitignore index d705d6e3a..d415e121c 100644 --- a/packages/static-website/.gitignore +++ b/packages/static-website/.gitignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json diff --git a/packages/static-website/.npmignore b/packages/static-website/.npmignore index ce1133297..5ae15d9ea 100644 --- a/packages/static-website/.npmignore +++ b/packages/static-website/.npmignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.projen/ /test-reports/ junit.xml diff --git a/packages/static-website/.prettierignore b/packages/static-website/.prettierignore index 46704c733..17fe1524d 100644 --- a/packages/static-website/.prettierignore +++ b/packages/static-website/.prettierignore @@ -1 +1 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". diff --git a/packages/static-website/.projen/deps.json b/packages/static-website/.projen/deps.json index 51034f41b..d483a986a 100644 --- a/packages/static-website/.projen/deps.json +++ b/packages/static-website/.projen/deps.json @@ -196,5 +196,5 @@ "type": "runtime" } ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/static-website/.projen/files.json b/packages/static-website/.projen/files.json index ba598efa6..026057b8c 100644 --- a/packages/static-website/.projen/files.json +++ b/packages/static-website/.projen/files.json @@ -13,5 +13,5 @@ "README.md", "tsconfig.dev.json" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/static-website/.projen/tasks.json b/packages/static-website/.projen/tasks.json index 51ad47792..6857e0e0d 100644 --- a/packages/static-website/.projen/tasks.json +++ b/packages/static-website/.projen/tasks.json @@ -191,5 +191,5 @@ "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")", "JSII_SUPPRESS_UPGRADE_PROMPT": "true" }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/static-website/package.json b/packages/static-website/package.json index 90c9c558e..fcbbf88f8 100644 --- a/packages/static-website/package.json +++ b/packages/static-website/package.json @@ -52,7 +52,7 @@ "jsii-pacmak": "^1.88.0", "jsii-rosetta": "^1.88.0", "prettier": "^2.8.8", - "projen": "^0.73", + "projen": "^0.76", "ts-jest": "^29.1.1", "typescript": "^5.2.2" }, @@ -60,7 +60,7 @@ "aws-cdk-lib": "^2.93.0", "cdk-nag": "^2.27.115", "constructs": "^10.2.70", - "projen": "^0.73" + "projen": "^0.76" }, "dependencies": { "@aws/pdk-nag": "^0.x" @@ -153,5 +153,5 @@ "rootDir": "src" } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/static-website/project.json b/packages/static-website/project.json index b216a18f0..ef222d266 100644 --- a/packages/static-website/project.json +++ b/packages/static-website/project.json @@ -143,5 +143,5 @@ } } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/static-website/src/bucket-deployment-props.ts b/packages/static-website/src/bucket-deployment-props.ts index e33d844cd..6b33eb906 100644 --- a/packages/static-website/src/bucket-deployment-props.ts +++ b/packages/static-website/src/bucket-deployment-props.ts @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". import { aws_cloudfront, aws_ec2, aws_iam, aws_logs, aws_s3, aws_s3_deployment, Expiration, Size } from 'aws-cdk-lib'; /** diff --git a/packages/static-website/src/distribution-props.ts b/packages/static-website/src/distribution-props.ts index e32015c5f..5c4fc84bd 100644 --- a/packages/static-website/src/distribution-props.ts +++ b/packages/static-website/src/distribution-props.ts @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". import { aws_certificatemanager, aws_cloudfront, aws_s3 } from 'aws-cdk-lib'; /** diff --git a/packages/static-website/tsconfig.dev.json b/packages/static-website/tsconfig.dev.json index 3bd367166..0123e6e26 100644 --- a/packages/static-website/tsconfig.dev.json +++ b/packages/static-website/tsconfig.dev.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "compilerOptions": { "alwaysStrict": true, diff --git a/packages/type-safe-api/.eslintrc.json b/packages/type-safe-api/.eslintrc.json index d1fd63bbe..1ca988b48 100644 --- a/packages/type-safe-api/.eslintrc.json +++ b/packages/type-safe-api/.eslintrc.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "env": { "jest": true, diff --git a/packages/type-safe-api/.gitattributes b/packages/type-safe-api/.gitattributes index 4c454e1f8..da8df9e7c 100644 --- a/packages/type-safe-api/.gitattributes +++ b/packages/type-safe-api/.gitattributes @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated diff --git a/packages/type-safe-api/.gitignore b/packages/type-safe-api/.gitignore index 5477c8aa2..1be2af4a6 100644 --- a/packages/type-safe-api/.gitignore +++ b/packages/type-safe-api/.gitignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json diff --git a/packages/type-safe-api/.npmignore b/packages/type-safe-api/.npmignore index ce1133297..5ae15d9ea 100644 --- a/packages/type-safe-api/.npmignore +++ b/packages/type-safe-api/.npmignore @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". /.projen/ /test-reports/ junit.xml diff --git a/packages/type-safe-api/.prettierignore b/packages/type-safe-api/.prettierignore index 46704c733..17fe1524d 100644 --- a/packages/type-safe-api/.prettierignore +++ b/packages/type-safe-api/.prettierignore @@ -1 +1 @@ -# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". diff --git a/packages/type-safe-api/.projen/deps.json b/packages/type-safe-api/.projen/deps.json index 7b1bdcd90..87c61730e 100644 --- a/packages/type-safe-api/.projen/deps.json +++ b/packages/type-safe-api/.projen/deps.json @@ -258,5 +258,5 @@ "type": "runtime" } ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/type-safe-api/.projen/files.json b/packages/type-safe-api/.projen/files.json index ba598efa6..026057b8c 100644 --- a/packages/type-safe-api/.projen/files.json +++ b/packages/type-safe-api/.projen/files.json @@ -13,5 +13,5 @@ "README.md", "tsconfig.dev.json" ], - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/type-safe-api/.projen/tasks.json b/packages/type-safe-api/.projen/tasks.json index 7801badab..d8f2d651e 100644 --- a/packages/type-safe-api/.projen/tasks.json +++ b/packages/type-safe-api/.projen/tasks.json @@ -194,5 +194,5 @@ "PATH": "$(pnpm -c exec \"node --print process.env.PATH\")", "JSII_SUPPRESS_UPGRADE_PROMPT": "true" }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/type-safe-api/package.json b/packages/type-safe-api/package.json index ab2d49acd..2df980290 100644 --- a/packages/type-safe-api/package.json +++ b/packages/type-safe-api/package.json @@ -65,7 +65,7 @@ "jsii-pacmak": "^1.88.0", "jsii-rosetta": "^1.88.0", "prettier": "^2.8.8", - "projen": "^0.73", + "projen": "^0.76", "reregexp": "1.6.1", "ts-command-line-args": "2.4.2", "ts-jest": "^29.1.1", @@ -75,7 +75,7 @@ "aws-cdk-lib": "^2.93.0", "cdk-nag": "^2.27.115", "constructs": "^10.2.70", - "projen": "^0.73" + "projen": "^0.76" }, "dependencies": { "@aws/monorepo": "^0.x", @@ -199,5 +199,5 @@ "rootDir": "src" } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/type-safe-api/project.json b/packages/type-safe-api/project.json index 8c5a04999..2854f9165 100644 --- a/packages/type-safe-api/project.json +++ b/packages/type-safe-api/project.json @@ -143,5 +143,5 @@ } } }, - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"pnpm exec projen\"." } diff --git a/packages/type-safe-api/src/project/codegen/handlers/generated-typescript-handlers-project.ts b/packages/type-safe-api/src/project/codegen/handlers/generated-typescript-handlers-project.ts index 5fad23cb7..3a9279070 100644 --- a/packages/type-safe-api/src/project/codegen/handlers/generated-typescript-handlers-project.ts +++ b/packages/type-safe-api/src/project/codegen/handlers/generated-typescript-handlers-project.ts @@ -145,6 +145,8 @@ export class GeneratedTypescriptHandlersProject extends TypeScriptProject { case NodePackageManager.NPM: case NodePackageManager.YARN: case NodePackageManager.YARN2: + case NodePackageManager.YARN_CLASSIC: + case NodePackageManager.YARN_BERRY: this.tasks .tryFind("install") ?.prependExec( diff --git a/packages/type-safe-api/src/project/codegen/infrastructure/cdk/generated-typescript-cdk-infrastructure-project.ts b/packages/type-safe-api/src/project/codegen/infrastructure/cdk/generated-typescript-cdk-infrastructure-project.ts index f253423ce..b11bb831f 100644 --- a/packages/type-safe-api/src/project/codegen/infrastructure/cdk/generated-typescript-cdk-infrastructure-project.ts +++ b/packages/type-safe-api/src/project/codegen/infrastructure/cdk/generated-typescript-cdk-infrastructure-project.ts @@ -159,6 +159,8 @@ export class GeneratedTypescriptCdkInfrastructureProject extends TypeScriptProje case NodePackageManager.NPM: case NodePackageManager.YARN: case NodePackageManager.YARN2: + case NodePackageManager.YARN_CLASSIC: + case NodePackageManager.YARN_BERRY: this.tasks .tryFind("install") ?.prependExec( diff --git a/packages/type-safe-api/src/project/codegen/library/typescript-react-query-hooks-library.ts b/packages/type-safe-api/src/project/codegen/library/typescript-react-query-hooks-library.ts index 644924346..1bffe88f5 100644 --- a/packages/type-safe-api/src/project/codegen/library/typescript-react-query-hooks-library.ts +++ b/packages/type-safe-api/src/project/codegen/library/typescript-react-query-hooks-library.ts @@ -138,6 +138,8 @@ export class TypescriptReactQueryHooksLibrary extends TypeScriptProject { case NodePackageManager.NPM: case NodePackageManager.YARN: case NodePackageManager.YARN2: + case NodePackageManager.YARN_CLASSIC: + case NodePackageManager.YARN_BERRY: this.tasks .tryFind("install") ?.exec( diff --git a/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts b/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts index 1ab68e1db..d61d62d09 100644 --- a/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts +++ b/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts @@ -136,6 +136,8 @@ export class GeneratedTypescriptRuntimeProject extends TypeScriptProject { case NodePackageManager.NPM: case NodePackageManager.YARN: case NodePackageManager.YARN2: + case NodePackageManager.YARN_CLASSIC: + case NodePackageManager.YARN_BERRY: this.tasks .tryFind("install") ?.exec( diff --git a/packages/type-safe-api/src/project/java-project-options.ts b/packages/type-safe-api/src/project/java-project-options.ts index 90d93ed6e..2b6c1771e 100644 --- a/packages/type-safe-api/src/project/java-project-options.ts +++ b/packages/type-safe-api/src/project/java-project-options.ts @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". import { github, GitOptions, IgnoreFileOptions, java, LoggerOptions, Project, ProjectType, ProjenrcJsonOptions, RenovatebotOptions, SampleReadmeProps } from 'projen'; /** @@ -313,7 +313,7 @@ export interface JavaProjectOptions { * * If this project has a parent, this directory is relative to the parent * directory and it cannot be the same as the parent or any of it's other - * sub-projects. + * subprojects. * @default "." * @stability experimental */ diff --git a/packages/type-safe-api/src/project/python-project-options.ts b/packages/type-safe-api/src/project/python-project-options.ts index ad21226e2..2e0c34b90 100644 --- a/packages/type-safe-api/src/project/python-project-options.ts +++ b/packages/type-safe-api/src/project/python-project-options.ts @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". import { github, GitOptions, IgnoreFileOptions, LoggerOptions, Project, ProjectType, ProjenrcJsonOptions, python, RenovatebotOptions, SampleReadmeProps } from 'projen'; /** @@ -283,7 +283,7 @@ export interface PythonProjectOptions { * * If this project has a parent, this directory is relative to the parent * directory and it cannot be the same as the parent or any of it's other - * sub-projects. + * subprojects. * @default "." * @stability experimental */ diff --git a/packages/type-safe-api/src/project/type-safe-api-project.ts b/packages/type-safe-api/src/project/type-safe-api-project.ts index 574568800..416d4c525 100644 --- a/packages/type-safe-api/src/project/type-safe-api-project.ts +++ b/packages/type-safe-api/src/project/type-safe-api-project.ts @@ -264,7 +264,7 @@ export class TypeSafeApiProject extends Project { this.parent && ProjectUtils.isNamedInstanceOf(this.parent, NodeProject) ? this.parent.package.packageManager - : NodePackageManager.YARN, + : NodePackageManager.YARN_CLASSIC, ...options.runtime?.options?.typescript, }, pythonOptions: { @@ -326,7 +326,7 @@ export class TypeSafeApiProject extends Project { this.parent && ProjectUtils.isNamedInstanceOf(this.parent, NodeProject) ? this.parent.package.packageManager - : NodePackageManager.YARN, + : NodePackageManager.YARN_CLASSIC, ...options.library?.options?.typescriptReactQueryHooks, }, }); @@ -395,7 +395,7 @@ export class TypeSafeApiProject extends Project { this.parent && ProjectUtils.isNamedInstanceOf(this.parent, NodeProject) ? this.parent.package.packageManager - : NodePackageManager.YARN, + : NodePackageManager.YARN_CLASSIC, ...options.handlers?.options?.typescript, }, pythonOptions: { @@ -469,7 +469,7 @@ export class TypeSafeApiProject extends Project { this.parent && ProjectUtils.isNamedInstanceOf(this.parent, NodeProject) ? this.parent.package.packageManager - : NodePackageManager.YARN, + : NodePackageManager.YARN_CLASSIC, ...options.infrastructure.options?.typescript, }, pythonOptions: { diff --git a/packages/type-safe-api/src/project/typescript-project-options.ts b/packages/type-safe-api/src/project/typescript-project-options.ts index 7b5079bb6..5082d5557 100644 --- a/packages/type-safe-api/src/project/typescript-project-options.ts +++ b/packages/type-safe-api/src/project/typescript-project-options.ts @@ -1,5 +1,5 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". -import { github, GitOptions, IgnoreFileOptions, javascript, LoggerOptions, Project, ProjectType, ProjenrcJsonOptions, ReleasableCommits, release, RenovatebotOptions, SampleReadmeProps, typescript } from 'projen'; +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". +import { github, GitOptions, GroupRunnerOptions, IgnoreFileOptions, javascript, LoggerOptions, Project, ProjectType, ProjenrcJsonOptions, ReleasableCommits, release, RenovatebotOptions, SampleReadmeProps, typescript } from 'projen'; /** * TypeScriptProjectOptions @@ -341,10 +341,19 @@ export interface TypeScriptProjectOptions { * @stability experimental */ readonly defaultReleaseBranch?: string; + /** + * Github Runner Group selection options. + * @stability experimental + * @description Defines a target Runner Group by name and/or labels + * @throws {Error} if both `runsOn` and `runsOnGroup` are specified + */ + readonly workflowRunsOnGroup?: GroupRunnerOptions; /** * Github Runner selection labels. * @default ["ubuntu-latest"] * @stability experimental + * @description Defines a target Runner by labels + * @throws {Error} if both `runsOn` and `runsOnGroup` are specified */ readonly workflowRunsOn?: Array; /** @@ -562,7 +571,7 @@ export interface TypeScriptProjectOptions { readonly packageName?: string; /** * The Node Package Manager used to execute scripts. - * @default NodePackageManager.YARN + * @default NodePackageManager.YARN_CLASSIC * @stability experimental */ readonly packageManager?: javascript.NodePackageManager; @@ -907,7 +916,7 @@ export interface TypeScriptProjectOptions { * * If this project has a parent, this directory is relative to the parent * directory and it cannot be the same as the parent or any of it's other - * sub-projects. + * subprojects. * @default "." * @stability experimental */ diff --git a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap index 0d75afa01..b72eac9a9 100644 --- a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap +++ b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap @@ -2024,7 +2024,6 @@ dev-dependencies = { } /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -2067,7 +2066,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -2102,6 +2100,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -2139,7 +2142,6 @@ tsconfig.esm.json ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".projen/deps.json", ".projen/files.json", @@ -2273,13 +2275,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -2523,6 +2525,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -3079,7 +3082,6 @@ exports[`Type Safe Api Project Unit Tests OpenApi With java Infra in Monorepo 1` /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -3132,7 +3134,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -3198,6 +3199,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -3230,7 +3236,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -3293,7 +3299,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -3500,13 +3505,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -3840,6 +3845,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -6201,7 +6207,6 @@ dev-dependencies = { } /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -6245,7 +6250,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -6281,6 +6285,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -6443,13 +6452,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -6693,6 +6702,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -9233,7 +9243,6 @@ dev-dependencies = { } /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -9276,7 +9285,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -9311,6 +9319,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -9348,7 +9361,6 @@ tsconfig.esm.json ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".projen/deps.json", ".projen/files.json", @@ -9482,13 +9494,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -9732,6 +9744,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -10288,7 +10301,6 @@ exports[`Type Safe Api Project Unit Tests OpenApi With python Infra in Monorepo /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -10341,7 +10353,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -10407,6 +10418,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -10439,7 +10455,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -10502,7 +10518,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -10709,13 +10724,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -11049,6 +11064,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -13309,7 +13325,6 @@ dev-dependencies = { } /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -13353,7 +13368,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -13389,6 +13403,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -13551,13 +13570,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -13801,6 +13820,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -15039,7 +15059,6 @@ This directory contains a generated type-safe CDK construct which will can the A /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -15084,7 +15103,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -15133,6 +15151,11 @@ mocks "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -15175,7 +15198,6 @@ mocks ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".openapi-generator-ignore-handlebars", ".projen/deps.json", @@ -15260,7 +15282,7 @@ mocks "name": "install", "steps": [ { - "exec": "yarn link openapi-typescript-typescript-runtime", + "exec": "yarn_classic link openapi-typescript-typescript-runtime", }, { "exec": "yarn install --check-files", @@ -15320,13 +15342,13 @@ mocks "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/aws-lambda @types/node npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @types/aws-lambda @types/node constructs npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -15572,6 +15594,7 @@ mocks "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -16643,7 +16666,6 @@ dev-dependencies = { } /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -16686,7 +16708,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -16721,6 +16742,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -16758,7 +16784,6 @@ tsconfig.esm.json ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".projen/deps.json", ".projen/files.json", @@ -16892,13 +16917,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -17142,6 +17167,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -17698,7 +17724,6 @@ exports[`Type Safe Api Project Unit Tests OpenApi With typescript Infra in Monor /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -17751,7 +17776,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -17817,6 +17841,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -17849,7 +17878,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -17912,7 +17941,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -18119,13 +18147,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -18459,6 +18487,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -19270,7 +19299,6 @@ This directory contains a generated type-safe CDK construct which will can the A /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -19315,7 +19343,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -19364,6 +19391,11 @@ mocks "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -19540,13 +19572,13 @@ mocks "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs,openapi-typescript-typescript-runtime", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,openapi-typescript-typescript-runtime", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/aws-lambda @types/node npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag constructs openapi-typescript-typescript-runtime", + "exec": "yarn upgrade @types/aws-lambda @types/node constructs npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag openapi-typescript-typescript-runtime", }, { "exec": "npx projen", @@ -19792,6 +19824,7 @@ mocks "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -21012,7 +21045,6 @@ dev-dependencies = { } /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -21056,7 +21088,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -21092,6 +21123,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -21254,13 +21290,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -21504,6 +21540,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -22314,7 +22351,6 @@ This directory contains a generated type-safe CDK construct which will can the A /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -22359,7 +22395,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -22408,6 +22443,11 @@ mocks "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -22450,7 +22490,6 @@ mocks ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".openapi-generator-ignore-handlebars", ".projen/deps.json", @@ -22535,7 +22574,7 @@ mocks "name": "install", "steps": [ { - "exec": "yarn link smithy-handlers-typescript-runtime", + "exec": "yarn_classic link smithy-handlers-typescript-runtime", }, { "exec": "yarn install --check-files", @@ -22595,13 +22634,13 @@ mocks "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/aws-lambda @types/node npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @types/aws-lambda @types/node constructs npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -22847,6 +22886,7 @@ mocks "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -23918,7 +23958,6 @@ dev-dependencies = { } /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -23961,7 +24000,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -23996,6 +24034,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -24033,7 +24076,6 @@ tsconfig.esm.json ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".projen/deps.json", ".projen/files.json", @@ -24167,13 +24209,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -24417,6 +24459,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -25660,7 +25703,6 @@ dev-dependencies = { } /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -25708,7 +25750,6 @@ jspm_packages/ /test-reports/ junit.xml /coverage/ -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -25766,6 +25807,11 @@ junit.xml "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "esbuild", "type": "build", @@ -25827,7 +25873,6 @@ junit.xml ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".openapi-generator-ignore-handlebars", ".projen/deps.json", @@ -25912,7 +25957,7 @@ junit.xml "name": "install", "steps": [ { - "exec": "yarn link smithy-handlers-typescript-runtime", + "exec": "yarn_classic link smithy-handlers-typescript-runtime", }, { "exec": "yarn install --check-files", @@ -25999,13 +26044,13 @@ junit.xml "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,esbuild,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,esbuild,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/aws-lambda @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser esbuild eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", + "exec": "yarn upgrade @types/aws-lambda @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs esbuild eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", }, { "exec": "npx projen", @@ -26250,6 +26295,7 @@ junit.xml "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "esbuild": "*", "eslint": "^8", "eslint-import-resolver-node": "*", @@ -27028,7 +27074,6 @@ This directory contains a generated type-safe CDK construct which will can the A /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -27073,7 +27118,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -27122,6 +27166,11 @@ mocks "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -27164,7 +27213,6 @@ mocks ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".openapi-generator-ignore-handlebars", ".projen/deps.json", @@ -27249,7 +27297,7 @@ mocks "name": "install", "steps": [ { - "exec": "yarn link smithy-typescript-react-query-hooks-typescript-runtime", + "exec": "yarn_classic link smithy-typescript-react-query-hooks-typescript-runtime", }, { "exec": "yarn install --check-files", @@ -27309,13 +27357,13 @@ mocks "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/aws-lambda @types/node npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @types/aws-lambda @types/node constructs npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -27561,6 +27609,7 @@ mocks "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -27752,7 +27801,6 @@ This directory contains generated libraries based on your API model.", /.gitattributes linguist-generated /.gitignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -27796,7 +27844,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -27837,6 +27884,11 @@ tsconfig.esm.json "name": "@types/react", "type": "build", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -27870,7 +27922,6 @@ tsconfig.esm.json "files": [ ".gitattributes", ".gitignore", - ".npmrc", ".openapi-generator-ignore", ".openapi-generator-ignore-handlebars", ".projen/deps.json", @@ -28005,13 +28056,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,@types/react,npm-check-updates,projen,react,typescript,@tanstack/react-query", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,@types/react,constructs,npm-check-updates,projen,react,typescript,@tanstack/react-query", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node @types/react npm-check-updates projen react typescript @tanstack/react-query", + "exec": "yarn upgrade @types/node @types/react constructs npm-check-updates projen react typescript @tanstack/react-query", }, { "exec": "npx projen", @@ -28253,6 +28304,7 @@ tsconfig.esm.json "devDependencies": { "@types/node": "^16", "@types/react": "*", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "react": "*", @@ -28365,7 +28417,6 @@ Each runtime project includes types from your API model, as well as type-safe cl /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -28408,7 +28459,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -28443,6 +28493,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -28480,7 +28535,6 @@ tsconfig.esm.json ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".projen/deps.json", ".projen/files.json", @@ -28614,13 +28668,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -28864,6 +28918,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -31325,7 +31380,6 @@ dev-dependencies = { } /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -31368,7 +31422,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -31403,6 +31456,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -31440,7 +31498,6 @@ tsconfig.esm.json ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".projen/deps.json", ".projen/files.json", @@ -31574,13 +31631,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -31824,6 +31881,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -32473,7 +32531,6 @@ exports[`Type Safe Api Project Unit Tests Smithy With java Infra in Monorepo 1`] /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -32526,7 +32583,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -32592,6 +32648,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -32624,7 +32685,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -32687,7 +32748,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -32894,13 +32954,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -33234,6 +33294,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -35595,7 +35656,6 @@ dev-dependencies = { } /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -35639,7 +35699,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -35675,6 +35734,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -35837,13 +35901,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -36087,6 +36151,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -37410,7 +37475,6 @@ This directory contains a generated type-safe CDK construct which will can the A /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -37455,7 +37519,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -37504,6 +37567,11 @@ mocks "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -37546,7 +37614,6 @@ mocks ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".openapi-generator-ignore-handlebars", ".projen/deps.json", @@ -37691,13 +37758,13 @@ mocks "exec": "npm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag", }, { "exec": "npm install", }, { - "exec": "npm update @types/aws-lambda @types/node npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag constructs", + "exec": "npm update @types/aws-lambda @types/node constructs npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -37943,6 +38010,7 @@ mocks "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -38137,7 +38205,6 @@ Each runtime project includes types from your API model, as well as type-safe cl /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -38180,7 +38247,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -38215,6 +38281,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -38252,7 +38323,6 @@ tsconfig.esm.json ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".projen/deps.json", ".projen/files.json", @@ -38386,13 +38456,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -38636,6 +38706,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -39285,7 +39356,6 @@ exports[`Type Safe Api Project Unit Tests Smithy With npm Package Manager in Mon /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -39338,7 +39408,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -39404,6 +39473,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -39436,7 +39510,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -39499,7 +39573,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -39698,13 +39771,13 @@ tsconfig.tsbuildinfo "exec": "npm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "npm install", }, { - "exec": "npm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "npm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -40038,6 +40111,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -40845,7 +40919,6 @@ This directory contains a generated type-safe CDK construct which will can the A /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -40890,7 +40963,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -40939,6 +41011,11 @@ mocks "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -41115,13 +41192,13 @@ mocks "exec": "npm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs,smithy-npm-typescript-runtime", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,smithy-npm-typescript-runtime", }, { "exec": "npm install", }, { - "exec": "npm update @types/aws-lambda @types/node npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag constructs smithy-npm-typescript-runtime", + "exec": "npm update @types/aws-lambda @types/node constructs npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag smithy-npm-typescript-runtime", }, { "exec": "npx projen", @@ -41367,6 +41444,7 @@ mocks "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -41560,7 +41638,6 @@ Each runtime project includes types from your API model, as well as type-safe cl /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -41604,7 +41681,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -41640,6 +41716,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -41802,13 +41883,13 @@ tsconfig.esm.json "exec": "npm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "npm install", }, { - "exec": "npm update @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "npm update @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -42052,6 +42133,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -43473,6 +43555,11 @@ resolution-mode=highest "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -43660,13 +43747,13 @@ resolution-mode=highest "exec": "pnpm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag", }, { "exec": "pnpm i --no-frozen-lockfile", }, { - "exec": "pnpm update @types/aws-lambda @types/node npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag constructs", + "exec": "pnpm update @types/aws-lambda @types/node constructs npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -43912,6 +43999,7 @@ resolution-mode=highest "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -44107,7 +44195,6 @@ Each runtime project includes types from your API model, as well as type-safe cl /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -44150,7 +44237,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -44185,6 +44271,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -44222,7 +44313,6 @@ tsconfig.esm.json ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".projen/deps.json", ".projen/files.json", @@ -44356,13 +44446,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -44606,6 +44696,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -45249,7 +45340,7 @@ exports[`Type Safe Api Project Unit Tests Smithy With pnpm Package Manager in Mo }, }, }, - ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated @@ -45274,7 +45365,7 @@ exports[`Type Safe Api Project Unit Tests Smithy With pnpm Package Manager in Mo /pnpm-workspace.yaml linguist-generated /tsconfig.dev.json linguist-generated /tsconfig.json linguist-generated", - ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json @@ -45326,7 +45417,7 @@ jspm_packages/ !/packages/api/generated/infrastructure/README.md !/pnpm-workspace.yaml ", - ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". /.projen/ /test/ /tsconfig.dev.json @@ -45343,22 +45434,22 @@ dist tsconfig.tsbuildinfo /.eslintrc.json ", - ".npmrc": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".npmrc": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". resolution-mode=highest ", - ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". .tmp .env .pytest_cache ", - ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". ", ".prettierrc.json": { "overrides": [], }, ".projen/deps.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencies": [ { "name": "@aws/pdk", @@ -45380,6 +45471,11 @@ resolution-mode=highest "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -45412,7 +45508,7 @@ resolution-mode=highest { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -45469,7 +45565,7 @@ resolution-mode=highest ], }, ".projen/files.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "files": [ ".eslintrc.json", ".gitattributes", @@ -45494,7 +45590,7 @@ resolution-mode=highest ], }, ".projen/tasks.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "env": { "PATH": "$(pnpm -c exec "node --print process.env.PATH")", }, @@ -45675,13 +45771,13 @@ resolution-mode=highest "exec": "pnpm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "pnpm i --no-frozen-lockfile", }, { - "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "pnpm exec projen", @@ -45721,7 +45817,7 @@ resolution-mode=highest }, }, ".syncpackrc.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencyTypes": [], "dev": true, "filter": ".", @@ -45957,7 +46053,7 @@ resolution-mode=highest ", "README.md": "# replace this", "nx.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "affected": { "defaultBase": "main", }, @@ -46004,7 +46100,7 @@ resolution-mode=highest }, }, "package.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencies": { "aws-cdk-lib": "*", "cdk-nag": "*", @@ -46015,6 +46111,7 @@ resolution-mode=highest "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -46919,6 +47016,11 @@ mocks "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -47095,13 +47197,13 @@ mocks "exec": "pnpm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs,smithy-pnpm-typescript-runtime", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,smithy-pnpm-typescript-runtime", }, { "exec": "pnpm i --no-frozen-lockfile", }, { - "exec": "pnpm update @types/aws-lambda @types/node npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag constructs smithy-pnpm-typescript-runtime", + "exec": "pnpm update @types/aws-lambda @types/node constructs npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag smithy-pnpm-typescript-runtime", }, { "exec": "npx projen", @@ -47347,6 +47449,7 @@ mocks "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -47621,6 +47724,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -47783,13 +47891,13 @@ tsconfig.esm.json "exec": "pnpm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "pnpm i --no-frozen-lockfile", }, { - "exec": "pnpm update @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "pnpm update @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -48033,6 +48141,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -48733,7 +48842,7 @@ structure NotAuthorizedError { }, }, }, - "pnpm-workspace.yaml": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + "pnpm-workspace.yaml": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". packages: - packages/api @@ -50679,7 +50788,6 @@ dev-dependencies = { } /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -50722,7 +50830,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -50757,6 +50864,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -50794,7 +50906,6 @@ tsconfig.esm.json ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".projen/deps.json", ".projen/files.json", @@ -50928,13 +51039,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -51178,6 +51289,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -51827,7 +51939,6 @@ exports[`Type Safe Api Project Unit Tests Smithy With python Infra in Monorepo 1 /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -51880,7 +51991,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -51946,6 +52056,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -51978,7 +52093,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -52041,7 +52156,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -52248,13 +52362,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -52588,6 +52702,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -54848,7 +54963,6 @@ dev-dependencies = { } /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -54892,7 +55006,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -54928,6 +55041,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -55090,13 +55208,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -55340,6 +55458,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -56671,7 +56790,6 @@ This directory contains a generated type-safe CDK construct which will can the A /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -56716,7 +56834,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -56765,6 +56882,11 @@ mocks "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -56807,7 +56929,6 @@ mocks ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".openapi-generator-ignore-handlebars", ".projen/deps.json", @@ -56892,7 +57013,7 @@ mocks "name": "install", "steps": [ { - "exec": "yarn link smithy-typescript-typescript-runtime", + "exec": "yarn_classic link smithy-typescript-typescript-runtime", }, { "exec": "yarn install --check-files", @@ -56952,13 +57073,13 @@ mocks "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/aws-lambda @types/node npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @types/aws-lambda @types/node constructs npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -57204,6 +57325,7 @@ mocks "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -58275,7 +58397,6 @@ dev-dependencies = { } /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -58318,7 +58439,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -58353,6 +58473,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -58390,7 +58515,6 @@ tsconfig.esm.json ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".projen/deps.json", ".projen/files.json", @@ -58524,13 +58648,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -58774,6 +58898,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -59423,7 +59548,6 @@ exports[`Type Safe Api Project Unit Tests Smithy With typescript Infra in Monore /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -59476,7 +59600,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -59542,6 +59665,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -59574,7 +59702,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -59637,7 +59765,6 @@ tsconfig.tsbuildinfo ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -59844,13 +59971,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -60184,6 +60311,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -60995,7 +61123,6 @@ This directory contains a generated type-safe CDK construct which will can the A /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -61040,7 +61167,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -61089,6 +61215,11 @@ mocks "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -61265,13 +61396,13 @@ mocks "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs,smithy-typescript-typescript-runtime", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,smithy-typescript-typescript-runtime", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/aws-lambda @types/node npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag constructs smithy-typescript-typescript-runtime", + "exec": "yarn upgrade @types/aws-lambda @types/node constructs npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag smithy-typescript-typescript-runtime", }, { "exec": "npx projen", @@ -61517,6 +61648,7 @@ mocks "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -62737,7 +62869,6 @@ dev-dependencies = { } /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -62781,7 +62912,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -62817,6 +62947,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -62979,13 +63114,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -63229,6 +63364,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -64006,7 +64142,7 @@ structure NotAuthorizedError { } `; -exports[`Type Safe Api Project Unit Tests Smithy With yarn Package Manager 1`] = ` +exports[`Type Safe Api Project Unit Tests Smithy With yarn_berry Package Manager 1`] = ` { ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". node_modules/ @@ -64552,7 +64688,6 @@ This directory contains a generated type-safe CDK construct which will can the A /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -64597,7 +64732,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -64646,6 +64780,11 @@ mocks "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -64676,7 +64815,7 @@ mocks "type": "runtime", }, { - "name": "smithy-yarn-typescript-runtime", + "name": "smithy-yarn-berry-typescript-runtime", "type": "runtime", "version": "file:../../runtime/typescript", }, @@ -64688,7 +64827,6 @@ mocks ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".openapi-generator-ignore-handlebars", ".projen/deps.json", @@ -64755,7 +64893,7 @@ mocks "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.clean-openapi-generated-code --code-path .", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript-cdk-infrastructure --src-dir src --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --extra-vendor-extensions '{"x-runtime-package-name":"smithy-yarn-typescript-runtime","x-relative-spec-path":"../assets/api.json","x-enable-mock-integrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":""}' --generate-alias-as-model", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript-cdk-infrastructure --src-dir src --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --extra-vendor-extensions '{"x-runtime-package-name":"smithy-yarn-berry-typescript-runtime","x-relative-spec-path":"../assets/api.json","x-enable-mock-integrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":""}' --generate-alias-as-model", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", @@ -64773,10 +64911,10 @@ mocks "name": "install", "steps": [ { - "exec": "yarn link smithy-yarn-typescript-runtime", + "exec": "yarn_berry link smithy-yarn-berry-typescript-runtime", }, { - "exec": "yarn install --check-files", + "exec": "yarn install", }, ], }, @@ -64785,7 +64923,7 @@ mocks "name": "install:ci", "steps": [ { - "exec": "yarn install --check-files --frozen-lockfile", + "exec": "yarn install --immutable", }, ], }, @@ -64833,13 +64971,13 @@ mocks "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag", }, { - "exec": "yarn install --check-files", + "exec": "yarn install", }, { - "exec": "yarn upgrade @types/aws-lambda @types/node npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @types/aws-lambda @types/node constructs npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -65080,11 +65218,12 @@ mocks "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", - "smithy-yarn-typescript-runtime": "file:../../runtime/typescript", + "smithy-yarn-berry-typescript-runtime": "file:../../runtime/typescript", }, "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -65112,8 +65251,8 @@ mocks "generated/infrastructure/typescript/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "implicitDependencies": [ - "smithy-yarn-typescript-runtime", - "smithy-yarn-model", + "smithy-yarn-berry-typescript-runtime", + "smithy-yarn_berry-model", ], "name": "my-ts-infra", "root": "generated/infrastructure/typescript", @@ -65121,77 +65260,77 @@ mocks "build": { "executor": "nx:run-commands", "options": { - "command": "yarn projen build", + "command": "yarn exec projen build", "cwd": "generated/infrastructure/typescript", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "yarn projen compile", + "command": "yarn exec projen compile", "cwd": "generated/infrastructure/typescript", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "yarn projen default", + "command": "yarn exec projen default", "cwd": "generated/infrastructure/typescript", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "yarn projen generate", + "command": "yarn exec projen generate", "cwd": "generated/infrastructure/typescript", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "yarn projen package", + "command": "yarn exec projen package", "cwd": "generated/infrastructure/typescript", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn projen post-compile", + "command": "yarn exec projen post-compile", "cwd": "generated/infrastructure/typescript", }, }, "post-upgrade": { "executor": "nx:run-commands", "options": { - "command": "yarn projen post-upgrade", + "command": "yarn exec projen post-upgrade", "cwd": "generated/infrastructure/typescript", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn projen pre-compile", + "command": "yarn exec projen pre-compile", "cwd": "generated/infrastructure/typescript", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "yarn projen test", + "command": "yarn exec projen test", "cwd": "generated/infrastructure/typescript", }, }, "upgrade": { "executor": "nx:run-commands", "options": { - "command": "yarn projen upgrade", + "command": "yarn exec projen upgrade", "cwd": "generated/infrastructure/typescript", }, }, "watch": { "executor": "nx:run-commands", "options": { - "command": "yarn projen watch", + "command": "yarn exec projen watch", "cwd": "generated/infrastructure/typescript", }, }, @@ -65279,7 +65418,6 @@ Each runtime project includes types from your API model, as well as type-safe cl /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -65322,7 +65460,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -65357,6 +65494,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -65394,7 +65536,6 @@ tsconfig.esm.json ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".projen/deps.json", ".projen/files.json", @@ -65459,7 +65600,7 @@ tsconfig.esm.json "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.clean-openapi-generated-code --code-path .", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript --src-dir src --additional-properties "npmName=smithy-yarn-typescript-runtime,typescriptThreePlus=true,useSingleParameter=true,supportsES6=true" --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --generate-alias-as-model", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript --src-dir src --additional-properties "npmName=smithy-yarn-berry-typescript-runtime,typescriptThreePlus=true,useSingleParameter=true,supportsES6=true" --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --generate-alias-as-model", }, ], }, @@ -65528,13 +65669,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -65778,13 +65919,14 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", }, "license": "Apache-2.0", "main": "lib/index.js", - "name": "smithy-yarn-typescript-runtime", + "name": "smithy-yarn-berry-typescript-runtime", "scripts": { "build": "npx projen build", "compile": "npx projen compile", @@ -65962,7 +66104,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn_berry-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn_berry-model/openapi/model/model.json", }, ], }, @@ -66163,7 +66305,7 @@ structure handler { ", "model/settings.gradle": "// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". -rootProject.name = 'smithy-yarn-model' +rootProject.name = 'smithy-yarn_berry-model' ", "model/smithy-build.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", @@ -66279,7 +66421,7 @@ structure NotAuthorizedError { } `; -exports[`Type Safe Api Project Unit Tests Smithy With yarn Package Manager in Monorepo 1`] = ` +exports[`Type Safe Api Project Unit Tests Smithy With yarn_berry Package Manager in Monorepo 1`] = ` { ".eslintrc.json": { "env": { @@ -66421,13 +66563,12 @@ exports[`Type Safe Api Project Unit Tests Smithy With yarn Package Manager in Mo }, }, }, - ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -66445,7 +66586,7 @@ exports[`Type Safe Api Project Unit Tests Smithy With yarn Package Manager in Mo /tsconfig.dev.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", - ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json @@ -66480,7 +66621,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -66491,12 +66631,16 @@ jspm_packages/ .nx/cache !/nx.json !/.nxignore +.yarn/* +.pnp.cjs +!.yarn/releases +!.yarn/plugins !/.syncpackrc.json !/packages/api/generated/runtime/README.md !/packages/api/generated/documentation/README.md !/packages/api/generated/infrastructure/README.md ", - ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen". /.projen/ /test/ /tsconfig.dev.json @@ -66513,18 +66657,18 @@ dist tsconfig.tsbuildinfo /.eslintrc.json ", - ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen". .tmp .env .pytest_cache ", - ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen". ", ".prettierrc.json": { "overrides": [], }, ".projen/deps.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "dependencies": [ { "name": "@aws/pdk", @@ -66546,6 +66690,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -66578,7 +66727,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -66635,13 +66784,12 @@ tsconfig.tsbuildinfo ], }, ".projen/files.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "files": [ ".eslintrc.json", ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -66659,7 +66807,7 @@ tsconfig.tsbuildinfo ], }, ".projen/tasks.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "env": { "PATH": "$(npx -c "node --print process.env.PATH")", }, @@ -66669,7 +66817,7 @@ tsconfig.tsbuildinfo "name": "build", "steps": [ { - "exec": "yarn nx run-many --target=build --output-style=stream --nx-bail", + "exec": "yarn exec nx run-many --target=build --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -66711,7 +66859,7 @@ tsconfig.tsbuildinfo "name": "compile", "steps": [ { - "exec": "yarn nx run-many --target=compile --output-style=stream --nx-bail", + "exec": "yarn exec nx run-many --target=compile --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -66742,7 +66890,7 @@ tsconfig.tsbuildinfo "name": "eslint", "steps": [ { - "exec": "yarn nx run-many --target=eslint --output-style=stream --nx-bail", + "exec": "yarn exec nx run-many --target=eslint --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -66752,7 +66900,7 @@ tsconfig.tsbuildinfo "name": "graph", "steps": [ { - "exec": "yarn nx graph", + "exec": "yarn exec nx graph", "receiveArgs": true, }, ], @@ -66762,7 +66910,7 @@ tsconfig.tsbuildinfo "name": "install", "steps": [ { - "exec": "yarn install --check-files", + "exec": "yarn install", }, ], }, @@ -66771,7 +66919,7 @@ tsconfig.tsbuildinfo "name": "install:ci", "steps": [ { - "exec": "yarn install --check-files --frozen-lockfile", + "exec": "yarn install --immutable", }, ], }, @@ -66780,7 +66928,7 @@ tsconfig.tsbuildinfo "name": "package", "steps": [ { - "exec": "yarn nx run-many --target=package --output-style=stream --nx-bail", + "exec": "yarn exec nx run-many --target=package --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -66790,7 +66938,7 @@ tsconfig.tsbuildinfo "name": "post-compile", "steps": [ { - "exec": "yarn nx run-many --target=post-compile --output-style=stream --nx-bail", + "exec": "yarn exec nx run-many --target=post-compile --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -66804,7 +66952,7 @@ tsconfig.tsbuildinfo "name": "pre-compile", "steps": [ { - "exec": "yarn nx run-many --target=pre-compile --output-style=stream --nx-bail", + "exec": "yarn exec nx run-many --target=pre-compile --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -66814,7 +66962,7 @@ tsconfig.tsbuildinfo "name": "run-many", "steps": [ { - "exec": "yarn nx run-many", + "exec": "yarn exec nx run-many", "receiveArgs": true, }, ], @@ -66824,7 +66972,7 @@ tsconfig.tsbuildinfo "name": "test", "steps": [ { - "exec": "yarn nx run-many --target=test --output-style=stream --nx-bail", + "exec": "yarn exec nx run-many --target=test --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -66840,16 +66988,16 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { - "exec": "yarn install --check-files", + "exec": "yarn install", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { - "exec": "yarn projen", + "exec": "yarn exec projen", }, { "spawn": "post-upgrade", @@ -66860,16 +67008,16 @@ tsconfig.tsbuildinfo "name": "upgrade-deps", "steps": [ { - "exec": "yarn npm-check-updates --deep --rejectVersion 0.0.0 -u --dep prod,dev,peer,optional,bundle --target=minor", + "exec": "yarn exec npm-check-updates --deep --rejectVersion 0.0.0 -u --dep prod,dev,peer,optional,bundle --target=minor", }, { - "exec": "yarn syncpack fix-mismatches", + "exec": "yarn exec syncpack fix-mismatches", }, { "exec": "yarn install", }, { - "exec": "yarn projen", + "exec": "yarn exec projen", }, ], }, @@ -66878,7 +67026,7 @@ tsconfig.tsbuildinfo "name": "watch", "steps": [ { - "exec": "yarn nx run-many --target=watch --output-style=stream --skip-nx-cache --nx-ignore-cycles --nx-bail", + "exec": "yarn exec nx run-many --target=watch --output-style=stream --skip-nx-cache --nx-ignore-cycles --nx-bail", "receiveArgs": true, }, ], @@ -66886,7 +67034,7 @@ tsconfig.tsbuildinfo }, }, ".syncpackrc.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "dependencyTypes": [], "dev": true, "filter": ".", @@ -67122,7 +67270,7 @@ tsconfig.tsbuildinfo ", "README.md": "# replace this", "nx.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "affected": { "defaultBase": "main", }, @@ -67169,7 +67317,7 @@ tsconfig.tsbuildinfo }, }, "package.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "dependencies": { "aws-cdk-lib": "*", "cdk-nag": "*", @@ -67180,6 +67328,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -67196,7 +67345,7 @@ tsconfig.tsbuildinfo }, "engines": { "node": ">=16", - "yarn": ">=1 <2", + "yarn": ">=2", }, "license": "Apache-2.0", "main": "lib/index.js", @@ -67211,24 +67360,24 @@ tsconfig.tsbuildinfo "wrap-ansi": "^7.0.0", }, "scripts": { - "build": "yarn projen build", - "clobber": "yarn projen clobber", - "compile": "yarn projen compile", - "default": "yarn projen default", - "eject": "yarn projen eject", - "eslint": "yarn projen eslint", - "graph": "yarn projen graph", - "install:ci": "yarn projen install:ci", - "package": "yarn projen package", - "post-compile": "yarn projen post-compile", - "post-upgrade": "yarn projen post-upgrade", - "pre-compile": "yarn projen pre-compile", - "run-many": "yarn projen run-many", - "synth-workspace": "yarn projen", - "test": "yarn projen test", - "upgrade": "yarn projen upgrade", - "upgrade-deps": "yarn projen upgrade-deps", - "watch": "yarn projen watch", + "build": "yarn exec projen build", + "clobber": "yarn exec projen clobber", + "compile": "yarn exec projen compile", + "default": "yarn exec projen default", + "eject": "yarn exec projen eject", + "eslint": "yarn exec projen eslint", + "graph": "yarn exec projen graph", + "install:ci": "yarn exec projen install:ci", + "package": "yarn exec projen package", + "post-compile": "yarn exec projen post-compile", + "post-upgrade": "yarn exec projen post-upgrade", + "pre-compile": "yarn exec projen pre-compile", + "run-many": "yarn exec projen run-many", + "synth-workspace": "yarn exec projen", + "test": "yarn exec projen test", + "upgrade": "yarn exec projen upgrade", + "upgrade-deps": "yarn exec projen upgrade-deps", + "watch": "yarn exec projen watch", }, "types": "lib/index.d.ts", "version": "0.0.0", @@ -67424,64 +67573,64 @@ index.html "packages/api/generated/documentation/html2/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "implicitDependencies": [ - "smithy-yarn-model", + "smithy-yarn_berry-model", ], - "name": "smithy-yarn-documentation-html2", + "name": "smithy-yarn_berry-documentation-html2", "root": "packages/api/generated/documentation/html2", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "npx projen build", + "command": "yarn dlx projen build", "cwd": "packages/api/generated/documentation/html2", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen compile", + "command": "yarn dlx projen compile", "cwd": "packages/api/generated/documentation/html2", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "npx projen default", + "command": "yarn dlx projen default", "cwd": "packages/api/generated/documentation/html2", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "npx projen generate", + "command": "yarn dlx projen generate", "cwd": "packages/api/generated/documentation/html2", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "npx projen package", + "command": "yarn dlx projen package", "cwd": "packages/api/generated/documentation/html2", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen post-compile", + "command": "yarn dlx projen post-compile", "cwd": "packages/api/generated/documentation/html2", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen pre-compile", + "command": "yarn dlx projen pre-compile", "cwd": "packages/api/generated/documentation/html2", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "npx projen test", + "command": "yarn dlx projen test", "cwd": "packages/api/generated/documentation/html2", }, }, @@ -67587,64 +67736,64 @@ index.html "packages/api/generated/documentation/html_redoc/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "implicitDependencies": [ - "smithy-yarn-model", + "smithy-yarn_berry-model", ], - "name": "smithy-yarn-documentation-html-redoc", + "name": "smithy-yarn_berry-documentation-html-redoc", "root": "packages/api/generated/documentation/html_redoc", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "npx projen build", + "command": "yarn dlx projen build", "cwd": "packages/api/generated/documentation/html_redoc", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen compile", + "command": "yarn dlx projen compile", "cwd": "packages/api/generated/documentation/html_redoc", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "npx projen default", + "command": "yarn dlx projen default", "cwd": "packages/api/generated/documentation/html_redoc", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "npx projen generate", + "command": "yarn dlx projen generate", "cwd": "packages/api/generated/documentation/html_redoc", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "npx projen package", + "command": "yarn dlx projen package", "cwd": "packages/api/generated/documentation/html_redoc", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen post-compile", + "command": "yarn dlx projen post-compile", "cwd": "packages/api/generated/documentation/html_redoc", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen pre-compile", + "command": "yarn dlx projen pre-compile", "cwd": "packages/api/generated/documentation/html_redoc", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "npx projen test", + "command": "yarn dlx projen test", "cwd": "packages/api/generated/documentation/html_redoc", }, }, @@ -67753,64 +67902,64 @@ README.md "packages/api/generated/documentation/markdown/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "implicitDependencies": [ - "smithy-yarn-model", + "smithy-yarn_berry-model", ], - "name": "smithy-yarn-documentation-markdown", + "name": "smithy-yarn_berry-documentation-markdown", "root": "packages/api/generated/documentation/markdown", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "npx projen build", + "command": "yarn dlx projen build", "cwd": "packages/api/generated/documentation/markdown", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen compile", + "command": "yarn dlx projen compile", "cwd": "packages/api/generated/documentation/markdown", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "npx projen default", + "command": "yarn dlx projen default", "cwd": "packages/api/generated/documentation/markdown", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "npx projen generate", + "command": "yarn dlx projen generate", "cwd": "packages/api/generated/documentation/markdown", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "npx projen package", + "command": "yarn dlx projen package", "cwd": "packages/api/generated/documentation/markdown", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen post-compile", + "command": "yarn dlx projen post-compile", "cwd": "packages/api/generated/documentation/markdown", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen pre-compile", + "command": "yarn dlx projen pre-compile", "cwd": "packages/api/generated/documentation/markdown", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "npx projen test", + "command": "yarn dlx projen test", "cwd": "packages/api/generated/documentation/markdown", }, }, @@ -67917,64 +68066,64 @@ schemas.plantuml "packages/api/generated/documentation/plantuml/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "implicitDependencies": [ - "smithy-yarn-model", + "smithy-yarn_berry-model", ], - "name": "smithy-yarn-documentation-plantuml", + "name": "smithy-yarn_berry-documentation-plantuml", "root": "packages/api/generated/documentation/plantuml", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "npx projen build", + "command": "yarn dlx projen build", "cwd": "packages/api/generated/documentation/plantuml", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen compile", + "command": "yarn dlx projen compile", "cwd": "packages/api/generated/documentation/plantuml", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "npx projen default", + "command": "yarn dlx projen default", "cwd": "packages/api/generated/documentation/plantuml", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "npx projen generate", + "command": "yarn dlx projen generate", "cwd": "packages/api/generated/documentation/plantuml", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "npx projen package", + "command": "yarn dlx projen package", "cwd": "packages/api/generated/documentation/plantuml", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen post-compile", + "command": "yarn dlx projen post-compile", "cwd": "packages/api/generated/documentation/plantuml", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen pre-compile", + "command": "yarn dlx projen pre-compile", "cwd": "packages/api/generated/documentation/plantuml", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "npx projen test", + "command": "yarn dlx projen test", "cwd": "packages/api/generated/documentation/plantuml", }, }, @@ -67988,7 +68137,6 @@ This directory contains a generated type-safe CDK construct which will can the A /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -68033,7 +68181,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -68082,6 +68229,11 @@ mocks "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -68112,7 +68264,7 @@ mocks "type": "runtime", }, { - "name": "smithy-yarn-typescript-runtime", + "name": "smithy-yarn-berry-typescript-runtime", "type": "runtime", }, ], @@ -68183,7 +68335,7 @@ mocks "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.clean-openapi-generated-code --code-path .", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript-cdk-infrastructure --src-dir src --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --extra-vendor-extensions '{"x-runtime-package-name":"smithy-yarn-typescript-runtime","x-relative-spec-path":"../assets/api.json","x-enable-mock-integrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":""}' --generate-alias-as-model", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript-cdk-infrastructure --src-dir src --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --extra-vendor-extensions '{"x-runtime-package-name":"smithy-yarn-berry-typescript-runtime","x-relative-spec-path":"../assets/api.json","x-enable-mock-integrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":""}' --generate-alias-as-model", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", @@ -68201,7 +68353,7 @@ mocks "name": "install", "steps": [ { - "exec": "yarn install --check-files", + "exec": "yarn install", }, ], }, @@ -68210,7 +68362,7 @@ mocks "name": "install:ci", "steps": [ { - "exec": "yarn install --check-files --frozen-lockfile", + "exec": "yarn install --immutable", }, ], }, @@ -68258,13 +68410,13 @@ mocks "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs,smithy-yarn-typescript-runtime", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,smithy-yarn-berry-typescript-runtime", }, { - "exec": "yarn install --check-files", + "exec": "yarn install", }, { - "exec": "yarn upgrade @types/aws-lambda @types/node npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag constructs smithy-yarn-typescript-runtime", + "exec": "yarn upgrade @types/aws-lambda @types/node constructs npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag smithy-yarn-berry-typescript-runtime", }, { "exec": "npx projen", @@ -68505,18 +68657,19 @@ mocks "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", - "smithy-yarn-typescript-runtime": "*", + "smithy-yarn-berry-typescript-runtime": "*", }, "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", }, "license": "Apache-2.0", "main": "lib/index.js", - "name": "smithy-yarn-typescript-infra", + "name": "smithy-yarn-berry-typescript-infra", "scripts": { "build": "npx projen build", "compile": "npx projen compile", @@ -68536,86 +68689,86 @@ mocks "packages/api/generated/infrastructure/typescript/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "implicitDependencies": [ - "smithy-yarn-typescript-runtime", - "smithy-yarn-model", + "smithy-yarn-berry-typescript-runtime", + "smithy-yarn_berry-model", ], - "name": "smithy-yarn-typescript-infra", + "name": "smithy-yarn-berry-typescript-infra", "root": "packages/api/generated/infrastructure/typescript", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "yarn projen build", + "command": "yarn exec projen build", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "yarn projen compile", + "command": "yarn exec projen compile", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "yarn projen default", + "command": "yarn exec projen default", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "yarn projen generate", + "command": "yarn exec projen generate", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "yarn projen package", + "command": "yarn exec projen package", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn projen post-compile", + "command": "yarn exec projen post-compile", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "post-upgrade": { "executor": "nx:run-commands", "options": { - "command": "yarn projen post-upgrade", + "command": "yarn exec projen post-upgrade", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn projen pre-compile", + "command": "yarn exec projen pre-compile", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "yarn projen test", + "command": "yarn exec projen test", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "upgrade": { "executor": "nx:run-commands", "options": { - "command": "yarn projen upgrade", + "command": "yarn exec projen upgrade", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "watch": { "executor": "nx:run-commands", "options": { - "command": "yarn projen watch", + "command": "yarn exec projen watch", "cwd": "packages/api/generated/infrastructure/typescript", }, }, @@ -68703,7 +68856,6 @@ Each runtime project includes types from your API model, as well as type-safe cl /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -68747,7 +68899,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -68783,6 +68934,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -68879,7 +69035,7 @@ tsconfig.esm.json "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.clean-openapi-generated-code --code-path .", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript --src-dir src --additional-properties "npmName=smithy-yarn-typescript-runtime,typescriptThreePlus=true,useSingleParameter=true,supportsES6=true" --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --generate-alias-as-model", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript --src-dir src --additional-properties "npmName=smithy-yarn-berry-typescript-runtime,typescriptThreePlus=true,useSingleParameter=true,supportsES6=true" --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --generate-alias-as-model", }, ], }, @@ -68888,7 +69044,7 @@ tsconfig.esm.json "name": "install", "steps": [ { - "exec": "yarn install --check-files", + "exec": "yarn install", }, ], }, @@ -68897,7 +69053,7 @@ tsconfig.esm.json "name": "install:ci", "steps": [ { - "exec": "yarn install --check-files --frozen-lockfile", + "exec": "yarn install --immutable", }, ], }, @@ -68945,13 +69101,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { - "exec": "yarn install --check-files", + "exec": "yarn install", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -69195,13 +69351,14 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", }, "license": "Apache-2.0", "main": "lib/index.js", - "name": "smithy-yarn-typescript-runtime", + "name": "smithy-yarn-berry-typescript-runtime", "scripts": { "build": "npx projen build", "compile": "npx projen compile", @@ -69221,85 +69378,85 @@ tsconfig.esm.json "packages/api/generated/runtime/typescript/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "implicitDependencies": [ - "smithy-yarn-model", + "smithy-yarn_berry-model", ], - "name": "smithy-yarn-typescript-runtime", + "name": "smithy-yarn-berry-typescript-runtime", "root": "packages/api/generated/runtime/typescript", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "yarn projen build", + "command": "yarn exec projen build", "cwd": "packages/api/generated/runtime/typescript", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "yarn projen compile", + "command": "yarn exec projen compile", "cwd": "packages/api/generated/runtime/typescript", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "yarn projen default", + "command": "yarn exec projen default", "cwd": "packages/api/generated/runtime/typescript", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "yarn projen generate", + "command": "yarn exec projen generate", "cwd": "packages/api/generated/runtime/typescript", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "yarn projen package", + "command": "yarn exec projen package", "cwd": "packages/api/generated/runtime/typescript", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn projen post-compile", + "command": "yarn exec projen post-compile", "cwd": "packages/api/generated/runtime/typescript", }, }, "post-upgrade": { "executor": "nx:run-commands", "options": { - "command": "yarn projen post-upgrade", + "command": "yarn exec projen post-upgrade", "cwd": "packages/api/generated/runtime/typescript", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn projen pre-compile", + "command": "yarn exec projen pre-compile", "cwd": "packages/api/generated/runtime/typescript", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "yarn projen test", + "command": "yarn exec projen test", "cwd": "packages/api/generated/runtime/typescript", }, }, "upgrade": { "executor": "nx:run-commands", "options": { - "command": "yarn projen upgrade", + "command": "yarn exec projen upgrade", "cwd": "packages/api/generated/runtime/typescript", }, }, "watch": { "executor": "nx:run-commands", "options": { - "command": "yarn projen watch", + "command": "yarn exec projen watch", "cwd": "packages/api/generated/runtime/typescript", }, }, @@ -69461,7 +69618,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn_berry-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn_berry-model/openapi/model/model.json", }, ], }, @@ -69663,69 +69820,69 @@ structure handler { ", "packages/api/model/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", - "name": "smithy-yarn-model", + "name": "smithy-yarn_berry-model", "root": "packages/api/model", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "npx projen build", + "command": "yarn dlx projen build", "cwd": "packages/api/model", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen compile", + "command": "yarn dlx projen compile", "cwd": "packages/api/model", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "npx projen default", + "command": "yarn dlx projen default", "cwd": "packages/api/model", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "npx projen generate", + "command": "yarn dlx projen generate", "cwd": "packages/api/model", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "npx projen package", + "command": "yarn dlx projen package", "cwd": "packages/api/model", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen post-compile", + "command": "yarn dlx projen post-compile", "cwd": "packages/api/model", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen pre-compile", + "command": "yarn dlx projen pre-compile", "cwd": "packages/api/model", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "npx projen test", + "command": "yarn dlx projen test", "cwd": "packages/api/model", }, }, }, }, "packages/api/model/settings.gradle": "// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". -rootProject.name = 'smithy-yarn-model' +rootProject.name = 'smithy-yarn_berry-model' ", "packages/api/model/smithy-build.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", @@ -69840,55 +69997,55 @@ structure NotAuthorizedError { ", "packages/api/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", - "name": "smithy-yarn", + "name": "smithy-yarn_berry", "root": "packages/api", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "npx projen build", + "command": "yarn dlx projen build", "cwd": "packages/api", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen compile", + "command": "yarn dlx projen compile", "cwd": "packages/api", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "npx projen default", + "command": "yarn dlx projen default", "cwd": "packages/api", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "npx projen package", + "command": "yarn dlx projen package", "cwd": "packages/api", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen post-compile", + "command": "yarn dlx projen post-compile", "cwd": "packages/api", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "npx projen pre-compile", + "command": "yarn dlx projen pre-compile", "cwd": "packages/api", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "npx projen test", + "command": "yarn dlx projen test", "cwd": "packages/api", }, }, @@ -69972,7 +70129,7 @@ structure NotAuthorizedError { } `; -exports[`Type Safe Api Project Unit Tests Smithy With yarn2 Package Manager 1`] = ` +exports[`Type Safe Api Project Unit Tests Smithy With yarn_classic Package Manager 1`] = ` { ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". node_modules/ @@ -70518,7 +70675,6 @@ This directory contains a generated type-safe CDK construct which will can the A /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -70563,7 +70719,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -70612,6 +70767,11 @@ mocks "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -70642,7 +70802,7 @@ mocks "type": "runtime", }, { - "name": "smithy-yarn2-typescript-runtime", + "name": "smithy-yarn-classic-typescript-runtime", "type": "runtime", "version": "file:../../runtime/typescript", }, @@ -70654,7 +70814,6 @@ mocks ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".openapi-generator-ignore-handlebars", ".projen/deps.json", @@ -70721,7 +70880,7 @@ mocks "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.clean-openapi-generated-code --code-path .", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript-cdk-infrastructure --src-dir src --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --extra-vendor-extensions '{"x-runtime-package-name":"smithy-yarn2-typescript-runtime","x-relative-spec-path":"../assets/api.json","x-enable-mock-integrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":""}' --generate-alias-as-model", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript-cdk-infrastructure --src-dir src --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --extra-vendor-extensions '{"x-runtime-package-name":"smithy-yarn-classic-typescript-runtime","x-relative-spec-path":"../assets/api.json","x-enable-mock-integrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":""}' --generate-alias-as-model", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", @@ -70739,10 +70898,10 @@ mocks "name": "install", "steps": [ { - "exec": "yarn2 link smithy-yarn2-typescript-runtime", + "exec": "yarn_classic link smithy-yarn-classic-typescript-runtime", }, { - "exec": "yarn install", + "exec": "yarn install --check-files", }, ], }, @@ -70751,7 +70910,7 @@ mocks "name": "install:ci", "steps": [ { - "exec": "yarn install --immutable", + "exec": "yarn install --check-files --frozen-lockfile", }, ], }, @@ -70799,13 +70958,13 @@ mocks "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag", }, { - "exec": "yarn install", + "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/aws-lambda @types/node npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @types/aws-lambda @types/node constructs npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -71046,11 +71205,12 @@ mocks "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", - "smithy-yarn2-typescript-runtime": "file:../../runtime/typescript", + "smithy-yarn-classic-typescript-runtime": "file:../../runtime/typescript", }, "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", @@ -71078,8 +71238,8 @@ mocks "generated/infrastructure/typescript/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "implicitDependencies": [ - "smithy-yarn2-typescript-runtime", - "smithy-yarn2-model", + "smithy-yarn-classic-typescript-runtime", + "smithy-yarn_classic-model", ], "name": "my-ts-infra", "root": "generated/infrastructure/typescript", @@ -71087,77 +71247,77 @@ mocks "build": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen build", + "command": "yarn projen build", "cwd": "generated/infrastructure/typescript", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen compile", + "command": "yarn projen compile", "cwd": "generated/infrastructure/typescript", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen default", + "command": "yarn projen default", "cwd": "generated/infrastructure/typescript", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen generate", + "command": "yarn projen generate", "cwd": "generated/infrastructure/typescript", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen package", + "command": "yarn projen package", "cwd": "generated/infrastructure/typescript", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen post-compile", + "command": "yarn projen post-compile", "cwd": "generated/infrastructure/typescript", }, }, "post-upgrade": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen post-upgrade", + "command": "yarn projen post-upgrade", "cwd": "generated/infrastructure/typescript", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen pre-compile", + "command": "yarn projen pre-compile", "cwd": "generated/infrastructure/typescript", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen test", + "command": "yarn projen test", "cwd": "generated/infrastructure/typescript", }, }, "upgrade": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen upgrade", + "command": "yarn projen upgrade", "cwd": "generated/infrastructure/typescript", }, }, "watch": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen watch", + "command": "yarn projen watch", "cwd": "generated/infrastructure/typescript", }, }, @@ -71245,7 +71405,6 @@ Each runtime project includes types from your API model, as well as type-safe cl /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -71288,7 +71447,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -71323,6 +71481,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -71360,7 +71523,6 @@ tsconfig.esm.json ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".projen/deps.json", ".projen/files.json", @@ -71425,7 +71587,7 @@ tsconfig.esm.json "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.clean-openapi-generated-code --code-path .", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript --src-dir src --additional-properties "npmName=smithy-yarn2-typescript-runtime,typescriptThreePlus=true,useSingleParameter=true,supportsES6=true" --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --generate-alias-as-model", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript --src-dir src --additional-properties "npmName=smithy-yarn-classic-typescript-runtime,typescriptThreePlus=true,useSingleParameter=true,supportsES6=true" --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --generate-alias-as-model", }, ], }, @@ -71494,13 +71656,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -71744,13 +71906,14 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", }, "license": "Apache-2.0", "main": "lib/index.js", - "name": "smithy-yarn2-typescript-runtime", + "name": "smithy-yarn-classic-typescript-runtime", "scripts": { "build": "npx projen build", "compile": "npx projen compile", @@ -71928,7 +72091,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn2-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn2-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn_classic-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn_classic-model/openapi/model/model.json", }, ], }, @@ -72129,7 +72292,7 @@ structure handler { ", "model/settings.gradle": "// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". -rootProject.name = 'smithy-yarn2-model' +rootProject.name = 'smithy-yarn_classic-model' ", "model/smithy-build.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", @@ -72245,7 +72408,7 @@ structure NotAuthorizedError { } `; -exports[`Type Safe Api Project Unit Tests Smithy With yarn2 Package Manager in Monorepo 1`] = ` +exports[`Type Safe Api Project Unit Tests Smithy With yarn_classic Package Manager in Monorepo 1`] = ` { ".eslintrc.json": { "env": { @@ -72387,13 +72550,12 @@ exports[`Type Safe Api Project Unit Tests Smithy With yarn2 Package Manager in M }, }, }, - ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen". /.eslintrc.json linguist-generated /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.nxignore linguist-generated /.prettierignore linguist-generated /.prettierrc.json linguist-generated @@ -72411,7 +72573,7 @@ exports[`Type Safe Api Project Unit Tests Smithy With yarn2 Package Manager in M /tsconfig.dev.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", - ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json @@ -72446,7 +72608,6 @@ jspm_packages/ !/.projenrc.js !/.prettierignore !/.prettierrc.json -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -72457,16 +72618,12 @@ jspm_packages/ .nx/cache !/nx.json !/.nxignore -.yarn/* -.pnp.cjs -!.yarn/releases -!.yarn/plugins !/.syncpackrc.json !/packages/api/generated/runtime/README.md !/packages/api/generated/documentation/README.md !/packages/api/generated/infrastructure/README.md ", - ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen". /.projen/ /test/ /tsconfig.dev.json @@ -72483,18 +72640,18 @@ dist tsconfig.tsbuildinfo /.eslintrc.json ", - ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen". .tmp .env .pytest_cache ", - ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen". ", ".prettierrc.json": { "overrides": [], }, ".projen/deps.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "dependencies": [ { "name": "@aws/pdk", @@ -72516,6 +72673,11 @@ tsconfig.tsbuildinfo "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "eslint-config-prettier", "type": "build", @@ -72548,7 +72710,7 @@ tsconfig.tsbuildinfo { "name": "nx", "type": "build", - "version": "16.0.0", + "version": "^16", }, { "name": "prettier", @@ -72605,13 +72767,12 @@ tsconfig.tsbuildinfo ], }, ".projen/files.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "files": [ ".eslintrc.json", ".gitattributes", ".gitignore", ".npmignore", - ".npmrc", ".nxignore", ".prettierignore", ".prettierrc.json", @@ -72629,7 +72790,7 @@ tsconfig.tsbuildinfo ], }, ".projen/tasks.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "env": { "PATH": "$(npx -c "node --print process.env.PATH")", }, @@ -72639,7 +72800,7 @@ tsconfig.tsbuildinfo "name": "build", "steps": [ { - "exec": "yarn exec nx run-many --target=build --output-style=stream --nx-bail", + "exec": "yarn nx run-many --target=build --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -72681,7 +72842,7 @@ tsconfig.tsbuildinfo "name": "compile", "steps": [ { - "exec": "yarn exec nx run-many --target=compile --output-style=stream --nx-bail", + "exec": "yarn nx run-many --target=compile --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -72712,7 +72873,7 @@ tsconfig.tsbuildinfo "name": "eslint", "steps": [ { - "exec": "yarn exec nx run-many --target=eslint --output-style=stream --nx-bail", + "exec": "yarn nx run-many --target=eslint --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -72722,7 +72883,7 @@ tsconfig.tsbuildinfo "name": "graph", "steps": [ { - "exec": "yarn exec nx graph", + "exec": "yarn nx graph", "receiveArgs": true, }, ], @@ -72732,7 +72893,7 @@ tsconfig.tsbuildinfo "name": "install", "steps": [ { - "exec": "yarn install", + "exec": "yarn install --check-files", }, ], }, @@ -72741,7 +72902,7 @@ tsconfig.tsbuildinfo "name": "install:ci", "steps": [ { - "exec": "yarn install --immutable", + "exec": "yarn install --check-files --frozen-lockfile", }, ], }, @@ -72750,7 +72911,7 @@ tsconfig.tsbuildinfo "name": "package", "steps": [ { - "exec": "yarn exec nx run-many --target=package --output-style=stream --nx-bail", + "exec": "yarn nx run-many --target=package --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -72760,7 +72921,7 @@ tsconfig.tsbuildinfo "name": "post-compile", "steps": [ { - "exec": "yarn exec nx run-many --target=post-compile --output-style=stream --nx-bail", + "exec": "yarn nx run-many --target=post-compile --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -72774,7 +72935,7 @@ tsconfig.tsbuildinfo "name": "pre-compile", "steps": [ { - "exec": "yarn exec nx run-many --target=pre-compile --output-style=stream --nx-bail", + "exec": "yarn nx run-many --target=pre-compile --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -72784,7 +72945,7 @@ tsconfig.tsbuildinfo "name": "run-many", "steps": [ { - "exec": "yarn exec nx run-many", + "exec": "yarn nx run-many", "receiveArgs": true, }, ], @@ -72794,7 +72955,7 @@ tsconfig.tsbuildinfo "name": "test", "steps": [ { - "exec": "yarn exec nx run-many --target=test --output-style=stream --nx-bail", + "exec": "yarn nx run-many --target=test --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -72810,16 +72971,16 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,prettier,projen,syncpack,ts-node,typescript,nx,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { - "exec": "yarn install", + "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates prettier projen syncpack ts-node typescript nx aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { - "exec": "yarn exec projen", + "exec": "yarn projen", }, { "spawn": "post-upgrade", @@ -72830,16 +72991,16 @@ tsconfig.tsbuildinfo "name": "upgrade-deps", "steps": [ { - "exec": "yarn exec npm-check-updates --deep --rejectVersion 0.0.0 -u --dep prod,dev,peer,optional,bundle --target=minor", + "exec": "yarn npm-check-updates --deep --rejectVersion 0.0.0 -u --dep prod,dev,peer,optional,bundle --target=minor", }, { - "exec": "yarn exec syncpack fix-mismatches", + "exec": "yarn syncpack fix-mismatches", }, { "exec": "yarn install", }, { - "exec": "yarn exec projen", + "exec": "yarn projen", }, ], }, @@ -72848,7 +73009,7 @@ tsconfig.tsbuildinfo "name": "watch", "steps": [ { - "exec": "yarn exec nx run-many --target=watch --output-style=stream --skip-nx-cache --nx-ignore-cycles --nx-bail", + "exec": "yarn nx run-many --target=watch --output-style=stream --skip-nx-cache --nx-ignore-cycles --nx-bail", "receiveArgs": true, }, ], @@ -72856,7 +73017,7 @@ tsconfig.tsbuildinfo }, }, ".syncpackrc.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "dependencyTypes": [], "dev": true, "filter": ".", @@ -73092,7 +73253,7 @@ tsconfig.tsbuildinfo ", "README.md": "# replace this", "nx.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "affected": { "defaultBase": "main", }, @@ -73139,7 +73300,7 @@ tsconfig.tsbuildinfo }, }, "package.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "dependencies": { "aws-cdk-lib": "*", "cdk-nag": "*", @@ -73150,6 +73311,7 @@ tsconfig.tsbuildinfo "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "eslint": "^8", "eslint-config-prettier": "*", "eslint-import-resolver-node": "*", @@ -73166,7 +73328,7 @@ tsconfig.tsbuildinfo }, "engines": { "node": ">=16", - "yarn": ">=2", + "yarn": ">=1 <2", }, "license": "Apache-2.0", "main": "lib/index.js", @@ -73181,24 +73343,24 @@ tsconfig.tsbuildinfo "wrap-ansi": "^7.0.0", }, "scripts": { - "build": "yarn exec projen build", - "clobber": "yarn exec projen clobber", - "compile": "yarn exec projen compile", - "default": "yarn exec projen default", - "eject": "yarn exec projen eject", - "eslint": "yarn exec projen eslint", - "graph": "yarn exec projen graph", - "install:ci": "yarn exec projen install:ci", - "package": "yarn exec projen package", - "post-compile": "yarn exec projen post-compile", - "post-upgrade": "yarn exec projen post-upgrade", - "pre-compile": "yarn exec projen pre-compile", - "run-many": "yarn exec projen run-many", - "synth-workspace": "yarn exec projen", - "test": "yarn exec projen test", - "upgrade": "yarn exec projen upgrade", - "upgrade-deps": "yarn exec projen upgrade-deps", - "watch": "yarn exec projen watch", + "build": "yarn projen build", + "clobber": "yarn projen clobber", + "compile": "yarn projen compile", + "default": "yarn projen default", + "eject": "yarn projen eject", + "eslint": "yarn projen eslint", + "graph": "yarn projen graph", + "install:ci": "yarn projen install:ci", + "package": "yarn projen package", + "post-compile": "yarn projen post-compile", + "post-upgrade": "yarn projen post-upgrade", + "pre-compile": "yarn projen pre-compile", + "run-many": "yarn projen run-many", + "synth-workspace": "yarn projen", + "test": "yarn projen test", + "upgrade": "yarn projen upgrade", + "upgrade-deps": "yarn projen upgrade-deps", + "watch": "yarn projen watch", }, "types": "lib/index.d.ts", "version": "0.0.0", @@ -73394,64 +73556,64 @@ index.html "packages/api/generated/documentation/html2/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "implicitDependencies": [ - "smithy-yarn2-model", + "smithy-yarn_classic-model", ], - "name": "smithy-yarn2-documentation-html2", + "name": "smithy-yarn_classic-documentation-html2", "root": "packages/api/generated/documentation/html2", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen build", + "command": "npx projen build", "cwd": "packages/api/generated/documentation/html2", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen compile", + "command": "npx projen compile", "cwd": "packages/api/generated/documentation/html2", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen default", + "command": "npx projen default", "cwd": "packages/api/generated/documentation/html2", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen generate", + "command": "npx projen generate", "cwd": "packages/api/generated/documentation/html2", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen package", + "command": "npx projen package", "cwd": "packages/api/generated/documentation/html2", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen post-compile", + "command": "npx projen post-compile", "cwd": "packages/api/generated/documentation/html2", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen pre-compile", + "command": "npx projen pre-compile", "cwd": "packages/api/generated/documentation/html2", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen test", + "command": "npx projen test", "cwd": "packages/api/generated/documentation/html2", }, }, @@ -73557,64 +73719,64 @@ index.html "packages/api/generated/documentation/html_redoc/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "implicitDependencies": [ - "smithy-yarn2-model", + "smithy-yarn_classic-model", ], - "name": "smithy-yarn2-documentation-html-redoc", + "name": "smithy-yarn_classic-documentation-html-redoc", "root": "packages/api/generated/documentation/html_redoc", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen build", + "command": "npx projen build", "cwd": "packages/api/generated/documentation/html_redoc", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen compile", + "command": "npx projen compile", "cwd": "packages/api/generated/documentation/html_redoc", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen default", + "command": "npx projen default", "cwd": "packages/api/generated/documentation/html_redoc", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen generate", + "command": "npx projen generate", "cwd": "packages/api/generated/documentation/html_redoc", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen package", + "command": "npx projen package", "cwd": "packages/api/generated/documentation/html_redoc", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen post-compile", + "command": "npx projen post-compile", "cwd": "packages/api/generated/documentation/html_redoc", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen pre-compile", + "command": "npx projen pre-compile", "cwd": "packages/api/generated/documentation/html_redoc", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen test", + "command": "npx projen test", "cwd": "packages/api/generated/documentation/html_redoc", }, }, @@ -73723,64 +73885,64 @@ README.md "packages/api/generated/documentation/markdown/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "implicitDependencies": [ - "smithy-yarn2-model", + "smithy-yarn_classic-model", ], - "name": "smithy-yarn2-documentation-markdown", + "name": "smithy-yarn_classic-documentation-markdown", "root": "packages/api/generated/documentation/markdown", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen build", + "command": "npx projen build", "cwd": "packages/api/generated/documentation/markdown", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen compile", + "command": "npx projen compile", "cwd": "packages/api/generated/documentation/markdown", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen default", + "command": "npx projen default", "cwd": "packages/api/generated/documentation/markdown", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen generate", + "command": "npx projen generate", "cwd": "packages/api/generated/documentation/markdown", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen package", + "command": "npx projen package", "cwd": "packages/api/generated/documentation/markdown", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen post-compile", + "command": "npx projen post-compile", "cwd": "packages/api/generated/documentation/markdown", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen pre-compile", + "command": "npx projen pre-compile", "cwd": "packages/api/generated/documentation/markdown", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen test", + "command": "npx projen test", "cwd": "packages/api/generated/documentation/markdown", }, }, @@ -73887,64 +74049,64 @@ schemas.plantuml "packages/api/generated/documentation/plantuml/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "implicitDependencies": [ - "smithy-yarn2-model", + "smithy-yarn_classic-model", ], - "name": "smithy-yarn2-documentation-plantuml", + "name": "smithy-yarn_classic-documentation-plantuml", "root": "packages/api/generated/documentation/plantuml", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen build", + "command": "npx projen build", "cwd": "packages/api/generated/documentation/plantuml", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen compile", + "command": "npx projen compile", "cwd": "packages/api/generated/documentation/plantuml", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen default", + "command": "npx projen default", "cwd": "packages/api/generated/documentation/plantuml", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen generate", + "command": "npx projen generate", "cwd": "packages/api/generated/documentation/plantuml", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen package", + "command": "npx projen package", "cwd": "packages/api/generated/documentation/plantuml", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen post-compile", + "command": "npx projen post-compile", "cwd": "packages/api/generated/documentation/plantuml", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen pre-compile", + "command": "npx projen pre-compile", "cwd": "packages/api/generated/documentation/plantuml", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen test", + "command": "npx projen test", "cwd": "packages/api/generated/documentation/plantuml", }, }, @@ -73958,7 +74120,6 @@ This directory contains a generated type-safe CDK construct which will can the A /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -74003,7 +74164,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -74052,6 +74212,11 @@ mocks "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -74082,7 +74247,7 @@ mocks "type": "runtime", }, { - "name": "smithy-yarn2-typescript-runtime", + "name": "smithy-yarn-classic-typescript-runtime", "type": "runtime", }, ], @@ -74153,7 +74318,7 @@ mocks "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.clean-openapi-generated-code --code-path .", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript-cdk-infrastructure --src-dir src --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --extra-vendor-extensions '{"x-runtime-package-name":"smithy-yarn2-typescript-runtime","x-relative-spec-path":"../assets/api.json","x-enable-mock-integrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":""}' --generate-alias-as-model", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript-cdk-infrastructure --src-dir src --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --extra-vendor-extensions '{"x-runtime-package-name":"smithy-yarn-classic-typescript-runtime","x-relative-spec-path":"../assets/api.json","x-enable-mock-integrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":""}' --generate-alias-as-model", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", @@ -74171,7 +74336,7 @@ mocks "name": "install", "steps": [ { - "exec": "yarn install", + "exec": "yarn install --check-files", }, ], }, @@ -74180,7 +74345,7 @@ mocks "name": "install:ci", "steps": [ { - "exec": "yarn install --immutable", + "exec": "yarn install --check-files --frozen-lockfile", }, ], }, @@ -74228,13 +74393,13 @@ mocks "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs,smithy-yarn2-typescript-runtime", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,smithy-yarn-classic-typescript-runtime", }, { - "exec": "yarn install", + "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/aws-lambda @types/node npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag constructs smithy-yarn2-typescript-runtime", + "exec": "yarn upgrade @types/aws-lambda @types/node constructs npm-check-updates projen typescript @aws/pdk aws-cdk-lib cdk-nag smithy-yarn-classic-typescript-runtime", }, { "exec": "npx projen", @@ -74475,18 +74640,19 @@ mocks "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", - "smithy-yarn2-typescript-runtime": "*", + "smithy-yarn-classic-typescript-runtime": "*", }, "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", }, "license": "Apache-2.0", "main": "lib/index.js", - "name": "smithy-yarn2-typescript-infra", + "name": "smithy-yarn-classic-typescript-infra", "scripts": { "build": "npx projen build", "compile": "npx projen compile", @@ -74506,86 +74672,86 @@ mocks "packages/api/generated/infrastructure/typescript/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "implicitDependencies": [ - "smithy-yarn2-typescript-runtime", - "smithy-yarn2-model", + "smithy-yarn-classic-typescript-runtime", + "smithy-yarn_classic-model", ], - "name": "smithy-yarn2-typescript-infra", + "name": "smithy-yarn-classic-typescript-infra", "root": "packages/api/generated/infrastructure/typescript", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen build", + "command": "yarn projen build", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen compile", + "command": "yarn projen compile", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen default", + "command": "yarn projen default", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen generate", + "command": "yarn projen generate", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen package", + "command": "yarn projen package", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen post-compile", + "command": "yarn projen post-compile", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "post-upgrade": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen post-upgrade", + "command": "yarn projen post-upgrade", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen pre-compile", + "command": "yarn projen pre-compile", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen test", + "command": "yarn projen test", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "upgrade": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen upgrade", + "command": "yarn projen upgrade", "cwd": "packages/api/generated/infrastructure/typescript", }, }, "watch": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen watch", + "command": "yarn projen watch", "cwd": "packages/api/generated/infrastructure/typescript", }, }, @@ -74673,7 +74839,6 @@ Each runtime project includes types from your API model, as well as type-safe cl /.gitattributes linguist-generated /.gitignore linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -74717,7 +74882,6 @@ jspm_packages/ .yarn-integrity .cache !/.projenrc.js -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -74753,6 +74917,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -74849,7 +75018,7 @@ tsconfig.esm.json "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.clean-openapi-generated-code --code-path .", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript --src-dir src --additional-properties "npmName=smithy-yarn2-typescript-runtime,typescriptThreePlus=true,useSingleParameter=true,supportsES6=true" --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --generate-alias-as-model", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator typescript-fetch --spec-path ../../../model/.api.json --output-path . --generator-dir typescript --src-dir src --additional-properties "npmName=smithy-yarn-classic-typescript-runtime,typescriptThreePlus=true,useSingleParameter=true,supportsES6=true" --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --generate-alias-as-model", }, ], }, @@ -74858,7 +75027,7 @@ tsconfig.esm.json "name": "install", "steps": [ { - "exec": "yarn install", + "exec": "yarn install --check-files", }, ], }, @@ -74867,7 +75036,7 @@ tsconfig.esm.json "name": "install:ci", "steps": [ { - "exec": "yarn install --immutable", + "exec": "yarn install --check-files --frozen-lockfile", }, ], }, @@ -74915,13 +75084,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { - "exec": "yarn install", + "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -75165,13 +75334,14 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "typescript": "*", }, "license": "Apache-2.0", "main": "lib/index.js", - "name": "smithy-yarn2-typescript-runtime", + "name": "smithy-yarn-classic-typescript-runtime", "scripts": { "build": "npx projen build", "compile": "npx projen compile", @@ -75191,85 +75361,85 @@ tsconfig.esm.json "packages/api/generated/runtime/typescript/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", "implicitDependencies": [ - "smithy-yarn2-model", + "smithy-yarn_classic-model", ], - "name": "smithy-yarn2-typescript-runtime", + "name": "smithy-yarn-classic-typescript-runtime", "root": "packages/api/generated/runtime/typescript", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen build", + "command": "yarn projen build", "cwd": "packages/api/generated/runtime/typescript", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen compile", + "command": "yarn projen compile", "cwd": "packages/api/generated/runtime/typescript", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen default", + "command": "yarn projen default", "cwd": "packages/api/generated/runtime/typescript", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen generate", + "command": "yarn projen generate", "cwd": "packages/api/generated/runtime/typescript", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen package", + "command": "yarn projen package", "cwd": "packages/api/generated/runtime/typescript", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen post-compile", + "command": "yarn projen post-compile", "cwd": "packages/api/generated/runtime/typescript", }, }, "post-upgrade": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen post-upgrade", + "command": "yarn projen post-upgrade", "cwd": "packages/api/generated/runtime/typescript", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen pre-compile", + "command": "yarn projen pre-compile", "cwd": "packages/api/generated/runtime/typescript", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen test", + "command": "yarn projen test", "cwd": "packages/api/generated/runtime/typescript", }, }, "upgrade": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen upgrade", + "command": "yarn projen upgrade", "cwd": "packages/api/generated/runtime/typescript", }, }, "watch": { "executor": "nx:run-commands", "options": { - "command": "yarn exec projen watch", + "command": "yarn projen watch", "cwd": "packages/api/generated/runtime/typescript", }, }, @@ -75431,7 +75601,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn2-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn2-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn_classic-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn_classic-model/openapi/model/model.json", }, ], }, @@ -75633,69 +75803,69 @@ structure handler { ", "packages/api/model/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", - "name": "smithy-yarn2-model", + "name": "smithy-yarn_classic-model", "root": "packages/api/model", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen build", + "command": "npx projen build", "cwd": "packages/api/model", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen compile", + "command": "npx projen compile", "cwd": "packages/api/model", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen default", + "command": "npx projen default", "cwd": "packages/api/model", }, }, "generate": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen generate", + "command": "npx projen generate", "cwd": "packages/api/model", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen package", + "command": "npx projen package", "cwd": "packages/api/model", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen post-compile", + "command": "npx projen post-compile", "cwd": "packages/api/model", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen pre-compile", + "command": "npx projen pre-compile", "cwd": "packages/api/model", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen test", + "command": "npx projen test", "cwd": "packages/api/model", }, }, }, }, "packages/api/model/settings.gradle": "// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". -rootProject.name = 'smithy-yarn2-model' +rootProject.name = 'smithy-yarn_classic-model' ", "packages/api/model/smithy-build.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", @@ -75810,55 +75980,55 @@ structure NotAuthorizedError { ", "packages/api/project.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", - "name": "smithy-yarn2", + "name": "smithy-yarn_classic", "root": "packages/api", "targets": { "build": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen build", + "command": "npx projen build", "cwd": "packages/api", }, }, "compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen compile", + "command": "npx projen compile", "cwd": "packages/api", }, }, "default": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen default", + "command": "npx projen default", "cwd": "packages/api", }, }, "package": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen package", + "command": "npx projen package", "cwd": "packages/api", }, }, "post-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen post-compile", + "command": "npx projen post-compile", "cwd": "packages/api", }, }, "pre-compile": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen pre-compile", + "command": "npx projen pre-compile", "cwd": "packages/api", }, }, "test": { "executor": "nx:run-commands", "options": { - "command": "yarn dlx projen test", + "command": "npx projen test", "cwd": "packages/api", }, }, diff --git a/packages/type-safe-api/test/project/codegen/handlers/__snapshots__/generated-typescript-handlers-project.test.ts.snap b/packages/type-safe-api/test/project/codegen/handlers/__snapshots__/generated-typescript-handlers-project.test.ts.snap index 72b9455a3..9095f8781 100644 --- a/packages/type-safe-api/test/project/codegen/handlers/__snapshots__/generated-typescript-handlers-project.test.ts.snap +++ b/packages/type-safe-api/test/project/codegen/handlers/__snapshots__/generated-typescript-handlers-project.test.ts.snap @@ -246,7 +246,6 @@ exports[`Generated Typescript Handlers Code Unit Tests Synth 1`] = ` /.gitignore linguist-generated /.mergify.yml linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -417,7 +416,7 @@ jobs: steps: - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x - name: Download build artifacts uses: actions/download-artifact@v3 with: @@ -562,7 +561,6 @@ junit.xml !/.mergify.yml !/.github/workflows/upgrade-main.yml !/.github/pull_request_template.md -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -644,6 +642,11 @@ pull_request_rules: "type": "build", "version": "^6", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "esbuild", "type": "build", @@ -716,7 +719,6 @@ pull_request_rules: ".gitignore", ".mergify.yml", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".openapi-generator-ignore-handlebars", ".projen/deps.json", @@ -863,7 +865,7 @@ pull_request_rules: "name": "install", "steps": [ { - "exec": "yarn link test-ts-client", + "exec": "yarn_classic link test-ts-client", }, { "exec": "yarn install --check-files", @@ -990,13 +992,13 @@ pull_request_rules: "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,esbuild,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,standard-version,ts-jest,typescript", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,esbuild,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,standard-version,ts-jest,typescript", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/aws-lambda @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser esbuild eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen standard-version ts-jest typescript", + "exec": "yarn upgrade @types/aws-lambda @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs esbuild eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen standard-version ts-jest typescript", }, { "exec": "npx projen", @@ -1241,6 +1243,7 @@ pull_request_rules: "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", "esbuild": "*", "eslint": "^8", "eslint-import-resolver-node": "*", diff --git a/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-typescript-cdk-infrastructure-project.test.ts.snap b/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-typescript-cdk-infrastructure-project.test.ts.snap index 9d493cf7b..22d6fa6a4 100644 --- a/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-typescript-cdk-infrastructure-project.test.ts.snap +++ b/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-typescript-cdk-infrastructure-project.test.ts.snap @@ -13,7 +13,6 @@ exports[`Generated Typescript Infra Code Unit Tests Synth 1`] = ` /.gitignore linguist-generated /.mergify.yml linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -184,7 +183,7 @@ jobs: steps: - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x - name: Download build artifacts uses: actions/download-artifact@v3 with: @@ -326,7 +325,6 @@ jspm_packages/ !/.mergify.yml !/.github/workflows/upgrade-main.yml !/.github/pull_request_template.md -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -399,6 +397,11 @@ pull_request_rules: "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -452,7 +455,6 @@ pull_request_rules: ".gitignore", ".mergify.yml", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".openapi-generator-ignore-handlebars", ".projen/deps.json", @@ -599,7 +601,7 @@ pull_request_rules: "name": "install", "steps": [ { - "exec": "yarn link test-ts-client", + "exec": "yarn_classic link test-ts-client", }, { "exec": "yarn install --check-files", @@ -699,13 +701,13 @@ pull_request_rules: "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,npm-check-updates,projen,standard-version,typescript,@aws/pdk,aws-cdk-lib,cdk-nag,constructs", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/aws-lambda,@types/node,constructs,npm-check-updates,projen,standard-version,typescript,@aws/pdk,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/aws-lambda @types/node npm-check-updates projen standard-version typescript @aws/pdk aws-cdk-lib cdk-nag constructs", + "exec": "yarn upgrade @types/aws-lambda @types/node constructs npm-check-updates projen standard-version typescript @aws/pdk aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -951,6 +953,7 @@ pull_request_rules: "devDependencies": { "@types/aws-lambda": "*", "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "standard-version": "^9", diff --git a/packages/type-safe-api/test/project/codegen/types/__snapshots__/generated-typescript-runtime-project.test.ts.snap b/packages/type-safe-api/test/project/codegen/types/__snapshots__/generated-typescript-runtime-project.test.ts.snap index 89b987938..3f976ad2b 100644 --- a/packages/type-safe-api/test/project/codegen/types/__snapshots__/generated-typescript-runtime-project.test.ts.snap +++ b/packages/type-safe-api/test/project/codegen/types/__snapshots__/generated-typescript-runtime-project.test.ts.snap @@ -13,7 +13,6 @@ exports[`Generated Typescript Runtime Unit Tests Synth 1`] = ` /.gitignore linguist-generated /.mergify.yml linguist-generated /.npmignore linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.projen/** linguist-generated /.projen/deps.json linguist-generated @@ -183,7 +182,7 @@ jobs: steps: - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x - name: Download build artifacts uses: actions/download-artifact@v3 with: @@ -325,7 +324,6 @@ jspm_packages/ !/.mergify.yml !/.github/workflows/upgrade-main.yml !/.github/pull_request_template.md -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -385,6 +383,11 @@ tsconfig.esm.json "type": "build", "version": "^16", }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, { "name": "npm-check-updates", "type": "build", @@ -433,7 +436,6 @@ tsconfig.esm.json ".gitignore", ".mergify.yml", ".npmignore", - ".npmrc", ".openapi-generator-ignore", ".projen/deps.json", ".projen/files.json", @@ -670,13 +672,13 @@ tsconfig.esm.json "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,npm-check-updates,projen,standard-version,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/node,constructs,npm-check-updates,projen,standard-version,typescript,@aws-lambda-powertools/logger,@aws-lambda-powertools/metrics,@aws-lambda-powertools/tracer,@types/aws-lambda", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @types/node npm-check-updates projen standard-version typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", + "exec": "yarn upgrade @types/node constructs npm-check-updates projen standard-version typescript @aws-lambda-powertools/logger @aws-lambda-powertools/metrics @aws-lambda-powertools/tracer @types/aws-lambda", }, { "exec": "npx projen", @@ -920,6 +922,7 @@ tsconfig.esm.json }, "devDependencies": { "@types/node": "^16", + "constructs": "^10.0.0", "npm-check-updates": "^16", "projen": "*", "standard-version": "^9", diff --git a/packages/type-safe-api/test/project/type-safe-api-project.test.ts b/packages/type-safe-api/test/project/type-safe-api-project.test.ts index 523e58b45..ae9d3657a 100644 --- a/packages/type-safe-api/test/project/type-safe-api-project.test.ts +++ b/packages/type-safe-api/test/project/type-safe-api-project.test.ts @@ -185,8 +185,8 @@ describe("Type Safe Api Project Unit Tests", () => { it.each([ NodePackageManager.NPM, - NodePackageManager.YARN, - NodePackageManager.YARN2, + NodePackageManager.YARN_CLASSIC, + NodePackageManager.YARN_BERRY, NodePackageManager.PNPM, ])("Smithy With %s Package Manager", (packageManager) => { const project = new TypeSafeApiProject({ @@ -242,8 +242,8 @@ describe("Type Safe Api Project Unit Tests", () => { it.each([ NodePackageManager.NPM, - NodePackageManager.YARN, - NodePackageManager.YARN2, + NodePackageManager.YARN_CLASSIC, + NodePackageManager.YARN_BERRY, NodePackageManager.PNPM, ])("Smithy With %s Package Manager in Monorepo", (packageManager) => { const monorepo = new MonorepoTsProject({ diff --git a/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript-react-query-hooks.test.ts.snap b/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript-react-query-hooks.test.ts.snap index 63cb8d42b..418096a49 100644 --- a/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript-react-query-hooks.test.ts.snap +++ b/packages/type-safe-api/test/scripts/generators/__snapshots__/typescript-react-query-hooks.test.ts.snap @@ -12,7 +12,6 @@ exports[`Typescript React Query Hooks Code Generation Script Unit Tests Generate /.github/workflows/upgrade-main.yml linguist-generated /.gitignore linguist-generated /.mergify.yml linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -183,7 +182,7 @@ jobs: steps: - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x - name: Download build artifacts uses: actions/download-artifact@v3 with: @@ -325,7 +324,6 @@ jspm_packages/ !/.mergify.yml !/.github/workflows/upgrade-main.yml !/.github/pull_request_template.md -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json @@ -1644,7 +1642,6 @@ exports[`Typescript React Query Hooks Code Generation Script Unit Tests Generate /.github/workflows/upgrade-main.yml linguist-generated /.gitignore linguist-generated /.mergify.yml linguist-generated -/.npmrc linguist-generated /.openapi-generator-ignore linguist-generated /.openapi-generator-ignore-handlebars linguist-generated /.projen/** linguist-generated @@ -1815,7 +1812,7 @@ jobs: steps: - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x - name: Download build artifacts uses: actions/download-artifact@v3 with: @@ -1957,7 +1954,6 @@ jspm_packages/ !/.mergify.yml !/.github/workflows/upgrade-main.yml !/.github/pull_request_template.md -!/.npmrc !/test/ !/tsconfig.json !/tsconfig.dev.json diff --git a/packages/type-safe-api/tsconfig.dev.json b/packages/type-safe-api/tsconfig.dev.json index e089892d4..34c20ba31 100644 --- a/packages/type-safe-api/tsconfig.dev.json +++ b/packages/type-safe-api/tsconfig.dev.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.js and run "pnpm exec projen". { "compilerOptions": { "alwaysStrict": true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cc668be1f..0e9c27912 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,7 +28,7 @@ importers: dependencies: '@mrgrain/jsii-struct-builder': specifier: ^0.5.7 - version: 0.5.7(projen@0.73.2) + version: 0.5.7(projen@0.76.15) '@pnpm/types': specifier: ^9.0.0 version: 9.2.0 @@ -45,8 +45,8 @@ importers: specifier: ^4.2.7 version: 4.2.7 projen: - specifier: ^0.73 - version: 0.73.2 + specifier: ^0.76 + version: 0.76.15(constructs@10.2.70) devDependencies: '@aws/monorepo': specifier: 0.0.0 @@ -151,6 +151,9 @@ importers: '@typescript-eslint/parser': specifier: ^6 version: 6.5.0(eslint@8.39.0)(typescript@5.2.2) + constructs: + specifier: ^10.0.0 + version: 10.2.70 eslint: specifier: ^8 version: 8.39.0 @@ -167,8 +170,8 @@ importers: specifier: ^2.28.1 version: 2.28.1(@typescript-eslint/parser@6.5.0)(eslint-import-resolver-typescript@3.6.0)(eslint@8.39.0) projen: - specifier: ^0.73 - version: 0.73.2 + specifier: ^0.76 + version: 0.76.15(constructs@10.2.70) typescript: specifier: ^5.2.2 version: 5.2.2 @@ -208,6 +211,9 @@ importers: '@typescript-eslint/parser': specifier: ^6 version: 6.5.0(eslint@8.39.0)(typescript@5.2.2) + constructs: + specifier: 10.2.70 + version: 10.2.70 eslint: specifier: ^8 version: 8.39.0 @@ -266,8 +272,8 @@ importers: specifier: ^2.8.8 version: 2.8.8 projen: - specifier: ^0.73 - version: 0.73.2 + specifier: ^0.76 + version: 0.76.15(constructs@10.2.70) sharp: specifier: ^0.32.5 version: 0.32.5 @@ -429,8 +435,8 @@ importers: specifier: ^2.8.8 version: 2.8.8 projen: - specifier: ^0.73 - version: 0.73.2 + specifier: ^0.76 + version: 0.76.15(constructs@10.2.70) ts-jest: specifier: ^29.1.1 version: 29.1.1(@babel/core@7.21.8)(jest@29.6.4)(typescript@5.2.2) @@ -601,8 +607,8 @@ importers: specifier: ^2.8.8 version: 2.8.8 projen: - specifier: ^0.73 - version: 0.73.2 + specifier: ^0.76 + version: 0.76.15(constructs@10.2.70) ts-jest: specifier: ^29.1.1 version: 29.1.1(@babel/core@7.21.8)(jest@29.6.4)(typescript@5.2.2) @@ -637,6 +643,9 @@ importers: '@typescript-eslint/parser': specifier: ^6 version: 6.5.0(eslint@8.39.0)(typescript@5.2.2) + constructs: + specifier: 10.2.70 + version: 10.2.70 eslint: specifier: ^8 version: 8.39.0 @@ -683,8 +692,8 @@ importers: specifier: ^2.8.8 version: 2.8.8 projen: - specifier: ^0.73 - version: 0.73.2 + specifier: ^0.76 + version: 0.76.15(constructs@10.2.70) ts-jest: specifier: ^29.1.1 version: 29.1.1(@babel/core@7.21.8)(jest@29.6.4)(typescript@5.2.2) @@ -768,8 +777,8 @@ importers: specifier: ^2.8.8 version: 2.8.8 projen: - specifier: ^0.73 - version: 0.73.2 + specifier: ^0.76 + version: 0.76.15(constructs@10.2.70) ts-jest: specifier: ^29.1.1 version: 29.1.1(@babel/core@7.21.8)(jest@29.6.4)(typescript@5.2.2) @@ -807,6 +816,9 @@ importers: '@typescript-eslint/parser': specifier: ^6 version: 6.5.0(eslint@8.39.0)(typescript@5.2.2) + constructs: + specifier: 10.2.70 + version: 10.2.70 eslint: specifier: ^8 version: 8.39.0 @@ -853,8 +865,8 @@ importers: specifier: ^2.8.8 version: 2.8.8 projen: - specifier: ^0.73 - version: 0.73.2 + specifier: ^0.76 + version: 0.76.15(constructs@10.2.70) ts-jest: specifier: ^29.1.1 version: 29.1.1(@babel/core@7.21.8)(jest@29.6.4)(typescript@5.2.2) @@ -895,6 +907,9 @@ importers: '@typescript-eslint/parser': specifier: ^6 version: 6.5.0(eslint@8.39.0)(typescript@5.2.2) + constructs: + specifier: 10.2.70 + version: 10.2.70 eslint: specifier: ^8 version: 8.39.0 @@ -944,8 +959,8 @@ importers: specifier: ^2.8.8 version: 2.8.8 projen: - specifier: ^0.73 - version: 0.73.2 + specifier: ^0.76 + version: 0.76.15(constructs@10.2.70) ts-jest: specifier: ^29.1.1 version: 29.1.1(@babel/core@7.21.8)(jest@29.6.4)(typescript@5.2.2) @@ -1224,8 +1239,8 @@ importers: specifier: ^2.8.8 version: 2.8.8 projen: - specifier: ^0.73 - version: 0.73.2 + specifier: ^0.76 + version: 0.76.15(constructs@10.2.70) reregexp: specifier: 1.6.1 version: 1.6.1 @@ -1414,8 +1429,8 @@ importers: specifier: ^2.8.8 version: 2.8.8 projen: - specifier: ^0.73 - version: 0.73.2 + specifier: ^0.76 + version: 0.76.15(constructs@10.2.70) ts-jest: specifier: ^29.1.1 version: 29.1.1(@babel/core@7.21.8)(jest@29.6.4)(typescript@5.2.2) @@ -1499,8 +1514,8 @@ importers: specifier: ^2.8.8 version: 2.8.8 projen: - specifier: ^0.73 - version: 0.73.2 + specifier: ^0.76 + version: 0.76.15(constructs@10.2.70) ts-jest: specifier: ^29.1.1 version: 29.1.1(@babel/core@7.21.8)(jest@29.6.4)(typescript@5.2.2) @@ -1614,8 +1629,8 @@ importers: specifier: ^2.8.8 version: 2.8.8 projen: - specifier: ^0.73 - version: 0.73.2 + specifier: ^0.76 + version: 0.76.15(constructs@10.2.70) reregexp: specifier: 1.6.1 version: 1.6.1 @@ -3327,14 +3342,14 @@ packages: uuid: 7.0.3 dev: true - /@mrgrain/jsii-struct-builder@0.5.7(projen@0.73.2): + /@mrgrain/jsii-struct-builder@0.5.7(projen@0.76.15): resolution: {integrity: sha512-9UMg6NOh46ha3r62MgKO7mop94vLtFb3abrnSedFI9GZuq0O48ZPd8qfKmVt+WUZnLmr8FbK29CKEUt+MGyrDw==} peerDependencies: projen: x.x.x dependencies: '@jsii/spec': 1.88.0 '@ungap/structured-clone': 1.0.2 - projen: 0.73.2 + projen: 0.76.15(constructs@10.2.70) dev: false /@nodelib/fs.scandir@2.1.5: @@ -6834,7 +6849,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.3.0-dev.20230927 + typescript: 5.3.0-dev.20231031 dev: true /duplexer2@0.0.2: @@ -11804,15 +11819,18 @@ packages: engines: {node: '>=0.4.0'} dev: true - /projen@0.73.2: - resolution: {integrity: sha512-PSGfdmUIsvptzmh8nsijDae/EPT+/LRKu1y9zySz8uYdvYFSWZNK/0tjhG5rPUWJmHVq33lwVpyTFlTjaCl5RQ==} - engines: {node: '>= 14.0.0'} + /projen@0.76.15(constructs@10.2.70): + resolution: {integrity: sha512-Ez1w2KlmzAtiYg9aIm7NFD56hafFgnGnYcZc60GzT6AEFPEDWPX1lGrngAibDnEys3iDsIimreyVIV77KVqoAg==} + engines: {node: '>= 16.0.0'} hasBin: true + peerDependencies: + constructs: ^10.0.0 dependencies: '@iarna/toml': 2.2.5 case: 1.6.3 chalk: 4.1.2 comment-json: 4.2.2 + constructs: 10.2.70 conventional-changelog-config-spec: 2.1.0 fast-json-patch: 3.1.1 glob: 8.1.0 @@ -11820,7 +11838,7 @@ packages: semver: 7.5.4 shx: 0.3.4 xmlbuilder2: 3.1.1 - yaml: 2.3.1 + yaml: 2.3.3 yargs: 17.7.2 bundledDependencies: - '@iarna/toml' @@ -13573,8 +13591,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - /typescript@5.3.0-dev.20230927: - resolution: {integrity: sha512-FHoT/nbOZjlXfK1yYTtCVT6yOp7Y9Vab/8Do4KiEGl3jI6rxPD7d1ssB/5vlH4ZXZ//0DW96vsvp/OUyjxCqgA==} + /typescript@5.3.0-dev.20231031: + resolution: {integrity: sha512-+w6szmOFr7GSWj/eNFgHdYqubMux9B5ao5LFoGdn712gbDYMpLwqLNkPLpJHD9chl/2wc/W96iSfALkZs7sVXQ==} engines: {node: '>=14.17'} hasBin: true dev: true @@ -14108,8 +14126,8 @@ packages: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} - /yaml@2.3.1: - resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==} + /yaml@2.3.3: + resolution: {integrity: sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==} engines: {node: '>= 14'} /yargs-parser@18.1.3: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 1100f8e57..496beeb40 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,4 +1,4 @@ -# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". packages: - packages/aws-arch diff --git a/projenrc/projects/aws-arch-project.ts b/projenrc/projects/aws-arch-project.ts index 9e2bbe865..88ea7ad59 100644 --- a/projenrc/projects/aws-arch-project.ts +++ b/projenrc/projects/aws-arch-project.ts @@ -35,7 +35,7 @@ export class AwsArchProject extends PDKProject { "unzipper", "xml-flow", ], - peerDeps: ["projen"], + peerDeps: ["projen", "constructs"], stability: Stability.STABLE, }); diff --git a/projenrc/projects/cloudscape-react-ts-website-project.ts b/projenrc/projects/cloudscape-react-ts-website-project.ts index a6e9dc211..69efeb2cb 100644 --- a/projenrc/projects/cloudscape-react-ts-website-project.ts +++ b/projenrc/projects/cloudscape-react-ts-website-project.ts @@ -21,7 +21,7 @@ export class CloudscapeReactTsWebsiteProject extends PDKProject { repositoryUrl: "https://github.com/aws/aws-pdk", devDeps: ["projen", "@types/mustache", `${PDK_NAMESPACE}monorepo@^0.x`], deps: [`${PDK_NAMESPACE}type-safe-api@^0.x`], - peerDeps: ["projen", `${PDK_NAMESPACE}type-safe-api@^0.x`], + peerDeps: ["projen", `${PDK_NAMESPACE}type-safe-api@^0.x`, "constructs"], bundledDeps: ["mustache"], stability: Stability.STABLE, }); diff --git a/projenrc/projects/infrastructure-project.ts b/projenrc/projects/infrastructure-project.ts index 6255a54b1..d85e61691 100644 --- a/projenrc/projects/infrastructure-project.ts +++ b/projenrc/projects/infrastructure-project.ts @@ -27,6 +27,7 @@ export class InfrastructureProject extends PDKProject { ], peerDeps: [ "projen", + "constructs", `${PDK_NAMESPACE}monorepo@^0.x`, `${PDK_NAMESPACE}type-safe-api@^0.x`, `${PDK_NAMESPACE}cloudscape-react-ts-website@^0.x`, diff --git a/projenrc/projects/monorepo-project.ts b/projenrc/projects/monorepo-project.ts index b35097c61..f825e5a40 100644 --- a/projenrc/projects/monorepo-project.ts +++ b/projenrc/projects/monorepo-project.ts @@ -26,7 +26,7 @@ export class MonorepoProject extends PDKProject { "@types/semver", "@nx/devkit", ], - peerDeps: ["projen"], + peerDeps: ["projen", "constructs"], bundledDeps: [ "fs-extra", "semver", diff --git a/tsconfig.dev.json b/tsconfig.dev.json index f4dc224b8..57459654e 100644 --- a/tsconfig.dev.json +++ b/tsconfig.dev.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". { "compilerOptions": { "alwaysStrict": true, diff --git a/tsconfig.json b/tsconfig.json index 757e33e82..09b31f845 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,4 +1,4 @@ -// ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +// ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". { "compilerOptions": { "rootDir": ".", From 586aa0b7ff4829b28f679c900928c7e6da887336 Mon Sep 17 00:00:00 2001 From: Jack Stevenson Date: Wed, 1 Nov 2023 17:03:02 +1100 Subject: [PATCH 17/21] fix(monorepo): add monorepo dep on @aws-cdk/aws-cognito-identitypool-alpha (#628) Yarn doesn't automatically install peer dependencies, and so users would receive an error with a missing package "@aws-cdk/aws-cognito-identitypool-alpha" when creating a new ts monorepo with yarn. The other peer dependencies (eg cdk) were already included as deps, so we include this one so yarn doesn't complain. Fixes #580 --- .projen/deps.json | 4 + package.json | 1 + .../src/projects/typescript/monorepo-ts.ts | 8 +- .../test/__snapshots__/monorepo.test.ts.snap | 117 ++++++++++++++---- .../type-safe-api-project.test.ts.snap | 90 +++++++++++--- pnpm-lock.yaml | 14 +++ 6 files changed, 187 insertions(+), 47 deletions(-) diff --git a/.projen/deps.json b/.projen/deps.json index 7dab4bdb7..96407ffce 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -218,6 +218,10 @@ "version": "^16", "type": "peer" }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime" + }, { "name": "@mrgrain/jsii-struct-builder", "type": "runtime" diff --git a/package.json b/package.json index f67f42013..8ebaf5052 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "nx": "^16" }, "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "^2.103.1-alpha.0", "@mrgrain/jsii-struct-builder": "^0.5.7", "@pnpm/types": "^9.0.0", "aws-cdk-lib": "^2.93.0", diff --git a/packages/monorepo/src/projects/typescript/monorepo-ts.ts b/packages/monorepo/src/projects/typescript/monorepo-ts.ts index 5a5795278..ad7dc52b8 100644 --- a/packages/monorepo/src/projects/typescript/monorepo-ts.ts +++ b/packages/monorepo/src/projects/typescript/monorepo-ts.ts @@ -173,7 +173,13 @@ export class MonorepoTsProject }, peerDeps: ["nx@^16", ...(options.peerDeps || [])], devDeps: ["nx@^16", "@aws/pdk@^0", ...(options.devDeps || [])], - deps: ["aws-cdk-lib", "constructs", "cdk-nag", ...(options.deps || [])], + deps: [ + "aws-cdk-lib", + "constructs", + "cdk-nag", + "@aws-cdk/aws-cognito-identitypool-alpha", + ...(options.deps || []), + ], }); this.nxConfigurator = new NxConfigurator(this, { diff --git a/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap b/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap index c0409a3af..de715d563 100644 --- a/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap +++ b/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap @@ -347,6 +347,10 @@ resolution-mode=highest "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -565,13 +569,13 @@ resolution-mode=highest "exec": "pnpm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "pnpm i --no-frozen-lockfile", }, { - "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "pnpm exec projen", @@ -896,6 +900,7 @@ resolution-mode=highest "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -2388,6 +2393,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -2604,13 +2613,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "yarn projen", @@ -2935,6 +2944,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -4418,6 +4428,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -4634,13 +4648,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "yarn exec projen", @@ -4965,6 +4979,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -6443,6 +6458,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -6659,13 +6678,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -6990,6 +7009,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -8292,6 +8312,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -8516,13 +8540,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -8847,6 +8871,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -10041,6 +10066,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -10257,13 +10286,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -10588,6 +10617,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -11071,6 +11101,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -11295,13 +11329,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -11626,6 +11660,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -14403,6 +14438,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -14620,13 +14659,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -14951,6 +14990,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -15433,6 +15473,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -15649,13 +15693,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -15980,6 +16024,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -16465,6 +16510,10 @@ pattern1.txt "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -16681,13 +16730,13 @@ pattern1.txt "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -17012,6 +17061,7 @@ pattern1.txt "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -17503,6 +17553,10 @@ resolution-mode=highest "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -17721,13 +17775,13 @@ resolution-mode=highest "exec": "pnpm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "pnpm i --no-frozen-lockfile", }, { - "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "pnpm exec projen", @@ -18052,6 +18106,7 @@ resolution-mode=highest "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -19537,6 +19592,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -19753,13 +19812,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -20097,6 +20156,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -20580,6 +20640,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -20796,13 +20860,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -21127,6 +21191,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", diff --git a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap index b72eac9a9..3df77dc70 100644 --- a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap +++ b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap @@ -3278,6 +3278,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -3505,13 +3509,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -3836,6 +3840,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -10497,6 +10502,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -10724,13 +10733,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -11055,6 +11064,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -17920,6 +17930,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -18147,13 +18161,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -18478,6 +18492,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -32727,6 +32742,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -32954,13 +32973,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -33285,6 +33304,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -39552,6 +39572,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -39771,13 +39795,13 @@ tsconfig.tsbuildinfo "exec": "npm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "npm install", }, { - "exec": "npm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "npm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -40102,6 +40126,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -45550,6 +45575,10 @@ resolution-mode=highest "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -45771,13 +45800,13 @@ resolution-mode=highest "exec": "pnpm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "pnpm i --no-frozen-lockfile", }, { - "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "pnpm exec projen", @@ -46102,6 +46131,7 @@ resolution-mode=highest "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -52135,6 +52165,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -52362,13 +52396,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -52693,6 +52727,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -59744,6 +59779,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -59971,13 +60010,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -60302,6 +60341,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -66769,6 +66809,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -66988,13 +67032,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "yarn exec projen", @@ -67319,6 +67363,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", @@ -72752,6 +72797,10 @@ tsconfig.tsbuildinfo "type": "peer", "version": "^16", }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + }, { "name": "aws-cdk-lib", "type": "runtime", @@ -72971,13 +73020,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", }, { "exec": "yarn projen", @@ -73302,6 +73351,7 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "*", "aws-cdk-lib": "*", "cdk-nag": "*", "constructs": "*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0e9c27912..042d2bc4f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,6 +26,9 @@ importers: .: dependencies: + '@aws-cdk/aws-cognito-identitypool-alpha': + specifier: ^2.103.1-alpha.0 + version: 2.103.1-alpha.0(aws-cdk-lib@2.93.0)(constructs@10.2.70) '@mrgrain/jsii-struct-builder': specifier: ^0.5.7 version: 0.5.7(projen@0.76.15) @@ -1709,6 +1712,17 @@ packages: /@aws-cdk/asset-node-proxy-agent-v6@2.0.1: resolution: {integrity: sha512-DDt4SLdLOwWCjGtltH4VCST7hpOI5DzieuhGZsBpZ+AgJdSI2GCjklCXm0GCTwJG/SolkL5dtQXyUKgg9luBDg==} + /@aws-cdk/aws-cognito-identitypool-alpha@2.103.1-alpha.0(aws-cdk-lib@2.93.0)(constructs@10.2.70): + resolution: {integrity: sha512-iyQvyi+k2lkj8TpaSXCvagvRorI+Vce7qqWgzRKk5VBxA7760rI11dHWXOrllIW0YrubInDm4wZ236fmBPMc9Q==} + engines: {node: '>= 14.15.0'} + peerDependencies: + aws-cdk-lib: ^2.103.1 + constructs: ^10.0.0 + dependencies: + aws-cdk-lib: 2.93.0(constructs@10.2.70) + constructs: 10.2.70 + dev: false + /@aws-cdk/aws-cognito-identitypool-alpha@2.93.0-alpha.0(aws-cdk-lib@2.93.0)(constructs@10.2.70): resolution: {integrity: sha512-ZKCtsBaNDUnYXl6g2x45PzSxuXjMyZTzIg3yDWVSUhpvnnMH0nbPvLhAenGXre9Ax+ItKL3Ai4V5LRQWKXQHiA==} engines: {node: '>= 14.15.0'} From cc1ddca8d6482b7fe7a50a89533f36b8e54f684c Mon Sep 17 00:00:00 2001 From: Jack Stevenson Date: Thu, 2 Nov 2023 09:48:48 +1100 Subject: [PATCH 18/21] fix(infrastructure): fix java compilation issue without api, and skip unused constructs in java/py (#629) The Java website construct didn't compile when an api wasn't present due to some extra brackets being commented out. Additionally the website construct would always be rendered for typescript even if no website was configured. Likewise for Java and Python, the api and website constructs were always rendered. This PR also adds tests for the infrastructure projects. --- .../constructs/WebsiteConstruct.java.mustache | 6 +- .../java/infrastructure-java-project.ts | 13 +- .../python/infrastructure-py-project.ts | 11 +- .../typescript/infrastructure-ts-project.ts | 11 +- packages/infrastructure/test/.gitkeep | 1 - .../infrastructure-java-project.test.ts.snap | 3013 ++++++++++ .../java/infrastructure-java-project.test.ts | 58 + .../infrastructure-py-project.test.ts.snap | 2293 ++++++++ .../python/infrastructure-py-project.test.ts | 58 + .../infrastructure-ts-project.test.ts.snap | 5015 +++++++++++++++++ .../infrastructure-ts-project.test.ts | 58 + .../projects/utils/snapshot-infra-project.ts | 70 + 12 files changed, 10587 insertions(+), 20 deletions(-) delete mode 100644 packages/infrastructure/test/.gitkeep create mode 100644 packages/infrastructure/test/projects/java/__snapshots__/infrastructure-java-project.test.ts.snap create mode 100644 packages/infrastructure/test/projects/java/infrastructure-java-project.test.ts create mode 100644 packages/infrastructure/test/projects/python/__snapshots__/infrastructure-py-project.test.ts.snap create mode 100644 packages/infrastructure/test/projects/python/infrastructure-py-project.test.ts create mode 100644 packages/infrastructure/test/projects/typescript/__snapshots__/infrastructure-ts-project.test.ts.snap create mode 100644 packages/infrastructure/test/projects/typescript/infrastructure-ts-project.test.ts create mode 100644 packages/infrastructure/test/projects/utils/snapshot-infra-project.ts diff --git a/packages/infrastructure/samples/infrastructure/java/src/java/groupId/constructs/WebsiteConstruct.java.mustache b/packages/infrastructure/samples/infrastructure/java/src/java/groupId/constructs/WebsiteConstruct.java.mustache index 610fe8c7a..b2357708f 100644 --- a/packages/infrastructure/samples/infrastructure/java/src/java/groupId/constructs/WebsiteConstruct.java.mustache +++ b/packages/infrastructure/samples/infrastructure/java/src/java/groupId/constructs/WebsiteConstruct.java.mustache @@ -16,9 +16,6 @@ import software.constructs.Construct; * Construct to deploy a Static Website */ public class WebsiteConstruct extends Construct { - public WebsiteConstruct(Construct scope, String id, UserIdentity userIdentity) { - this(scope, id, userIdentity{{^hasApi}}/* {{/hasApi}}, null{{^hasApi}} */{{/hasApi}}); - } public WebsiteConstruct(Construct scope, String id, UserIdentity userIdentity{{^hasApi}}/* {{/hasApi}}, ApiConstruct apiConstruct{{^hasApi}} */{{/hasApi}}) { super(scope, id); @@ -31,7 +28,8 @@ public class WebsiteConstruct extends Construct { "identityPoolId", userIdentity.getIdentityPool().getIdentityPoolId(), "userPoolId", userIdentity.getUserPool().getUserPoolId(), "userPoolWebClientId", userIdentity.getUserPoolClient().getUserPoolClientId(){{#hasApi}},{{/hasApi}} - {{^hasApi}}// {{/hasApi}}"apiUrl", apiConstruct.api.getApi().urlForPath()))) + {{^hasApi}}// {{/hasApi}}"apiUrl", apiConstruct.api.getApi().urlForPath() + ))) .build()) .distributionProps(DistributionProps.builder() .geoRestriction(GeoRestriction.allowlist( diff --git a/packages/infrastructure/src/projects/java/infrastructure-java-project.ts b/packages/infrastructure/src/projects/java/infrastructure-java-project.ts index e1bd44e3f..9f4989af8 100644 --- a/packages/infrastructure/src/projects/java/infrastructure-java-project.ts +++ b/packages/infrastructure/src/projects/java/infrastructure-java-project.ts @@ -142,13 +142,16 @@ export class InfrastructureJavaProject extends AwsCdkJavaApp { ) { fs.readdirSync(dir, { withFileTypes: true }) .filter((f) => { + let shouldIncludeFile = true; if (!mustacheConfig.hasApi) { - return !f.name.endsWith("api.ts.mustache"); - } else if (!mustacheConfig.hasWebsite) { - return !f.name.endsWith("website.ts.mustache"); - } else { - return true; + shouldIncludeFile &&= !f.name.endsWith("ApiConstruct.java.mustache"); + } + if (!mustacheConfig.hasWebsite) { + shouldIncludeFile &&= !f.name.endsWith( + "WebsiteConstruct.java.mustache" + ); } + return shouldIncludeFile; }) .forEach((f) => { if (f.isDirectory()) { diff --git a/packages/infrastructure/src/projects/python/infrastructure-py-project.ts b/packages/infrastructure/src/projects/python/infrastructure-py-project.ts index fd59c9807..6b15e944c 100644 --- a/packages/infrastructure/src/projects/python/infrastructure-py-project.ts +++ b/packages/infrastructure/src/projects/python/infrastructure-py-project.ts @@ -130,13 +130,14 @@ export class InfrastructurePyProject extends AwsCdkPythonApp { ) { fs.readdirSync(dir, { withFileTypes: true }) .filter((f) => { + let shouldIncludeFile = true; if (!mustacheConfig.hasApi) { - return !f.name.endsWith("api.ts.mustache"); - } else if (!mustacheConfig.hasWebsite) { - return !f.name.endsWith("website.ts.mustache"); - } else { - return true; + shouldIncludeFile &&= !f.name.endsWith("api.py.mustache"); + } + if (!mustacheConfig.hasWebsite) { + shouldIncludeFile &&= !f.name.endsWith("website.py.mustache"); } + return shouldIncludeFile; }) .forEach((f) => { if (f.isDirectory()) { diff --git a/packages/infrastructure/src/projects/typescript/infrastructure-ts-project.ts b/packages/infrastructure/src/projects/typescript/infrastructure-ts-project.ts index 712426d46..97496ebcf 100644 --- a/packages/infrastructure/src/projects/typescript/infrastructure-ts-project.ts +++ b/packages/infrastructure/src/projects/typescript/infrastructure-ts-project.ts @@ -128,13 +128,14 @@ export class InfrastructureTsProject extends AwsCdkTypeScriptApp { ) { fs.readdirSync(dir, { withFileTypes: true }) .filter((f) => { + let shouldIncludeFile = true; if (!mustacheConfig.hasApi) { - return !f.name.endsWith("api.ts.mustache"); - } else if (!mustacheConfig.hasWebsite) { - return !f.name.endsWith("website.ts.mustache"); - } else { - return true; + shouldIncludeFile &&= !f.name.endsWith("api.ts.mustache"); } + if (!mustacheConfig.hasWebsite) { + shouldIncludeFile &&= !f.name.endsWith("website.ts.mustache"); + } + return shouldIncludeFile; }) .forEach((f) => f.isDirectory() diff --git a/packages/infrastructure/test/.gitkeep b/packages/infrastructure/test/.gitkeep deleted file mode 100644 index 4974098ca..000000000 --- a/packages/infrastructure/test/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -// Delete me once tests are added \ No newline at end of file diff --git a/packages/infrastructure/test/projects/java/__snapshots__/infrastructure-java-project.test.ts.snap b/packages/infrastructure/test/projects/java/__snapshots__/infrastructure-java-project.test.ts.snap new file mode 100644 index 000000000..c50914a3c --- /dev/null +++ b/packages/infrastructure/test/projects/java/__snapshots__/infrastructure-java-project.test.ts.snap @@ -0,0 +1,3013 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`InfrastructureJavaProject Defaults 1`] = ` +{ + ".gitattributes": "# ~~ Generated by projen. To modify, edit src/test/java/projenrc.java and run "npx projen". + +/.gitattributes linguist-generated +/.github/workflows/pull-request-lint.yml linguist-generated +/.gitignore linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/cdk.json linguist-generated +/pom.xml linguist-generated", + ".github/workflows/pull-request-lint.yml": "# ~~ Generated by projen. To modify, edit src/test/java/projenrc.java and run "npx projen". + +name: pull-request-lint +on: + pull_request_target: + types: + - labeled + - opened + - synchronize + - reopened + - ready_for_review + - edited +jobs: + validate: + name: Validate PR title + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: amannn/action-semantic-pull-request@v5.0.2 + env: + GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} + with: + types: |- + feat + fix + chore + requireScope: false + githubBaseUrl: \${{ github.api_url }} +", + ".gitignore": "# ~~ Generated by projen. To modify, edit src/test/java/projenrc.java and run "npx projen". +node_modules/ +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/.github/workflows/pull-request-lint.yml +!/pom.xml +.classpath +.project +.settings +target +dist/java +!/cdk.json +/cdk.out/ +.cdk.staging/ +", + ".projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit src/test/java/projenrc.java and run "npx projen".", + "dependencies": [ + { + "metadata": { + "configuration": { + "release": "11", + }, + }, + "name": "org.apache.maven.plugins/maven-compiler-plugin", + "type": "build", + "version": "3.8.1", + }, + { + "metadata": { + "configuration": { + "rules": [ + { + "requireMavenVersion": [ + { + "version": "3.6", + }, + ], + }, + ], + }, + "executions": [ + { + "goals": [ + "enforce", + ], + "id": "enforce-maven", + }, + ], + }, + "name": "org.apache.maven.plugins/maven-enforcer-plugin", + "type": "build", + "version": "3.0.0-M3", + }, + { + "metadata": { + "configuration": { + "archive": { + "index": true, + "manifest": { + "addDefaultImplementationEntries": true, + "addDefaultSpecificationEntries": true, + }, + }, + }, + }, + "name": "org.apache.maven.plugins/maven-jar-plugin", + "type": "build", + "version": "3.2.0", + }, + { + "metadata": { + "configuration": { + "additionalJOptions": { + "additionalJOption": [ + "-J-XX:+TieredCompilation", + "-J-XX:TieredStopAtLevel=1", + ], + }, + "detectJavaApiLink": false, + "failOnError": false, + "show": "protected", + }, + "executions": [ + { + "goals": [ + "jar", + ], + "id": "attach-javadocs", + }, + ], + }, + "name": "org.apache.maven.plugins/maven-javadoc-plugin", + "type": "build", + "version": "3.2.0", + }, + { + "metadata": { + "executions": [ + { + "goals": [ + "jar", + ], + "id": "attach-sources", + }, + ], + }, + "name": "org.apache.maven.plugins/maven-source-plugin", + "type": "build", + "version": "3.2.1", + }, + { + "name": "org.apache.maven.plugins/maven-surefire-plugin", + "type": "build", + "version": "3.1.2", + }, + { + "name": "org.codehaus.mojo/exec-maven-plugin", + "type": "build", + "version": "3.0.0", + }, + { + "name": "software.amazon.awscdk/aws-cdk-lib", + "type": "runtime", + "version": "^2.1.0", + }, + { + "name": "software.aws/pdk", + "type": "runtime", + "version": "^0", + }, + { + "name": "software.constructs/constructs", + "type": "runtime", + "version": "^10.0.5", + }, + { + "name": "io.github.cdklabs/projen", + "type": "test", + "version": "99.99.99", + }, + { + "name": "io.github.origin-energy/java-snapshot-testing-junit5", + "type": "test", + "version": "^4.0.6", + }, + { + "name": "io.github.origin-energy/java-snapshot-testing-plugin-jackson", + "type": "test", + "version": "^4.0.6", + }, + { + "name": "org.junit.jupiter/junit-jupiter-api", + "type": "test", + "version": "^5", + }, + { + "name": "org.junit.jupiter/junit-jupiter-engine", + "type": "test", + "version": "^5", + }, + { + "name": "org.slf4j/slf4j-simple", + "type": "test", + "version": "2.0.0-alpha0", + }, + ], + }, + ".projen/files.json": { + "//": "~~ Generated by projen. To modify, edit src/test/java/projenrc.java and run "npx projen".", + "files": [ + ".gitattributes", + ".github/workflows/pull-request-lint.yml", + ".gitignore", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "cdk.json", + "pom.xml", + ], + }, + ".projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit src/test/java/projenrc.java and run "npx projen".", + "tasks": { + "build": { + "description": "Full release build", + "name": "build", + "steps": [ + { + "spawn": "default", + }, + { + "spawn": "pre-compile", + }, + { + "spawn": "compile", + }, + { + "spawn": "post-compile", + }, + { + "spawn": "test", + }, + { + "spawn": "package", + }, + ], + }, + "clobber": { + "condition": "git diff --exit-code > /dev/null", + "description": "hard resets to HEAD of origin and cleans the local repo", + "env": { + "BRANCH": "$(git branch --show-current)", + }, + "name": "clobber", + "steps": [ + { + "exec": "git checkout -b scratch", + "name": "save current HEAD in "scratch" branch", + }, + { + "exec": "git checkout $BRANCH", + }, + { + "exec": "git fetch origin", + "name": "fetch latest changes from origin", + }, + { + "exec": "git reset --hard origin/$BRANCH", + "name": "hard reset to origin commit", + }, + { + "exec": "git clean -fdx", + "name": "clean all untracked files", + }, + { + "say": "ready to rock! (unpushed commits are under the "scratch" branch)", + }, + ], + }, + "compile": { + "description": "Only compile", + "name": "compile", + "steps": [ + { + "exec": "mvn compiler:compile", + }, + ], + }, + "default": { + "description": "Synthesize project files", + "name": "default", + "steps": [ + { + "exec": "mvn compiler:testCompile --quiet", + }, + { + "exec": "mvn exec:java --quiet -Dexec.mainClass=projenrc -Dexec.classpathScope="test"", + }, + ], + }, + "deploy": { + "description": "Deploys your CDK app to the AWS cloud", + "name": "deploy", + "steps": [ + { + "exec": "cdk deploy", + "receiveArgs": true, + }, + ], + }, + "destroy": { + "description": "Destroys your cdk app in the AWS cloud", + "name": "destroy", + "steps": [ + { + "exec": "cdk destroy", + "receiveArgs": true, + }, + ], + }, + "diff": { + "description": "Diffs the currently deployed app against your code", + "name": "diff", + "steps": [ + { + "exec": "cdk diff", + }, + ], + }, + "eject": { + "description": "Remove projen from the project", + "env": { + "PROJEN_EJECTING": "true", + }, + "name": "eject", + "steps": [ + { + "spawn": "default", + }, + ], + }, + "package": { + "description": "Creates the distribution package", + "env": { + "MAVEN_OPTS": "-XX:+TieredCompilation -XX:TieredStopAtLevel=1", + }, + "name": "package", + "steps": [ + { + "exec": "mkdir -p dist/java", + }, + { + "exec": "mvn deploy -D=altDeploymentRepository=local::default::file:///$PWD/dist/java", + }, + ], + }, + "post-compile": { + "description": "Runs after successful compilation", + "name": "post-compile", + "steps": [ + { + "spawn": "synth", + }, + ], + }, + "pre-compile": { + "description": "Prepare the project for compilation", + "name": "pre-compile", + }, + "synth": { + "description": "Synthesizes your cdk app into cdk.out", + "name": "synth", + "steps": [ + { + "exec": "cdk synth", + }, + ], + }, + "synth:silent": { + "description": "Synthesizes your cdk app into cdk.out and suppresses the template in stdout (part of "yarn build")", + "name": "synth:silent", + "steps": [ + { + "exec": "cdk synth -q", + }, + ], + }, + "test": { + "description": "Run tests", + "name": "test", + "steps": [ + { + "exec": "mvn test", + }, + ], + }, + "watch": { + "description": "Watches changes in your source code and rebuilds and deploys to the current account", + "name": "watch", + "steps": [ + { + "exec": "cdk deploy --hotswap", + }, + { + "exec": "cdk watch", + }, + ], + }, + }, + }, + "README.md": "## Getting started + +Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infrastructure/index.html)", + "cdk.json": { + "//": "~~ Generated by projen. To modify, edit src/test/java/projenrc.java and run "npx projen".", + "app": "mvn exec:java --quiet -Dexec.mainClass=software.aws.infra.Main", + "output": "cdk.out", + }, + "pom.xml": " + + 4.0.0 + software.aws.infra + infra + 0.0.0 + jar + Defaults + + UTF-8 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M3 + + + + 3.6 + + + + + + enforce-maven + + enforce + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + true + + true + true + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + false + protected + false + + -J-XX:+TieredCompilation + -J-XX:TieredStopAtLevel=1 + + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + org.codehaus.mojo + exec-maven-plugin + 3.0.0 + + + + + + software.amazon.awscdk + aws-cdk-lib + [2.1.0,3.0.0) + + + software.aws + pdk + (,1.0.0) + + + software.constructs + constructs + [10.0.5,11.0.0) + + + io.github.cdklabs + projen + 99.99.99 + test + + + io.github.origin-energy + java-snapshot-testing-junit5 + [4.0.6,5.0.0) + test + + + io.github.origin-energy + java-snapshot-testing-plugin-jackson + [4.0.6,5.0.0) + test + + + org.junit.jupiter + junit-jupiter-api + [5.0.0,6.0.0) + test + + + org.junit.jupiter + junit-jupiter-engine + [5.0.0,6.0.0) + test + + + org.slf4j + slf4j-simple + 2.0.0-alpha0 + test + + + +", + "src/main/java/software/aws/infra/Main.java": "package software.aws.infra; + +import software.aws.pdk.cdk_graph.CdkGraph; +import software.aws.pdk.cdk_graph.FilterPreset; +import software.aws.pdk.cdk_graph.Filters; +import software.aws.pdk.cdk_graph.ICdkGraphProps; +import software.aws.pdk.cdk_graph.IFilter; +import software.aws.pdk.cdk_graph.IGraphFilterPlan; +import software.aws.pdk.cdk_graph_plugin_diagram.CdkGraphDiagramPlugin; +import software.aws.pdk.cdk_graph_plugin_diagram.IDiagramConfigBase; +import software.aws.pdk.cdk_graph_plugin_diagram.IPluginConfig; +import software.aws.pdk.pdk_nag.AwsPrototypingChecks; +import software.aws.pdk.pdk_nag.PDKNag; +import software.aws.pdk.pdk_nag.PDKNagAppProps; + +import software.aws.infra.stacks.ApplicationStack; + +import java.util.Arrays; + +import software.amazon.awscdk.App; +import software.amazon.awscdk.Environment; +import software.amazon.awscdk.StackProps; + +public class Main { + public static void main(final String[] args) { + App app = PDKNag.app(PDKNagAppProps.builder() + .nagPacks(Arrays.asList(new AwsPrototypingChecks())) + .build()); + + new ApplicationStack(app, "infra-dev", StackProps.builder() + .env(Environment.builder() + .account(System.getenv("CDK_DEFAULT_ACCOUNT")) + .region(System.getenv("CDK_DEFAULT_REGION")) + .build()) + .build()); + + CdkGraph graph = new CdkGraph(app, ICdkGraphProps.builder() + .plugins(Arrays.asList(new CdkGraphDiagramPlugin(IPluginConfig.builder() + .defaults(IDiagramConfigBase.builder() + .filterPlan(IGraphFilterPlan.builder() + .preset(FilterPreset.COMPACT) + .filters(Arrays.asList(IFilter.builder() + .store(Filters.pruneCustomResources()) + .build())) + .build()) + .build()) + .build()))) + .build()); + + app.synth(); + graph.report(); + } +}", + "src/main/java/software/aws/infra/stacks/ApplicationStack.java": "package software.aws.infra.stacks; + +import software.amazon.awscdk.Stack; +import software.amazon.awscdk.StackProps; +import software.aws.pdk.identity.UserIdentity; +import software.constructs.Construct; + +public class ApplicationStack extends Stack { + public ApplicationStack(Construct scope, String id, StackProps props) { + super(scope, id, props); + + UserIdentity userIdentity = new UserIdentity(this, String.format("%sUserIdentity", id)); + } +} +", + "src/test/java/software/aws/infra/stacks/ApplicationStackTest.java": "package software.aws.infra.stacks; + +import au.com.origin.snapshots.junit5.SnapshotExtension; +import software.amazon.awscdk.App; +import software.amazon.awscdk.assertions.Template; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import au.com.origin.snapshots.Expect; + +// Ensure you extend your test class with the SnapshotExtension +@ExtendWith(SnapshotExtension.class) +public class ApplicationStackTest { + Expect expect; + + @Test + public void myTest() { + App app = new App(); + ApplicationStack stack = new ApplicationStack(app, "test", null); + + Template template = Template.fromStack(stack); + expect.serializer("json").toMatchSnapshot(template.toJSON()); + } +}", + "src/test/resources/snapshot.properties": "serializer=au.com.origin.snapshots.serializers.v1.ToStringSnapshotSerializer +serializer.base64=au.com.origin.snapshots.serializers.v1.Base64SnapshotSerializer +serializer.json=au.com.origin.snapshots.jackson.serializers.v1.JacksonSnapshotSerializer +serializer.orderedJson=au.com.origin.snapshots.jackson.serializers.v1.DeterministicJacksonSnapshotSerializer +comparator=au.com.origin.snapshots.comparators.v1.PlainTextEqualsComparator +reporters=au.com.origin.snapshots.reporters.v1.PlainTextSnapshotReporter +snapshot-dir=__snapshots__ +output-dir=src/test/java +ci-env-var=CI +update-snapshot=none", +} +`; + +exports[`InfrastructureJavaProject With Api 1`] = ` +{ + "infra/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +/.gitattributes linguist-generated +/.gitignore linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/cdk.json linguist-generated +/pom.xml linguist-generated +/project.json linguist-generated", + "infra/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +node_modules/ +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/pom.xml +.classpath +.project +.settings +target +dist/java +!/cdk.json +/cdk.out/ +.cdk.staging/ +!/project.json +", + "infra/.projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": [ + { + "metadata": { + "configuration": { + "release": "11", + }, + }, + "name": "org.apache.maven.plugins/maven-compiler-plugin", + "type": "build", + "version": "3.8.1", + }, + { + "metadata": { + "configuration": { + "rules": [ + { + "requireMavenVersion": [ + { + "version": "3.6", + }, + ], + }, + ], + }, + "executions": [ + { + "goals": [ + "enforce", + ], + "id": "enforce-maven", + }, + ], + }, + "name": "org.apache.maven.plugins/maven-enforcer-plugin", + "type": "build", + "version": "3.0.0-M3", + }, + { + "metadata": { + "configuration": { + "archive": { + "index": true, + "manifest": { + "addDefaultImplementationEntries": true, + "addDefaultSpecificationEntries": true, + }, + }, + }, + }, + "name": "org.apache.maven.plugins/maven-jar-plugin", + "type": "build", + "version": "3.2.0", + }, + { + "metadata": { + "configuration": { + "additionalJOptions": { + "additionalJOption": [ + "-J-XX:+TieredCompilation", + "-J-XX:TieredStopAtLevel=1", + ], + }, + "detectJavaApiLink": false, + "failOnError": false, + "show": "protected", + }, + "executions": [ + { + "goals": [ + "jar", + ], + "id": "attach-javadocs", + }, + ], + }, + "name": "org.apache.maven.plugins/maven-javadoc-plugin", + "type": "build", + "version": "3.2.0", + }, + { + "metadata": { + "executions": [ + { + "goals": [ + "jar", + ], + "id": "attach-sources", + }, + ], + }, + "name": "org.apache.maven.plugins/maven-source-plugin", + "type": "build", + "version": "3.2.1", + }, + { + "name": "org.apache.maven.plugins/maven-surefire-plugin", + "type": "build", + "version": "3.1.2", + }, + { + "name": "com.generated.api/Api-java-infra", + "type": "runtime", + "version": "0.0.0", + }, + { + "name": "software.amazon.awscdk/aws-cdk-lib", + "type": "runtime", + "version": "^2.1.0", + }, + { + "name": "software.aws/pdk", + "type": "runtime", + "version": "^0", + }, + { + "name": "software.constructs/constructs", + "type": "runtime", + "version": "^10.0.5", + }, + { + "name": "io.github.origin-energy/java-snapshot-testing-junit5", + "type": "test", + "version": "^4.0.6", + }, + { + "name": "io.github.origin-energy/java-snapshot-testing-plugin-jackson", + "type": "test", + "version": "^4.0.6", + }, + { + "name": "org.junit.jupiter/junit-jupiter-api", + "type": "test", + "version": "^5", + }, + { + "name": "org.junit.jupiter/junit-jupiter-engine", + "type": "test", + "version": "^5", + }, + { + "name": "org.slf4j/slf4j-simple", + "type": "test", + "version": "2.0.0-alpha0", + }, + ], + }, + "infra/.projen/files.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "files": [ + ".gitattributes", + ".gitignore", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "cdk.json", + "pom.xml", + "project.json", + ], + }, + "infra/.projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "tasks": { + "build": { + "description": "Full release build", + "name": "build", + "steps": [ + { + "spawn": "pre-compile", + }, + { + "spawn": "compile", + }, + { + "spawn": "post-compile", + }, + { + "spawn": "test", + }, + { + "spawn": "package", + }, + ], + }, + "compile": { + "description": "Only compile", + "name": "compile", + "steps": [ + { + "exec": "mvn compiler:compile", + }, + ], + }, + "default": { + "description": "Synthesize project files", + "name": "default", + }, + "deploy": { + "description": "Deploys your CDK app to the AWS cloud", + "name": "deploy", + "steps": [ + { + "exec": "cdk deploy", + "receiveArgs": true, + }, + ], + }, + "destroy": { + "description": "Destroys your cdk app in the AWS cloud", + "name": "destroy", + "steps": [ + { + "exec": "cdk destroy", + "receiveArgs": true, + }, + ], + }, + "diff": { + "description": "Diffs the currently deployed app against your code", + "name": "diff", + "steps": [ + { + "exec": "cdk diff", + }, + ], + }, + "package": { + "description": "Creates the distribution package", + "env": { + "MAVEN_OPTS": "-XX:+TieredCompilation -XX:TieredStopAtLevel=1", + }, + "name": "package", + "steps": [ + { + "exec": "mkdir -p dist/java", + }, + { + "exec": "mvn deploy -D=altDeploymentRepository=local::default::file:///$PWD/dist/java", + }, + ], + }, + "post-compile": { + "description": "Runs after successful compilation", + "name": "post-compile", + "steps": [ + { + "spawn": "synth", + }, + ], + }, + "pre-compile": { + "description": "Prepare the project for compilation", + "name": "pre-compile", + }, + "synth": { + "description": "Synthesizes your cdk app into cdk.out", + "name": "synth", + "steps": [ + { + "exec": "cdk synth", + }, + ], + }, + "synth:silent": { + "description": "Synthesizes your cdk app into cdk.out and suppresses the template in stdout (part of "yarn build")", + "name": "synth:silent", + "steps": [ + { + "exec": "cdk synth -q", + }, + ], + }, + "test": { + "description": "Run tests", + "name": "test", + "steps": [ + { + "exec": "mvn test", + }, + ], + }, + "watch": { + "description": "Watches changes in your source code and rebuilds and deploys to the current account", + "name": "watch", + "steps": [ + { + "exec": "cdk deploy --hotswap", + }, + { + "exec": "cdk watch", + }, + ], + }, + }, + }, + "infra/README.md": "## Getting started + +Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infrastructure/index.html)", + "infra/cdk.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "app": "mvn exec:java --quiet -Dexec.mainClass=software.aws.infra.Main", + "output": "cdk.out", + }, + "infra/pom.xml": " + + 4.0.0 + software.aws.infra + infra + 0.0.0 + jar + WithApi + + UTF-8 + + + + Apijavainfra + file://../api/generated/infrastructure/java/dist/java + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M3 + + + + 3.6 + + + + + + enforce-maven + + enforce + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + true + + true + true + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + false + protected + false + + -J-XX:+TieredCompilation + -J-XX:TieredStopAtLevel=1 + + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + + + + com.generated.api + Api-java-infra + 0.0.0 + + + software.amazon.awscdk + aws-cdk-lib + [2.1.0,3.0.0) + + + software.aws + pdk + (,1.0.0) + + + software.constructs + constructs + [10.0.5,11.0.0) + + + io.github.origin-energy + java-snapshot-testing-junit5 + [4.0.6,5.0.0) + test + + + io.github.origin-energy + java-snapshot-testing-plugin-jackson + [4.0.6,5.0.0) + test + + + org.junit.jupiter + junit-jupiter-api + [5.0.0,6.0.0) + test + + + org.junit.jupiter + junit-jupiter-engine + [5.0.0,6.0.0) + test + + + org.slf4j + slf4j-simple + 2.0.0-alpha0 + test + + + +", + "infra/project.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "implicitDependencies": [ + "Apijavainfra", + ], + "name": "WithApi", + "root": "infra", + "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen build", + "cwd": "infra", + }, + }, + "compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen compile", + "cwd": "infra", + }, + }, + "default": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen default", + "cwd": "infra", + }, + }, + "deploy": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen deploy", + "cwd": "infra", + }, + }, + "destroy": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen destroy", + "cwd": "infra", + }, + }, + "diff": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen diff", + "cwd": "infra", + }, + }, + "package": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen package", + "cwd": "infra", + }, + }, + "post-compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen post-compile", + "cwd": "infra", + }, + }, + "pre-compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen pre-compile", + "cwd": "infra", + }, + }, + "synth": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen synth", + "cwd": "infra", + }, + }, + "synth:silent": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen synth:silent", + "cwd": "infra", + }, + }, + "test": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen test", + "cwd": "infra", + }, + }, + "watch": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen watch", + "cwd": "infra", + }, + }, + }, + }, + "infra/src/main/java/software/aws/infra/Main.java": "package software.aws.infra; + +import software.aws.pdk.cdk_graph.CdkGraph; +import software.aws.pdk.cdk_graph.FilterPreset; +import software.aws.pdk.cdk_graph.Filters; +import software.aws.pdk.cdk_graph.ICdkGraphProps; +import software.aws.pdk.cdk_graph.IFilter; +import software.aws.pdk.cdk_graph.IGraphFilterPlan; +import software.aws.pdk.cdk_graph_plugin_diagram.CdkGraphDiagramPlugin; +import software.aws.pdk.cdk_graph_plugin_diagram.IDiagramConfigBase; +import software.aws.pdk.cdk_graph_plugin_diagram.IPluginConfig; +import software.aws.pdk.pdk_nag.AwsPrototypingChecks; +import software.aws.pdk.pdk_nag.PDKNag; +import software.aws.pdk.pdk_nag.PDKNagAppProps; + +import software.aws.infra.stacks.ApplicationStack; + +import java.util.Arrays; + +import software.amazon.awscdk.App; +import software.amazon.awscdk.Environment; +import software.amazon.awscdk.StackProps; + +public class Main { + public static void main(final String[] args) { + App app = PDKNag.app(PDKNagAppProps.builder() + .nagPacks(Arrays.asList(new AwsPrototypingChecks())) + .build()); + + new ApplicationStack(app, "infra-dev", StackProps.builder() + .env(Environment.builder() + .account(System.getenv("CDK_DEFAULT_ACCOUNT")) + .region(System.getenv("CDK_DEFAULT_REGION")) + .build()) + .build()); + + CdkGraph graph = new CdkGraph(app, ICdkGraphProps.builder() + .plugins(Arrays.asList(new CdkGraphDiagramPlugin(IPluginConfig.builder() + .defaults(IDiagramConfigBase.builder() + .filterPlan(IGraphFilterPlan.builder() + .preset(FilterPreset.COMPACT) + .filters(Arrays.asList(IFilter.builder() + .store(Filters.pruneCustomResources()) + .build())) + .build()) + .build()) + .build()))) + .build()); + + app.synth(); + graph.report(); + } +}", + "infra/src/main/java/software/aws/infra/constructs/ApiConstruct.java": "package software.aws.infra.constructs; + +import com.generated.api.Apijavainfra.infra.Api; +import com.generated.api.Apijavainfra.infra.ApiProps; +import com.generated.api.Apijavainfra.infra.MockIntegrations; + +import java.util.Arrays; + +import software.amazon.awscdk.Stack; +import software.amazon.awscdk.services.apigateway.Cors; +import software.amazon.awscdk.services.apigateway.CorsOptions; +import software.amazon.awscdk.services.iam.AccountPrincipal; +import software.amazon.awscdk.services.iam.AnyPrincipal; +import software.amazon.awscdk.services.iam.Effect; +import software.amazon.awscdk.services.iam.PolicyDocument; +import software.amazon.awscdk.services.iam.PolicyDocumentProps; +import software.amazon.awscdk.services.iam.PolicyStatement; +import software.amazon.awscdk.services.iam.PolicyStatementProps; +import software.aws.pdk.identity.UserIdentity; +import software.aws.pdk.type_safe_api.Authorizers; +import software.constructs.Construct; + +/** + * Infrastructure construct to deploy a Type Safe API. + */ +public class ApiConstruct extends Construct { + /** + * API instance + */ + public final Api api; + + public ApiConstruct(Construct scope, String id, UserIdentity userIdentity) { + super(scope, id); + + this.api = new Api(this, id, ApiProps.builder() + .defaultAuthorizer(Authorizers.iam()) + .corsOptions(CorsOptions.builder() + .allowOrigins(Cors.ALL_ORIGINS) + .allowMethods(Cors.ALL_METHODS) + .build()) + .integrations(MockIntegrations.mockAll().build()) + .policy(new PolicyDocument(PolicyDocumentProps.builder() + .statements(Arrays.asList( + // Here we grant any AWS credentials from the account that the prototype is deployed in to call the api. + // Machine to machine fine-grained access can be defined here using more specific principals (eg roles or + // users) and resources (ie which api paths may be invoked by which principal) if required. + // If doing so, the cognito identity pool authenticated role must still be granted access for cognito users to + // still be granted access to the API. + new PolicyStatement(PolicyStatementProps.builder() + .effect(Effect.ALLOW) + .principals(Arrays.asList(new AccountPrincipal(Stack.of(this).getAccount()))) + .actions(Arrays.asList("execute-api:Invoke")) + .resources(Arrays.asList("execute-api:/*")) + .build()), + // Open up OPTIONS to allow browsers to make unauthenticated preflight requests + new PolicyStatement(PolicyStatementProps.builder() + .effect(Effect.ALLOW) + .principals(Arrays.asList(new AnyPrincipal())) + .actions(Arrays.asList("execute-api:Invoke")) + .resources(Arrays.asList("execute-api:/*/OPTIONS/*")) + .build()) + )) + .build())) + .build()); + + userIdentity.getIdentityPool().getAuthenticatedRole() + .addToPrincipalPolicy(new PolicyStatement(PolicyStatementProps.builder() + .effect(Effect.ALLOW) + .actions(Arrays.asList("execute-api:Invoke")) + .resources(Arrays.asList(this.api.getApi().arnForExecuteApi("*", "/*", "*"))) + .build())); + } +} +", + "infra/src/main/java/software/aws/infra/stacks/ApplicationStack.java": "package software.aws.infra.stacks; + +import software.amazon.awscdk.Stack; +import software.amazon.awscdk.StackProps; +import software.aws.infra.constructs.ApiConstruct; +import software.aws.pdk.identity.UserIdentity; +import software.constructs.Construct; + +public class ApplicationStack extends Stack { + public ApplicationStack(Construct scope, String id, StackProps props) { + super(scope, id, props); + + UserIdentity userIdentity = new UserIdentity(this, String.format("%sUserIdentity", id)); + new ApiConstruct(this, "Api", userIdentity); + } +} +", + "infra/src/test/java/software/aws/infra/stacks/ApplicationStackTest.java": "package software.aws.infra.stacks; + +import au.com.origin.snapshots.junit5.SnapshotExtension; +import software.amazon.awscdk.App; +import software.amazon.awscdk.assertions.Template; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import au.com.origin.snapshots.Expect; + +// Ensure you extend your test class with the SnapshotExtension +@ExtendWith(SnapshotExtension.class) +public class ApplicationStackTest { + Expect expect; + + @Test + public void myTest() { + App app = new App(); + ApplicationStack stack = new ApplicationStack(app, "test", null); + + Template template = Template.fromStack(stack); + expect.serializer("json").toMatchSnapshot(template.toJSON()); + } +}", + "infra/src/test/resources/snapshot.properties": "serializer=au.com.origin.snapshots.serializers.v1.ToStringSnapshotSerializer +serializer.base64=au.com.origin.snapshots.serializers.v1.Base64SnapshotSerializer +serializer.json=au.com.origin.snapshots.jackson.serializers.v1.JacksonSnapshotSerializer +serializer.orderedJson=au.com.origin.snapshots.jackson.serializers.v1.DeterministicJacksonSnapshotSerializer +comparator=au.com.origin.snapshots.comparators.v1.PlainTextEqualsComparator +reporters=au.com.origin.snapshots.reporters.v1.PlainTextSnapshotReporter +snapshot-dir=__snapshots__ +output-dir=src/test/java +ci-env-var=CI +update-snapshot=none", +} +`; + +exports[`InfrastructureJavaProject With Api and Website 1`] = ` +{ + "infra/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +/.gitattributes linguist-generated +/.gitignore linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/cdk.json linguist-generated +/pom.xml linguist-generated +/project.json linguist-generated", + "infra/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +node_modules/ +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/pom.xml +.classpath +.project +.settings +target +dist/java +!/cdk.json +/cdk.out/ +.cdk.staging/ +!/project.json +", + "infra/.projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": [ + { + "metadata": { + "configuration": { + "release": "11", + }, + }, + "name": "org.apache.maven.plugins/maven-compiler-plugin", + "type": "build", + "version": "3.8.1", + }, + { + "metadata": { + "configuration": { + "rules": [ + { + "requireMavenVersion": [ + { + "version": "3.6", + }, + ], + }, + ], + }, + "executions": [ + { + "goals": [ + "enforce", + ], + "id": "enforce-maven", + }, + ], + }, + "name": "org.apache.maven.plugins/maven-enforcer-plugin", + "type": "build", + "version": "3.0.0-M3", + }, + { + "metadata": { + "configuration": { + "archive": { + "index": true, + "manifest": { + "addDefaultImplementationEntries": true, + "addDefaultSpecificationEntries": true, + }, + }, + }, + }, + "name": "org.apache.maven.plugins/maven-jar-plugin", + "type": "build", + "version": "3.2.0", + }, + { + "metadata": { + "configuration": { + "additionalJOptions": { + "additionalJOption": [ + "-J-XX:+TieredCompilation", + "-J-XX:TieredStopAtLevel=1", + ], + }, + "detectJavaApiLink": false, + "failOnError": false, + "show": "protected", + }, + "executions": [ + { + "goals": [ + "jar", + ], + "id": "attach-javadocs", + }, + ], + }, + "name": "org.apache.maven.plugins/maven-javadoc-plugin", + "type": "build", + "version": "3.2.0", + }, + { + "metadata": { + "executions": [ + { + "goals": [ + "jar", + ], + "id": "attach-sources", + }, + ], + }, + "name": "org.apache.maven.plugins/maven-source-plugin", + "type": "build", + "version": "3.2.1", + }, + { + "name": "org.apache.maven.plugins/maven-surefire-plugin", + "type": "build", + "version": "3.1.2", + }, + { + "name": "com.generated.api/Api-java-infra", + "type": "runtime", + "version": "0.0.0", + }, + { + "name": "software.amazon.awscdk/aws-cdk-lib", + "type": "runtime", + "version": "^2.1.0", + }, + { + "name": "software.aws/pdk", + "type": "runtime", + "version": "^0", + }, + { + "name": "software.constructs/constructs", + "type": "runtime", + "version": "^10.0.5", + }, + { + "name": "io.github.origin-energy/java-snapshot-testing-junit5", + "type": "test", + "version": "^4.0.6", + }, + { + "name": "io.github.origin-energy/java-snapshot-testing-plugin-jackson", + "type": "test", + "version": "^4.0.6", + }, + { + "name": "org.junit.jupiter/junit-jupiter-api", + "type": "test", + "version": "^5", + }, + { + "name": "org.junit.jupiter/junit-jupiter-engine", + "type": "test", + "version": "^5", + }, + { + "name": "org.slf4j/slf4j-simple", + "type": "test", + "version": "2.0.0-alpha0", + }, + ], + }, + "infra/.projen/files.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "files": [ + ".gitattributes", + ".gitignore", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "cdk.json", + "pom.xml", + "project.json", + ], + }, + "infra/.projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "tasks": { + "build": { + "description": "Full release build", + "name": "build", + "steps": [ + { + "spawn": "pre-compile", + }, + { + "spawn": "compile", + }, + { + "spawn": "post-compile", + }, + { + "spawn": "test", + }, + { + "spawn": "package", + }, + ], + }, + "compile": { + "description": "Only compile", + "name": "compile", + "steps": [ + { + "exec": "mvn compiler:compile", + }, + ], + }, + "default": { + "description": "Synthesize project files", + "name": "default", + }, + "deploy": { + "description": "Deploys your CDK app to the AWS cloud", + "name": "deploy", + "steps": [ + { + "exec": "cdk deploy", + "receiveArgs": true, + }, + ], + }, + "destroy": { + "description": "Destroys your cdk app in the AWS cloud", + "name": "destroy", + "steps": [ + { + "exec": "cdk destroy", + "receiveArgs": true, + }, + ], + }, + "diff": { + "description": "Diffs the currently deployed app against your code", + "name": "diff", + "steps": [ + { + "exec": "cdk diff", + }, + ], + }, + "package": { + "description": "Creates the distribution package", + "env": { + "MAVEN_OPTS": "-XX:+TieredCompilation -XX:TieredStopAtLevel=1", + }, + "name": "package", + "steps": [ + { + "exec": "mkdir -p dist/java", + }, + { + "exec": "mvn deploy -D=altDeploymentRepository=local::default::file:///$PWD/dist/java", + }, + ], + }, + "post-compile": { + "description": "Runs after successful compilation", + "name": "post-compile", + "steps": [ + { + "spawn": "synth", + }, + ], + }, + "pre-compile": { + "description": "Prepare the project for compilation", + "name": "pre-compile", + }, + "synth": { + "description": "Synthesizes your cdk app into cdk.out", + "name": "synth", + "steps": [ + { + "exec": "cdk synth", + }, + ], + }, + "synth:silent": { + "description": "Synthesizes your cdk app into cdk.out and suppresses the template in stdout (part of "yarn build")", + "name": "synth:silent", + "steps": [ + { + "exec": "cdk synth -q", + }, + ], + }, + "test": { + "description": "Run tests", + "name": "test", + "steps": [ + { + "exec": "mvn test", + }, + ], + }, + "watch": { + "description": "Watches changes in your source code and rebuilds and deploys to the current account", + "name": "watch", + "steps": [ + { + "exec": "cdk deploy --hotswap", + }, + { + "exec": "cdk watch", + }, + ], + }, + }, + }, + "infra/README.md": "## Getting started + +Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infrastructure/index.html)", + "infra/cdk.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "app": "mvn exec:java --quiet -Dexec.mainClass=software.aws.infra.Main", + "output": "cdk.out", + }, + "infra/pom.xml": " + + 4.0.0 + software.aws.infra + infra + 0.0.0 + jar + WithApi + + UTF-8 + + + + Apijavainfra + file://../api/generated/infrastructure/java/dist/java + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M3 + + + + 3.6 + + + + + + enforce-maven + + enforce + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + true + + true + true + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + false + protected + false + + -J-XX:+TieredCompilation + -J-XX:TieredStopAtLevel=1 + + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + + + + com.generated.api + Api-java-infra + 0.0.0 + + + software.amazon.awscdk + aws-cdk-lib + [2.1.0,3.0.0) + + + software.aws + pdk + (,1.0.0) + + + software.constructs + constructs + [10.0.5,11.0.0) + + + io.github.origin-energy + java-snapshot-testing-junit5 + [4.0.6,5.0.0) + test + + + io.github.origin-energy + java-snapshot-testing-plugin-jackson + [4.0.6,5.0.0) + test + + + org.junit.jupiter + junit-jupiter-api + [5.0.0,6.0.0) + test + + + org.junit.jupiter + junit-jupiter-engine + [5.0.0,6.0.0) + test + + + org.slf4j + slf4j-simple + 2.0.0-alpha0 + test + + + +", + "infra/project.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "implicitDependencies": [ + "Apijavainfra", + "Website", + ], + "name": "WithApi", + "root": "infra", + "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen build", + "cwd": "infra", + }, + }, + "compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen compile", + "cwd": "infra", + }, + }, + "default": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen default", + "cwd": "infra", + }, + }, + "deploy": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen deploy", + "cwd": "infra", + }, + }, + "destroy": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen destroy", + "cwd": "infra", + }, + }, + "diff": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen diff", + "cwd": "infra", + }, + }, + "package": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen package", + "cwd": "infra", + }, + }, + "post-compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen post-compile", + "cwd": "infra", + }, + }, + "pre-compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen pre-compile", + "cwd": "infra", + }, + }, + "synth": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen synth", + "cwd": "infra", + }, + }, + "synth:silent": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen synth:silent", + "cwd": "infra", + }, + }, + "test": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen test", + "cwd": "infra", + }, + }, + "watch": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen watch", + "cwd": "infra", + }, + }, + }, + }, + "infra/src/main/java/software/aws/infra/Main.java": "package software.aws.infra; + +import software.aws.pdk.cdk_graph.CdkGraph; +import software.aws.pdk.cdk_graph.FilterPreset; +import software.aws.pdk.cdk_graph.Filters; +import software.aws.pdk.cdk_graph.ICdkGraphProps; +import software.aws.pdk.cdk_graph.IFilter; +import software.aws.pdk.cdk_graph.IGraphFilterPlan; +import software.aws.pdk.cdk_graph_plugin_diagram.CdkGraphDiagramPlugin; +import software.aws.pdk.cdk_graph_plugin_diagram.IDiagramConfigBase; +import software.aws.pdk.cdk_graph_plugin_diagram.IPluginConfig; +import software.aws.pdk.pdk_nag.AwsPrototypingChecks; +import software.aws.pdk.pdk_nag.PDKNag; +import software.aws.pdk.pdk_nag.PDKNagAppProps; + +import software.aws.infra.stacks.ApplicationStack; + +import java.util.Arrays; + +import software.amazon.awscdk.App; +import software.amazon.awscdk.Environment; +import software.amazon.awscdk.StackProps; + +public class Main { + public static void main(final String[] args) { + App app = PDKNag.app(PDKNagAppProps.builder() + .nagPacks(Arrays.asList(new AwsPrototypingChecks())) + .build()); + + new ApplicationStack(app, "infra-dev", StackProps.builder() + .env(Environment.builder() + .account(System.getenv("CDK_DEFAULT_ACCOUNT")) + .region(System.getenv("CDK_DEFAULT_REGION")) + .build()) + .build()); + + CdkGraph graph = new CdkGraph(app, ICdkGraphProps.builder() + .plugins(Arrays.asList(new CdkGraphDiagramPlugin(IPluginConfig.builder() + .defaults(IDiagramConfigBase.builder() + .filterPlan(IGraphFilterPlan.builder() + .preset(FilterPreset.COMPACT) + .filters(Arrays.asList(IFilter.builder() + .store(Filters.pruneCustomResources()) + .build())) + .build()) + .build()) + .build()))) + .build()); + + app.synth(); + graph.report(); + } +}", + "infra/src/main/java/software/aws/infra/constructs/ApiConstruct.java": "package software.aws.infra.constructs; + +import com.generated.api.Apijavainfra.infra.Api; +import com.generated.api.Apijavainfra.infra.ApiProps; +import com.generated.api.Apijavainfra.infra.MockIntegrations; + +import java.util.Arrays; + +import software.amazon.awscdk.Stack; +import software.amazon.awscdk.services.apigateway.Cors; +import software.amazon.awscdk.services.apigateway.CorsOptions; +import software.amazon.awscdk.services.iam.AccountPrincipal; +import software.amazon.awscdk.services.iam.AnyPrincipal; +import software.amazon.awscdk.services.iam.Effect; +import software.amazon.awscdk.services.iam.PolicyDocument; +import software.amazon.awscdk.services.iam.PolicyDocumentProps; +import software.amazon.awscdk.services.iam.PolicyStatement; +import software.amazon.awscdk.services.iam.PolicyStatementProps; +import software.aws.pdk.identity.UserIdentity; +import software.aws.pdk.type_safe_api.Authorizers; +import software.constructs.Construct; + +/** + * Infrastructure construct to deploy a Type Safe API. + */ +public class ApiConstruct extends Construct { + /** + * API instance + */ + public final Api api; + + public ApiConstruct(Construct scope, String id, UserIdentity userIdentity) { + super(scope, id); + + this.api = new Api(this, id, ApiProps.builder() + .defaultAuthorizer(Authorizers.iam()) + .corsOptions(CorsOptions.builder() + .allowOrigins(Cors.ALL_ORIGINS) + .allowMethods(Cors.ALL_METHODS) + .build()) + .integrations(MockIntegrations.mockAll().build()) + .policy(new PolicyDocument(PolicyDocumentProps.builder() + .statements(Arrays.asList( + // Here we grant any AWS credentials from the account that the prototype is deployed in to call the api. + // Machine to machine fine-grained access can be defined here using more specific principals (eg roles or + // users) and resources (ie which api paths may be invoked by which principal) if required. + // If doing so, the cognito identity pool authenticated role must still be granted access for cognito users to + // still be granted access to the API. + new PolicyStatement(PolicyStatementProps.builder() + .effect(Effect.ALLOW) + .principals(Arrays.asList(new AccountPrincipal(Stack.of(this).getAccount()))) + .actions(Arrays.asList("execute-api:Invoke")) + .resources(Arrays.asList("execute-api:/*")) + .build()), + // Open up OPTIONS to allow browsers to make unauthenticated preflight requests + new PolicyStatement(PolicyStatementProps.builder() + .effect(Effect.ALLOW) + .principals(Arrays.asList(new AnyPrincipal())) + .actions(Arrays.asList("execute-api:Invoke")) + .resources(Arrays.asList("execute-api:/*/OPTIONS/*")) + .build()) + )) + .build())) + .build()); + + userIdentity.getIdentityPool().getAuthenticatedRole() + .addToPrincipalPolicy(new PolicyStatement(PolicyStatementProps.builder() + .effect(Effect.ALLOW) + .actions(Arrays.asList("execute-api:Invoke")) + .resources(Arrays.asList(this.api.getApi().arnForExecuteApi("*", "/*", "*"))) + .build())); + } +} +", + "infra/src/main/java/software/aws/infra/constructs/WebsiteConstruct.java": "package software.aws.infra.constructs; + +import java.util.Map; +import java.util.TreeMap; + +import software.amazon.awscdk.Stack; +import software.amazon.awscdk.services.cloudfront.GeoRestriction; +import software.aws.pdk.identity.UserIdentity; +import software.aws.pdk.static_website.DistributionProps; +import software.aws.pdk.static_website.RuntimeOptions; +import software.aws.pdk.static_website.StaticWebsite; +import software.aws.pdk.static_website.StaticWebsiteProps; +import software.constructs.Construct; + +/** + * Construct to deploy a Static Website + */ +public class WebsiteConstruct extends Construct { + + public WebsiteConstruct(Construct scope, String id, UserIdentity userIdentity, ApiConstruct apiConstruct) { + super(scope, id); + + new StaticWebsite(this, id, StaticWebsiteProps.builder() + .websiteContentPath("../website/build") + .runtimeOptions(RuntimeOptions.builder() + .jsonPayload(new TreeMap<>(Map.of( + "region", Stack.of(this).getRegion(), + "identityPoolId", userIdentity.getIdentityPool().getIdentityPoolId(), + "userPoolId", userIdentity.getUserPool().getUserPoolId(), + "userPoolWebClientId", userIdentity.getUserPoolClient().getUserPoolClientId(), + "apiUrl", apiConstruct.api.getApi().urlForPath() + ))) + .build()) + .distributionProps(DistributionProps.builder() + .geoRestriction(GeoRestriction.allowlist( + "AU", + "ID", + "IN", + "JP", + "KR", + "SG", + "US")) + .build()) + .build()); + } +} +", + "infra/src/main/java/software/aws/infra/stacks/ApplicationStack.java": "package software.aws.infra.stacks; + +import software.amazon.awscdk.Stack; +import software.amazon.awscdk.StackProps; +import software.aws.infra.constructs.ApiConstruct; +import software.aws.infra.constructs.WebsiteConstruct; +import software.aws.pdk.identity.UserIdentity; +import software.constructs.Construct; + +public class ApplicationStack extends Stack { + public ApplicationStack(Construct scope, String id, StackProps props) { + super(scope, id, props); + + UserIdentity userIdentity = new UserIdentity(this, String.format("%sUserIdentity", id)); + ApiConstruct apiConstruct = new ApiConstruct(this, "Api", userIdentity); + new WebsiteConstruct(this, "Website", userIdentity, apiConstruct); + } +} +", + "infra/src/test/java/software/aws/infra/stacks/ApplicationStackTest.java": "package software.aws.infra.stacks; + +import au.com.origin.snapshots.junit5.SnapshotExtension; +import software.amazon.awscdk.App; +import software.amazon.awscdk.assertions.Template; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import au.com.origin.snapshots.Expect; + +// Ensure you extend your test class with the SnapshotExtension +@ExtendWith(SnapshotExtension.class) +public class ApplicationStackTest { + Expect expect; + + @Test + public void myTest() { + App app = new App(); + ApplicationStack stack = new ApplicationStack(app, "test", null); + + Template template = Template.fromStack(stack); + expect.serializer("json").toMatchSnapshot(template.toJSON()); + } +}", + "infra/src/test/resources/snapshot.properties": "serializer=au.com.origin.snapshots.serializers.v1.ToStringSnapshotSerializer +serializer.base64=au.com.origin.snapshots.serializers.v1.Base64SnapshotSerializer +serializer.json=au.com.origin.snapshots.jackson.serializers.v1.JacksonSnapshotSerializer +serializer.orderedJson=au.com.origin.snapshots.jackson.serializers.v1.DeterministicJacksonSnapshotSerializer +comparator=au.com.origin.snapshots.comparators.v1.PlainTextEqualsComparator +reporters=au.com.origin.snapshots.reporters.v1.PlainTextSnapshotReporter +snapshot-dir=__snapshots__ +output-dir=src/test/java +ci-env-var=CI +update-snapshot=none", +} +`; + +exports[`InfrastructureJavaProject With Website 1`] = ` +{ + "infra/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +/.gitattributes linguist-generated +/.gitignore linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/cdk.json linguist-generated +/pom.xml linguist-generated +/project.json linguist-generated", + "infra/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +node_modules/ +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/pom.xml +.classpath +.project +.settings +target +dist/java +!/cdk.json +/cdk.out/ +.cdk.staging/ +!/project.json +", + "infra/.projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": [ + { + "metadata": { + "configuration": { + "release": "11", + }, + }, + "name": "org.apache.maven.plugins/maven-compiler-plugin", + "type": "build", + "version": "3.8.1", + }, + { + "metadata": { + "configuration": { + "rules": [ + { + "requireMavenVersion": [ + { + "version": "3.6", + }, + ], + }, + ], + }, + "executions": [ + { + "goals": [ + "enforce", + ], + "id": "enforce-maven", + }, + ], + }, + "name": "org.apache.maven.plugins/maven-enforcer-plugin", + "type": "build", + "version": "3.0.0-M3", + }, + { + "metadata": { + "configuration": { + "archive": { + "index": true, + "manifest": { + "addDefaultImplementationEntries": true, + "addDefaultSpecificationEntries": true, + }, + }, + }, + }, + "name": "org.apache.maven.plugins/maven-jar-plugin", + "type": "build", + "version": "3.2.0", + }, + { + "metadata": { + "configuration": { + "additionalJOptions": { + "additionalJOption": [ + "-J-XX:+TieredCompilation", + "-J-XX:TieredStopAtLevel=1", + ], + }, + "detectJavaApiLink": false, + "failOnError": false, + "show": "protected", + }, + "executions": [ + { + "goals": [ + "jar", + ], + "id": "attach-javadocs", + }, + ], + }, + "name": "org.apache.maven.plugins/maven-javadoc-plugin", + "type": "build", + "version": "3.2.0", + }, + { + "metadata": { + "executions": [ + { + "goals": [ + "jar", + ], + "id": "attach-sources", + }, + ], + }, + "name": "org.apache.maven.plugins/maven-source-plugin", + "type": "build", + "version": "3.2.1", + }, + { + "name": "org.apache.maven.plugins/maven-surefire-plugin", + "type": "build", + "version": "3.1.2", + }, + { + "name": "software.amazon.awscdk/aws-cdk-lib", + "type": "runtime", + "version": "^2.1.0", + }, + { + "name": "software.aws/pdk", + "type": "runtime", + "version": "^0", + }, + { + "name": "software.constructs/constructs", + "type": "runtime", + "version": "^10.0.5", + }, + { + "name": "io.github.origin-energy/java-snapshot-testing-junit5", + "type": "test", + "version": "^4.0.6", + }, + { + "name": "io.github.origin-energy/java-snapshot-testing-plugin-jackson", + "type": "test", + "version": "^4.0.6", + }, + { + "name": "org.junit.jupiter/junit-jupiter-api", + "type": "test", + "version": "^5", + }, + { + "name": "org.junit.jupiter/junit-jupiter-engine", + "type": "test", + "version": "^5", + }, + { + "name": "org.slf4j/slf4j-simple", + "type": "test", + "version": "2.0.0-alpha0", + }, + ], + }, + "infra/.projen/files.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "files": [ + ".gitattributes", + ".gitignore", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "cdk.json", + "pom.xml", + "project.json", + ], + }, + "infra/.projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "tasks": { + "build": { + "description": "Full release build", + "name": "build", + "steps": [ + { + "spawn": "pre-compile", + }, + { + "spawn": "compile", + }, + { + "spawn": "post-compile", + }, + { + "spawn": "test", + }, + { + "spawn": "package", + }, + ], + }, + "compile": { + "description": "Only compile", + "name": "compile", + "steps": [ + { + "exec": "mvn compiler:compile", + }, + ], + }, + "default": { + "description": "Synthesize project files", + "name": "default", + }, + "deploy": { + "description": "Deploys your CDK app to the AWS cloud", + "name": "deploy", + "steps": [ + { + "exec": "cdk deploy", + "receiveArgs": true, + }, + ], + }, + "destroy": { + "description": "Destroys your cdk app in the AWS cloud", + "name": "destroy", + "steps": [ + { + "exec": "cdk destroy", + "receiveArgs": true, + }, + ], + }, + "diff": { + "description": "Diffs the currently deployed app against your code", + "name": "diff", + "steps": [ + { + "exec": "cdk diff", + }, + ], + }, + "package": { + "description": "Creates the distribution package", + "env": { + "MAVEN_OPTS": "-XX:+TieredCompilation -XX:TieredStopAtLevel=1", + }, + "name": "package", + "steps": [ + { + "exec": "mkdir -p dist/java", + }, + { + "exec": "mvn deploy -D=altDeploymentRepository=local::default::file:///$PWD/dist/java", + }, + ], + }, + "post-compile": { + "description": "Runs after successful compilation", + "name": "post-compile", + "steps": [ + { + "spawn": "synth", + }, + ], + }, + "pre-compile": { + "description": "Prepare the project for compilation", + "name": "pre-compile", + }, + "synth": { + "description": "Synthesizes your cdk app into cdk.out", + "name": "synth", + "steps": [ + { + "exec": "cdk synth", + }, + ], + }, + "synth:silent": { + "description": "Synthesizes your cdk app into cdk.out and suppresses the template in stdout (part of "yarn build")", + "name": "synth:silent", + "steps": [ + { + "exec": "cdk synth -q", + }, + ], + }, + "test": { + "description": "Run tests", + "name": "test", + "steps": [ + { + "exec": "mvn test", + }, + ], + }, + "watch": { + "description": "Watches changes in your source code and rebuilds and deploys to the current account", + "name": "watch", + "steps": [ + { + "exec": "cdk deploy --hotswap", + }, + { + "exec": "cdk watch", + }, + ], + }, + }, + }, + "infra/README.md": "## Getting started + +Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infrastructure/index.html)", + "infra/cdk.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "app": "mvn exec:java --quiet -Dexec.mainClass=software.aws.infra.Main", + "output": "cdk.out", + }, + "infra/pom.xml": " + + 4.0.0 + software.aws.infra + infra + 0.0.0 + jar + WithApi + + UTF-8 + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M3 + + + + 3.6 + + + + + + enforce-maven + + enforce + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + true + + true + true + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + false + protected + false + + -J-XX:+TieredCompilation + -J-XX:TieredStopAtLevel=1 + + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + + + + + software.amazon.awscdk + aws-cdk-lib + [2.1.0,3.0.0) + + + software.aws + pdk + (,1.0.0) + + + software.constructs + constructs + [10.0.5,11.0.0) + + + io.github.origin-energy + java-snapshot-testing-junit5 + [4.0.6,5.0.0) + test + + + io.github.origin-energy + java-snapshot-testing-plugin-jackson + [4.0.6,5.0.0) + test + + + org.junit.jupiter + junit-jupiter-api + [5.0.0,6.0.0) + test + + + org.junit.jupiter + junit-jupiter-engine + [5.0.0,6.0.0) + test + + + org.slf4j + slf4j-simple + 2.0.0-alpha0 + test + + + +", + "infra/project.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "implicitDependencies": [ + "Website", + ], + "name": "WithApi", + "root": "infra", + "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen build", + "cwd": "infra", + }, + }, + "compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen compile", + "cwd": "infra", + }, + }, + "default": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen default", + "cwd": "infra", + }, + }, + "deploy": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen deploy", + "cwd": "infra", + }, + }, + "destroy": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen destroy", + "cwd": "infra", + }, + }, + "diff": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen diff", + "cwd": "infra", + }, + }, + "package": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen package", + "cwd": "infra", + }, + }, + "post-compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen post-compile", + "cwd": "infra", + }, + }, + "pre-compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen pre-compile", + "cwd": "infra", + }, + }, + "synth": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen synth", + "cwd": "infra", + }, + }, + "synth:silent": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen synth:silent", + "cwd": "infra", + }, + }, + "test": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen test", + "cwd": "infra", + }, + }, + "watch": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen watch", + "cwd": "infra", + }, + }, + }, + }, + "infra/src/main/java/software/aws/infra/Main.java": "package software.aws.infra; + +import software.aws.pdk.cdk_graph.CdkGraph; +import software.aws.pdk.cdk_graph.FilterPreset; +import software.aws.pdk.cdk_graph.Filters; +import software.aws.pdk.cdk_graph.ICdkGraphProps; +import software.aws.pdk.cdk_graph.IFilter; +import software.aws.pdk.cdk_graph.IGraphFilterPlan; +import software.aws.pdk.cdk_graph_plugin_diagram.CdkGraphDiagramPlugin; +import software.aws.pdk.cdk_graph_plugin_diagram.IDiagramConfigBase; +import software.aws.pdk.cdk_graph_plugin_diagram.IPluginConfig; +import software.aws.pdk.pdk_nag.AwsPrototypingChecks; +import software.aws.pdk.pdk_nag.PDKNag; +import software.aws.pdk.pdk_nag.PDKNagAppProps; + +import software.aws.infra.stacks.ApplicationStack; + +import java.util.Arrays; + +import software.amazon.awscdk.App; +import software.amazon.awscdk.Environment; +import software.amazon.awscdk.StackProps; + +public class Main { + public static void main(final String[] args) { + App app = PDKNag.app(PDKNagAppProps.builder() + .nagPacks(Arrays.asList(new AwsPrototypingChecks())) + .build()); + + new ApplicationStack(app, "infra-dev", StackProps.builder() + .env(Environment.builder() + .account(System.getenv("CDK_DEFAULT_ACCOUNT")) + .region(System.getenv("CDK_DEFAULT_REGION")) + .build()) + .build()); + + CdkGraph graph = new CdkGraph(app, ICdkGraphProps.builder() + .plugins(Arrays.asList(new CdkGraphDiagramPlugin(IPluginConfig.builder() + .defaults(IDiagramConfigBase.builder() + .filterPlan(IGraphFilterPlan.builder() + .preset(FilterPreset.COMPACT) + .filters(Arrays.asList(IFilter.builder() + .store(Filters.pruneCustomResources()) + .build())) + .build()) + .build()) + .build()))) + .build()); + + app.synth(); + graph.report(); + } +}", + "infra/src/main/java/software/aws/infra/constructs/WebsiteConstruct.java": "package software.aws.infra.constructs; + +import java.util.Map; +import java.util.TreeMap; + +import software.amazon.awscdk.Stack; +import software.amazon.awscdk.services.cloudfront.GeoRestriction; +import software.aws.pdk.identity.UserIdentity; +import software.aws.pdk.static_website.DistributionProps; +import software.aws.pdk.static_website.RuntimeOptions; +import software.aws.pdk.static_website.StaticWebsite; +import software.aws.pdk.static_website.StaticWebsiteProps; +import software.constructs.Construct; + +/** + * Construct to deploy a Static Website + */ +public class WebsiteConstruct extends Construct { + + public WebsiteConstruct(Construct scope, String id, UserIdentity userIdentity/* , ApiConstruct apiConstruct */) { + super(scope, id); + + new StaticWebsite(this, id, StaticWebsiteProps.builder() + .websiteContentPath("../website/build") + .runtimeOptions(RuntimeOptions.builder() + .jsonPayload(new TreeMap<>(Map.of( + "region", Stack.of(this).getRegion(), + "identityPoolId", userIdentity.getIdentityPool().getIdentityPoolId(), + "userPoolId", userIdentity.getUserPool().getUserPoolId(), + "userPoolWebClientId", userIdentity.getUserPoolClient().getUserPoolClientId() + // "apiUrl", apiConstruct.api.getApi().urlForPath() + ))) + .build()) + .distributionProps(DistributionProps.builder() + .geoRestriction(GeoRestriction.allowlist( + "AU", + "ID", + "IN", + "JP", + "KR", + "SG", + "US")) + .build()) + .build()); + } +} +", + "infra/src/main/java/software/aws/infra/stacks/ApplicationStack.java": "package software.aws.infra.stacks; + +import software.amazon.awscdk.Stack; +import software.amazon.awscdk.StackProps; +import software.aws.infra.constructs.WebsiteConstruct; +import software.aws.pdk.identity.UserIdentity; +import software.constructs.Construct; + +public class ApplicationStack extends Stack { + public ApplicationStack(Construct scope, String id, StackProps props) { + super(scope, id, props); + + UserIdentity userIdentity = new UserIdentity(this, String.format("%sUserIdentity", id)); + new WebsiteConstruct(this, "Website", userIdentity); + } +} +", + "infra/src/test/java/software/aws/infra/stacks/ApplicationStackTest.java": "package software.aws.infra.stacks; + +import au.com.origin.snapshots.junit5.SnapshotExtension; +import software.amazon.awscdk.App; +import software.amazon.awscdk.assertions.Template; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import au.com.origin.snapshots.Expect; + +// Ensure you extend your test class with the SnapshotExtension +@ExtendWith(SnapshotExtension.class) +public class ApplicationStackTest { + Expect expect; + + @Test + public void myTest() { + App app = new App(); + ApplicationStack stack = new ApplicationStack(app, "test", null); + + Template template = Template.fromStack(stack); + expect.serializer("json").toMatchSnapshot(template.toJSON()); + } +}", + "infra/src/test/resources/snapshot.properties": "serializer=au.com.origin.snapshots.serializers.v1.ToStringSnapshotSerializer +serializer.base64=au.com.origin.snapshots.serializers.v1.Base64SnapshotSerializer +serializer.json=au.com.origin.snapshots.jackson.serializers.v1.JacksonSnapshotSerializer +serializer.orderedJson=au.com.origin.snapshots.jackson.serializers.v1.DeterministicJacksonSnapshotSerializer +comparator=au.com.origin.snapshots.comparators.v1.PlainTextEqualsComparator +reporters=au.com.origin.snapshots.reporters.v1.PlainTextSnapshotReporter +snapshot-dir=__snapshots__ +output-dir=src/test/java +ci-env-var=CI +update-snapshot=none", +} +`; diff --git a/packages/infrastructure/test/projects/java/infrastructure-java-project.test.ts b/packages/infrastructure/test/projects/java/infrastructure-java-project.test.ts new file mode 100644 index 000000000..eeecf08f2 --- /dev/null +++ b/packages/infrastructure/test/projects/java/infrastructure-java-project.test.ts @@ -0,0 +1,58 @@ +/*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 */ +import { Language } from "@aws/type-safe-api"; +import { synthSnapshot } from "projen/lib/util/synth"; +import { + InfrastructureJavaProject, + InfrastructureJavaProjectOptions, +} from "../../../src"; +import { + BuildOptionsProps, + snapshotInfrastructureProject, +} from "../utils/snapshot-infra-project"; + +describe("InfrastructureJavaProject", () => { + const snapshot = ( + buildOptions: (props: BuildOptionsProps) => InfrastructureJavaProjectOptions + ) => + snapshotInfrastructureProject( + Language.JAVA, + InfrastructureJavaProject, + buildOptions + ); + + it("Defaults", () => { + const project = new InfrastructureJavaProject({ + name: "Defaults", + }); + expect(synthSnapshot(project)).toMatchSnapshot(); + }); + + it("With Api", () => { + expect( + snapshot(({ typeSafeApi }) => ({ + name: "WithApi", + typeSafeApi, + })) + ).toMatchSnapshot(); + }); + + it("With Website", () => { + expect( + snapshot(({ cloudscapeReactTsWebsite }) => ({ + name: "WithApi", + cloudscapeReactTsWebsite, + })) + ).toMatchSnapshot(); + }); + + it("With Api and Website", () => { + expect( + snapshot(({ cloudscapeReactTsWebsite, typeSafeApi }) => ({ + name: "WithApi", + typeSafeApi, + cloudscapeReactTsWebsite, + })) + ).toMatchSnapshot(); + }); +}); diff --git a/packages/infrastructure/test/projects/python/__snapshots__/infrastructure-py-project.test.ts.snap b/packages/infrastructure/test/projects/python/__snapshots__/infrastructure-py-project.test.ts.snap new file mode 100644 index 000000000..8df0b65fe --- /dev/null +++ b/packages/infrastructure/test/projects/python/__snapshots__/infrastructure-py-project.test.ts.snap @@ -0,0 +1,2293 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`InfrastructurePyProject Defaults 1`] = ` +{ + ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.py and run "npx projen". + +/.gitattributes linguist-generated +/.github/workflows/pull-request-lint.yml linguist-generated +/.gitignore linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/cdk.json linguist-generated +/pyproject.toml linguist-generated", + ".github/workflows/pull-request-lint.yml": "# ~~ Generated by projen. To modify, edit .projenrc.py and run "npx projen". + +name: pull-request-lint +on: + pull_request_target: + types: + - labeled + - opened + - synchronize + - reopened + - ready_for_review + - edited +jobs: + validate: + name: Validate PR title + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: amannn/action-semantic-pull-request@v5.0.2 + env: + GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} + with: + types: |- + feat + fix + chore + requireScope: false + githubBaseUrl: \${{ github.api_url }} +", + ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.py and run "npx projen". +node_modules/ +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/.github/workflows/pull-request-lint.yml +!/pyproject.toml +/poetry.toml +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST +*.manifest +*.spec +pip-log.txt +pip-delete-this-directory.txt +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ +*.mo +*.pot +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal +instance/ +.webassets-cache +.scrapy +docs/_build/ +.pybuilder/ +target/ +.ipynb_checkpoints +profile_default/ +ipython_config.py +__pypackages__/ +celerybeat-schedule +celerybeat.pid +*.sage.py +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ +.spyderproject +.spyproject +.ropeproject +/site +.mypy_cache/ +.dmypy.json +dmypy.json +.pyre/ +.pytype/ +cython_debug/ +!/cdk.json +/cdk.out/ +.cdk.staging/ +", + ".projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.py and run "npx projen".", + "dependencies": [ + { + "name": "projen", + "type": "devenv", + "version": "99.99.99", + }, + { + "name": "pytest", + "type": "devenv", + "version": "^7", + }, + { + "name": "syrupy", + "type": "devenv", + "version": "^4", + }, + { + "name": "aws_pdk", + "type": "runtime", + "version": "^0", + }, + { + "name": "aws-cdk-lib", + "type": "runtime", + "version": "^2.1.0", + }, + { + "name": "constructs", + "type": "runtime", + "version": "^10.0.5", + }, + { + "name": "python", + "type": "runtime", + "version": "^3.9", + }, + ], + }, + ".projen/files.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.py and run "npx projen".", + "files": [ + ".gitattributes", + ".github/workflows/pull-request-lint.yml", + ".gitignore", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "cdk.json", + "poetry.toml", + "pyproject.toml", + ], + }, + ".projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.py and run "npx projen".", + "env": { + "PATH": "$(echo $(poetry env info -p)/bin:$PATH)", + "VIRTUAL_ENV": "$(poetry env info -p)", + }, + "tasks": { + "build": { + "description": "Full release build", + "name": "build", + "steps": [ + { + "spawn": "default", + }, + { + "spawn": "pre-compile", + }, + { + "spawn": "compile", + }, + { + "spawn": "post-compile", + }, + { + "spawn": "test", + }, + { + "spawn": "package", + }, + ], + }, + "clobber": { + "condition": "git diff --exit-code > /dev/null", + "description": "hard resets to HEAD of origin and cleans the local repo", + "env": { + "BRANCH": "$(git branch --show-current)", + }, + "name": "clobber", + "steps": [ + { + "exec": "git checkout -b scratch", + "name": "save current HEAD in "scratch" branch", + }, + { + "exec": "git checkout $BRANCH", + }, + { + "exec": "git fetch origin", + "name": "fetch latest changes from origin", + }, + { + "exec": "git reset --hard origin/$BRANCH", + "name": "hard reset to origin commit", + }, + { + "exec": "git clean -fdx", + "name": "clean all untracked files", + }, + { + "say": "ready to rock! (unpushed commits are under the "scratch" branch)", + }, + ], + }, + "compile": { + "description": "Only compile", + "name": "compile", + }, + "default": { + "description": "Synthesize project files", + "name": "default", + "steps": [ + { + "exec": "python .projenrc.py", + }, + ], + }, + "deploy": { + "description": "Deploys your CDK app to the AWS cloud", + "name": "deploy", + "steps": [ + { + "exec": "cdk deploy", + "receiveArgs": true, + }, + ], + }, + "destroy": { + "description": "Destroys your cdk app in the AWS cloud", + "name": "destroy", + "steps": [ + { + "exec": "cdk destroy", + "receiveArgs": true, + }, + ], + }, + "diff": { + "description": "Diffs the currently deployed app against your code", + "name": "diff", + "steps": [ + { + "exec": "cdk diff", + }, + ], + }, + "eject": { + "description": "Remove projen from the project", + "env": { + "PROJEN_EJECTING": "true", + }, + "name": "eject", + "steps": [ + { + "spawn": "default", + }, + ], + }, + "install": { + "description": "Install and upgrade dependencies", + "name": "install", + "steps": [ + { + "exec": "poetry update", + }, + ], + }, + "package": { + "description": "Creates the distribution package", + "name": "package", + "steps": [ + { + "exec": "poetry build", + }, + ], + }, + "post-compile": { + "description": "Runs after successful compilation", + "name": "post-compile", + "steps": [ + { + "spawn": "synth:silent", + }, + ], + }, + "pre-compile": { + "description": "Prepare the project for compilation", + "name": "pre-compile", + }, + "publish": { + "description": "Uploads the package to PyPI.", + "name": "publish", + "steps": [ + { + "exec": "poetry publish", + }, + ], + }, + "publish:test": { + "description": "Uploads the package against a test PyPI endpoint.", + "name": "publish:test", + "steps": [ + { + "exec": "poetry publish -r testpypi", + }, + ], + }, + "synth": { + "description": "Synthesizes your cdk app into cdk.out", + "name": "synth", + "steps": [ + { + "exec": "cdk synth", + }, + ], + }, + "synth:silent": { + "description": "Synthesizes your cdk app into cdk.out and suppresses the template in stdout (part of "yarn build")", + "name": "synth:silent", + "steps": [ + { + "exec": "cdk synth -q", + }, + ], + }, + "test": { + "description": "Run tests", + "name": "test", + "steps": [ + { + "exec": "poetry run pytest \${CI:-'--snapshot-update'}", + }, + ], + }, + "watch": { + "description": "Watches changes in your source code and rebuilds and deploys to the current account", + "name": "watch", + "steps": [ + { + "exec": "cdk deploy --hotswap", + }, + { + "exec": "cdk watch", + }, + ], + }, + }, + }, + "README.md": "## Getting started + +Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infrastructure/index.html)", + "cdk.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.py and run "npx projen".", + "app": "python main.py", + "output": "cdk.out", + "watch": { + "exclude": [ + "README.md", + "cdk*.json", + "requirements*.txt", + "source.bat", + "**/__init__.py", + "python/__pycache__", + "tests", + ], + "include": [ + "**", + ], + }, + }, + "infra/stacks/application_stack.py": "from aws_cdk import Stack +from aws_pdk.identity import UserIdentity +from constructs import Construct + +class ApplicationStack(Stack): + def __init__(self, scope: Construct, id: str, **kwargs) -> None: + super().__init__(scope, id, **kwargs) + + user_identity = UserIdentity(self, '{}UserIdentity'.format(id)) + +", + "main.py": "import os +from aws_cdk import Environment +from aws_pdk.cdk_graph import CdkGraph, FilterPreset, Filters, IFilter, IGraphFilterPlan +from aws_pdk.cdk_graph_plugin_diagram import CdkGraphDiagramPlugin, IDiagramConfigBase +from aws_pdk.pdk_nag import PDKNag, AwsPrototypingChecks +from infra.stacks.application_stack import ApplicationStack + +# for development, use account/region from cdk cli +dev_env = Environment( + account=os.getenv('CDK_DEFAULT_ACCOUNT'), + region=os.getenv('CDK_DEFAULT_REGION') +) + +app = PDKNag.app(nag_packs=[AwsPrototypingChecks()]) +ApplicationStack(app, "infra-dev", env=dev_env) + +graph = CdkGraph(app, plugins=[CdkGraphDiagramPlugin( + defaults=IDiagramConfigBase( + filter_plan=IGraphFilterPlan( + preset=FilterPreset.COMPACT, + filters=[IFilter(store=Filters.prune_custom_resources())] + ) + ) +)]) +app.synth() +graph.report()", + "poetry.toml": "# ~~ Generated by projen. To modify, edit .projenrc.py and run "npx projen". + +[repositories.testpypi] +url = "https://test.pypi.org/legacy/" +", + "pyproject.toml": "# ~~ Generated by projen. To modify, edit .projenrc.py and run "npx projen". + +[build-system] +requires = [ "poetry_core>=1.0.0" ] +build-backend = "poetry.core.masonry.api" + +[tool.poetry] +name = "Defaults" +version = "0.0.0" +description = "" +authors = [ "pdkuser " ] +readme = "README.md" + + [tool.poetry.dependencies] + aws_pdk = "^0" + aws-cdk-lib = "^2.1.0" + constructs = "^10.0.5" + python = "^3.9" + + [tool.poetry.dev-dependencies] + projen = "99.99.99" + pytest = "^7" + syrupy = "^4" +", + "tests/__init__.py": "", + "tests/test_application_stack.py": "import pytest +from aws_cdk import App +from aws_cdk.assertions import Template +from infra.stacks.application_stack import ApplicationStack + +def test_template_with_snapshot(snapshot): + app = App() + stack = ApplicationStack(app, "my-stack-test") + template = Template.from_stack(stack) + assert template.to_json() == snapshot +", +} +`; + +exports[`InfrastructurePyProject With Api 1`] = ` +{ + "infra/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +/.gitattributes linguist-generated +/.gitignore linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/cdk.json linguist-generated +/project.json linguist-generated +/pyproject.toml linguist-generated", + "infra/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +node_modules/ +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/pyproject.toml +/poetry.toml +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST +*.manifest +*.spec +pip-log.txt +pip-delete-this-directory.txt +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ +*.mo +*.pot +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal +instance/ +.webassets-cache +.scrapy +docs/_build/ +.pybuilder/ +target/ +.ipynb_checkpoints +profile_default/ +ipython_config.py +__pypackages__/ +celerybeat-schedule +celerybeat.pid +*.sage.py +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ +.spyderproject +.spyproject +.ropeproject +/site +.mypy_cache/ +.dmypy.json +dmypy.json +.pyre/ +.pytype/ +cython_debug/ +!/cdk.json +/cdk.out/ +.cdk.staging/ +!/project.json +", + "infra/.projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": [ + { + "name": "pytest", + "type": "devenv", + "version": "^7", + }, + { + "name": "syrupy", + "type": "devenv", + "version": "^4", + }, + { + "name": "Api-python-infra", + "type": "runtime", + "version": "{path="../api/generated/infrastructure/python", develop=true}", + }, + { + "name": "aws_pdk", + "type": "runtime", + "version": "^0", + }, + { + "name": "aws-cdk-lib", + "type": "runtime", + "version": "^2.1.0", + }, + { + "name": "constructs", + "type": "runtime", + "version": "^10.0.5", + }, + { + "name": "python", + "type": "runtime", + "version": "^3.9", + }, + ], + }, + "infra/.projen/files.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "files": [ + ".gitattributes", + ".gitignore", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "cdk.json", + "poetry.toml", + "project.json", + "pyproject.toml", + ], + }, + "infra/.projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "env": { + "PATH": "$(echo $(env -u VIRTUAL_ENV poetry env info -p || echo '')/bin:$PATH)", + "VIRTUAL_ENV": "$(env -u VIRTUAL_ENV poetry env info -p || echo '')", + }, + "tasks": { + "build": { + "description": "Full release build", + "name": "build", + "steps": [ + { + "spawn": "pre-compile", + }, + { + "spawn": "compile", + }, + { + "spawn": "post-compile", + }, + { + "spawn": "test", + }, + { + "spawn": "package", + }, + ], + }, + "compile": { + "description": "Only compile", + "name": "compile", + }, + "default": { + "description": "Synthesize project files", + "name": "default", + }, + "deploy": { + "description": "Deploys your CDK app to the AWS cloud", + "name": "deploy", + "steps": [ + { + "exec": "cdk deploy", + "receiveArgs": true, + }, + ], + }, + "destroy": { + "description": "Destroys your cdk app in the AWS cloud", + "name": "destroy", + "steps": [ + { + "exec": "cdk destroy", + "receiveArgs": true, + }, + ], + }, + "diff": { + "description": "Diffs the currently deployed app against your code", + "name": "diff", + "steps": [ + { + "exec": "cdk diff", + }, + ], + }, + "install": { + "description": "Install and upgrade dependencies", + "name": "install", + "steps": [ + { + "exec": "poetry update", + }, + ], + }, + "package": { + "description": "Creates the distribution package", + "name": "package", + "steps": [ + { + "exec": "poetry build", + }, + ], + }, + "post-compile": { + "description": "Runs after successful compilation", + "name": "post-compile", + "steps": [ + { + "spawn": "synth:silent", + }, + ], + }, + "pre-compile": { + "description": "Prepare the project for compilation", + "name": "pre-compile", + }, + "publish": { + "description": "Uploads the package to PyPI.", + "name": "publish", + "steps": [ + { + "exec": "poetry publish", + }, + ], + }, + "publish:test": { + "description": "Uploads the package against a test PyPI endpoint.", + "name": "publish:test", + "steps": [ + { + "exec": "poetry publish -r testpypi", + }, + ], + }, + "synth": { + "description": "Synthesizes your cdk app into cdk.out", + "name": "synth", + "steps": [ + { + "exec": "cdk synth", + }, + ], + }, + "synth:silent": { + "description": "Synthesizes your cdk app into cdk.out and suppresses the template in stdout (part of "yarn build")", + "name": "synth:silent", + "steps": [ + { + "exec": "cdk synth -q", + }, + ], + }, + "test": { + "description": "Run tests", + "name": "test", + "steps": [ + { + "exec": "poetry run pytest \${CI:-'--snapshot-update'}", + }, + ], + }, + "watch": { + "description": "Watches changes in your source code and rebuilds and deploys to the current account", + "name": "watch", + "steps": [ + { + "exec": "cdk deploy --hotswap", + }, + { + "exec": "cdk watch", + }, + ], + }, + }, + }, + "infra/README.md": "## Getting started + +Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infrastructure/index.html)", + "infra/cdk.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "app": "python main.py", + "output": "cdk.out", + "watch": { + "exclude": [ + "README.md", + "cdk*.json", + "requirements*.txt", + "source.bat", + "**/__init__.py", + "python/__pycache__", + "tests", + ], + "include": [ + "**", + ], + }, + }, + "infra/infra/constructs/api.py": "from constructs import Construct +from Api_python_infra.api import Api +from Api_python_infra.mock_integrations import MockIntegrations +from aws_cdk import Stack +from aws_pdk.identity import UserIdentity +from aws_pdk.type_safe_api import Authorizers +from aws_cdk.aws_apigateway import CorsOptions, Cors +from aws_cdk.aws_iam import AccountPrincipal, AnyPrincipal, Effect, PolicyDocument, PolicyStatement + +# Infrastructure construct to deploy a Type Safe API. +class ApiConstruct(Construct): + def __init__(self, scope: Construct, id: str, user_identity: UserIdentity, **kwargs) -> None: + super().__init__(scope, id, **kwargs) + + self.api = Api(self, id, + default_authorizer=Authorizers.iam(), + cors_options=CorsOptions( + allow_origins=Cors.ALL_ORIGINS, + allow_methods=Cors.ALL_METHODS + ), + integrations=MockIntegrations.mock_all(), + policy=PolicyDocument( + statements=[ + # Here we grant any AWS credentials from the account that the prototype is deployed in to call the api. + # Machine to machine fine-grained access can be defined here using more specific principals (eg roles or + # users) and resources (ie which api paths may be invoked by which principal) if required. + # If doing so, the cognito identity pool authenticated role must still be granted access for cognito users to + # still be granted access to the API. + PolicyStatement( + effect=Effect.ALLOW, + principals=[AccountPrincipal(Stack.of(self).account)], + actions=['execute-api:Invoke'], + resources=['execute-api:/*'] + ), + # Open up OPTIONS to allow browsers to make unauthenticated preflight requests + PolicyStatement( + effect=Effect.ALLOW, + principals=[AnyPrincipal()], + actions=['execute-api:Invoke'], + resources=['execute-api:/*/OPTIONS/*'] + ) + ] + )) + + user_identity.identity_pool.authenticated_role.add_to_principal_policy( + PolicyStatement( + effect=Effect.ALLOW, + actions=['execute-api:Invoke'], + resources=[self.api.api.arn_for_execute_api('*', '/*', '*')] + ) + ) +", + "infra/infra/stacks/application_stack.py": "from aws_cdk import Stack +from aws_pdk.identity import UserIdentity +from constructs import Construct +from infra.constructs.api import ApiConstruct + +class ApplicationStack(Stack): + def __init__(self, scope: Construct, id: str, **kwargs) -> None: + super().__init__(scope, id, **kwargs) + + user_identity = UserIdentity(self, '{}UserIdentity'.format(id)) + ApiConstruct(self, 'Api', user_identity) + +", + "infra/main.py": "import os +from aws_cdk import Environment +from aws_pdk.cdk_graph import CdkGraph, FilterPreset, Filters, IFilter, IGraphFilterPlan +from aws_pdk.cdk_graph_plugin_diagram import CdkGraphDiagramPlugin, IDiagramConfigBase +from aws_pdk.pdk_nag import PDKNag, AwsPrototypingChecks +from infra.stacks.application_stack import ApplicationStack + +# for development, use account/region from cdk cli +dev_env = Environment( + account=os.getenv('CDK_DEFAULT_ACCOUNT'), + region=os.getenv('CDK_DEFAULT_REGION') +) + +app = PDKNag.app(nag_packs=[AwsPrototypingChecks()]) +ApplicationStack(app, "infra-dev", env=dev_env) + +graph = CdkGraph(app, plugins=[CdkGraphDiagramPlugin( + defaults=IDiagramConfigBase( + filter_plan=IGraphFilterPlan( + preset=FilterPreset.COMPACT, + filters=[IFilter(store=Filters.prune_custom_resources())] + ) + ) +)]) +app.synth() +graph.report()", + "infra/poetry.toml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +[repositories.testpypi] +url = "https://test.pypi.org/legacy/" +", + "infra/project.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "implicitDependencies": [ + "Api-python-infra", + ], + "name": "WithApi", + "root": "infra", + "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen build", + "cwd": "infra", + }, + }, + "compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen compile", + "cwd": "infra", + }, + }, + "default": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen default", + "cwd": "infra", + }, + }, + "deploy": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen deploy", + "cwd": "infra", + }, + }, + "destroy": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen destroy", + "cwd": "infra", + }, + }, + "diff": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen diff", + "cwd": "infra", + }, + }, + "install": { + "dependsOn": [ + "^install", + ], + "executor": "nx:run-commands", + "options": { + "command": "npx projen install", + "cwd": "infra", + }, + }, + "package": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen package", + "cwd": "infra", + }, + }, + "post-compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen post-compile", + "cwd": "infra", + }, + }, + "pre-compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen pre-compile", + "cwd": "infra", + }, + }, + "publish": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen publish", + "cwd": "infra", + }, + }, + "publish:test": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen publish:test", + "cwd": "infra", + }, + }, + "synth": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen synth", + "cwd": "infra", + }, + }, + "synth:silent": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen synth:silent", + "cwd": "infra", + }, + }, + "test": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen test", + "cwd": "infra", + }, + }, + "watch": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen watch", + "cwd": "infra", + }, + }, + }, + }, + "infra/pyproject.toml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +[build-system] +requires = [ "poetry_core>=1.0.0" ] +build-backend = "poetry.core.masonry.api" + +[tool.poetry] +name = "WithApi" +version = "0.0.0" +description = "" +authors = [ "pdkuser " ] +readme = "README.md" + + [tool.poetry.dependencies] + aws_pdk = "^0" + aws-cdk-lib = "^2.1.0" + constructs = "^10.0.5" + python = "^3.9" + + [tool.poetry.dependencies.Api-python-infra] + path = "../api/generated/infrastructure/python" + develop = true + + [tool.poetry.dev-dependencies] + pytest = "^7" + syrupy = "^4" +", + "infra/tests/__init__.py": "", + "infra/tests/test_application_stack.py": "import pytest +from aws_cdk import App +from aws_cdk.assertions import Template +from infra.stacks.application_stack import ApplicationStack + +def test_template_with_snapshot(snapshot): + app = App() + stack = ApplicationStack(app, "my-stack-test") + template = Template.from_stack(stack) + assert template.to_json() == snapshot +", +} +`; + +exports[`InfrastructurePyProject With Api and Website 1`] = ` +{ + "infra/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +/.gitattributes linguist-generated +/.gitignore linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/cdk.json linguist-generated +/project.json linguist-generated +/pyproject.toml linguist-generated", + "infra/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +node_modules/ +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/pyproject.toml +/poetry.toml +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST +*.manifest +*.spec +pip-log.txt +pip-delete-this-directory.txt +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ +*.mo +*.pot +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal +instance/ +.webassets-cache +.scrapy +docs/_build/ +.pybuilder/ +target/ +.ipynb_checkpoints +profile_default/ +ipython_config.py +__pypackages__/ +celerybeat-schedule +celerybeat.pid +*.sage.py +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ +.spyderproject +.spyproject +.ropeproject +/site +.mypy_cache/ +.dmypy.json +dmypy.json +.pyre/ +.pytype/ +cython_debug/ +!/cdk.json +/cdk.out/ +.cdk.staging/ +!/project.json +", + "infra/.projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": [ + { + "name": "pytest", + "type": "devenv", + "version": "^7", + }, + { + "name": "syrupy", + "type": "devenv", + "version": "^4", + }, + { + "name": "Api-python-infra", + "type": "runtime", + "version": "{path="../api/generated/infrastructure/python", develop=true}", + }, + { + "name": "aws_pdk", + "type": "runtime", + "version": "^0", + }, + { + "name": "aws-cdk-lib", + "type": "runtime", + "version": "^2.1.0", + }, + { + "name": "constructs", + "type": "runtime", + "version": "^10.0.5", + }, + { + "name": "python", + "type": "runtime", + "version": "^3.9", + }, + ], + }, + "infra/.projen/files.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "files": [ + ".gitattributes", + ".gitignore", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "cdk.json", + "poetry.toml", + "project.json", + "pyproject.toml", + ], + }, + "infra/.projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "env": { + "PATH": "$(echo $(env -u VIRTUAL_ENV poetry env info -p || echo '')/bin:$PATH)", + "VIRTUAL_ENV": "$(env -u VIRTUAL_ENV poetry env info -p || echo '')", + }, + "tasks": { + "build": { + "description": "Full release build", + "name": "build", + "steps": [ + { + "spawn": "pre-compile", + }, + { + "spawn": "compile", + }, + { + "spawn": "post-compile", + }, + { + "spawn": "test", + }, + { + "spawn": "package", + }, + ], + }, + "compile": { + "description": "Only compile", + "name": "compile", + }, + "default": { + "description": "Synthesize project files", + "name": "default", + }, + "deploy": { + "description": "Deploys your CDK app to the AWS cloud", + "name": "deploy", + "steps": [ + { + "exec": "cdk deploy", + "receiveArgs": true, + }, + ], + }, + "destroy": { + "description": "Destroys your cdk app in the AWS cloud", + "name": "destroy", + "steps": [ + { + "exec": "cdk destroy", + "receiveArgs": true, + }, + ], + }, + "diff": { + "description": "Diffs the currently deployed app against your code", + "name": "diff", + "steps": [ + { + "exec": "cdk diff", + }, + ], + }, + "install": { + "description": "Install and upgrade dependencies", + "name": "install", + "steps": [ + { + "exec": "poetry update", + }, + ], + }, + "package": { + "description": "Creates the distribution package", + "name": "package", + "steps": [ + { + "exec": "poetry build", + }, + ], + }, + "post-compile": { + "description": "Runs after successful compilation", + "name": "post-compile", + "steps": [ + { + "spawn": "synth:silent", + }, + ], + }, + "pre-compile": { + "description": "Prepare the project for compilation", + "name": "pre-compile", + }, + "publish": { + "description": "Uploads the package to PyPI.", + "name": "publish", + "steps": [ + { + "exec": "poetry publish", + }, + ], + }, + "publish:test": { + "description": "Uploads the package against a test PyPI endpoint.", + "name": "publish:test", + "steps": [ + { + "exec": "poetry publish -r testpypi", + }, + ], + }, + "synth": { + "description": "Synthesizes your cdk app into cdk.out", + "name": "synth", + "steps": [ + { + "exec": "cdk synth", + }, + ], + }, + "synth:silent": { + "description": "Synthesizes your cdk app into cdk.out and suppresses the template in stdout (part of "yarn build")", + "name": "synth:silent", + "steps": [ + { + "exec": "cdk synth -q", + }, + ], + }, + "test": { + "description": "Run tests", + "name": "test", + "steps": [ + { + "exec": "poetry run pytest \${CI:-'--snapshot-update'}", + }, + ], + }, + "watch": { + "description": "Watches changes in your source code and rebuilds and deploys to the current account", + "name": "watch", + "steps": [ + { + "exec": "cdk deploy --hotswap", + }, + { + "exec": "cdk watch", + }, + ], + }, + }, + }, + "infra/README.md": "## Getting started + +Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infrastructure/index.html)", + "infra/cdk.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "app": "python main.py", + "output": "cdk.out", + "watch": { + "exclude": [ + "README.md", + "cdk*.json", + "requirements*.txt", + "source.bat", + "**/__init__.py", + "python/__pycache__", + "tests", + ], + "include": [ + "**", + ], + }, + }, + "infra/infra/constructs/api.py": "from constructs import Construct +from Api_python_infra.api import Api +from Api_python_infra.mock_integrations import MockIntegrations +from aws_cdk import Stack +from aws_pdk.identity import UserIdentity +from aws_pdk.type_safe_api import Authorizers +from aws_cdk.aws_apigateway import CorsOptions, Cors +from aws_cdk.aws_iam import AccountPrincipal, AnyPrincipal, Effect, PolicyDocument, PolicyStatement + +# Infrastructure construct to deploy a Type Safe API. +class ApiConstruct(Construct): + def __init__(self, scope: Construct, id: str, user_identity: UserIdentity, **kwargs) -> None: + super().__init__(scope, id, **kwargs) + + self.api = Api(self, id, + default_authorizer=Authorizers.iam(), + cors_options=CorsOptions( + allow_origins=Cors.ALL_ORIGINS, + allow_methods=Cors.ALL_METHODS + ), + integrations=MockIntegrations.mock_all(), + policy=PolicyDocument( + statements=[ + # Here we grant any AWS credentials from the account that the prototype is deployed in to call the api. + # Machine to machine fine-grained access can be defined here using more specific principals (eg roles or + # users) and resources (ie which api paths may be invoked by which principal) if required. + # If doing so, the cognito identity pool authenticated role must still be granted access for cognito users to + # still be granted access to the API. + PolicyStatement( + effect=Effect.ALLOW, + principals=[AccountPrincipal(Stack.of(self).account)], + actions=['execute-api:Invoke'], + resources=['execute-api:/*'] + ), + # Open up OPTIONS to allow browsers to make unauthenticated preflight requests + PolicyStatement( + effect=Effect.ALLOW, + principals=[AnyPrincipal()], + actions=['execute-api:Invoke'], + resources=['execute-api:/*/OPTIONS/*'] + ) + ] + )) + + user_identity.identity_pool.authenticated_role.add_to_principal_policy( + PolicyStatement( + effect=Effect.ALLOW, + actions=['execute-api:Invoke'], + resources=[self.api.api.arn_for_execute_api('*', '/*', '*')] + ) + ) +", + "infra/infra/constructs/website.py": "from aws_cdk import Stack +from constructs import Construct +from aws_cdk.aws_cloudfront import GeoRestriction +from infra.constructs.api import ApiConstruct +from aws_pdk.identity import UserIdentity +from aws_pdk.static_website import StaticWebsite, RuntimeOptions, DistributionProps + +# Construct to deploy a Static Website +class WebsiteConstruct(Construct): + def __init__(self, scope: Construct, id: str, user_identity: UserIdentity, api_construct: ApiConstruct, **kwargs) -> None: + super().__init__(scope, id, **kwargs) + + StaticWebsite(self, id, + website_content_path='../website/build', + runtime_options=RuntimeOptions( + json_payload={ + 'region': Stack.of(self).region, + 'identityPoolId': user_identity.identity_pool.identity_pool_id, + 'userPoolId': user_identity.user_pool.user_pool_id, + 'userPoolWebClientId': user_identity.user_pool_client.user_pool_client_id, + 'apiUrl': api_construct.api.api.url_for_path(), + } + ), + distribution_props=DistributionProps( + geo_restriction=GeoRestriction.allowlist( + "AU", + "ID", + "IN", + "JP", + "KR", + "SG", + "US" + ) + )) +", + "infra/infra/stacks/application_stack.py": "from aws_cdk import Stack +from aws_pdk.identity import UserIdentity +from constructs import Construct +from infra.constructs.api import ApiConstruct +from infra.constructs.website import WebsiteConstruct + +class ApplicationStack(Stack): + def __init__(self, scope: Construct, id: str, **kwargs) -> None: + super().__init__(scope, id, **kwargs) + + user_identity = UserIdentity(self, '{}UserIdentity'.format(id)) + api = ApiConstruct(self, 'Api', user_identity) + WebsiteConstruct(self, 'Website', user_identity, api) + +", + "infra/main.py": "import os +from aws_cdk import Environment +from aws_pdk.cdk_graph import CdkGraph, FilterPreset, Filters, IFilter, IGraphFilterPlan +from aws_pdk.cdk_graph_plugin_diagram import CdkGraphDiagramPlugin, IDiagramConfigBase +from aws_pdk.pdk_nag import PDKNag, AwsPrototypingChecks +from infra.stacks.application_stack import ApplicationStack + +# for development, use account/region from cdk cli +dev_env = Environment( + account=os.getenv('CDK_DEFAULT_ACCOUNT'), + region=os.getenv('CDK_DEFAULT_REGION') +) + +app = PDKNag.app(nag_packs=[AwsPrototypingChecks()]) +ApplicationStack(app, "infra-dev", env=dev_env) + +graph = CdkGraph(app, plugins=[CdkGraphDiagramPlugin( + defaults=IDiagramConfigBase( + filter_plan=IGraphFilterPlan( + preset=FilterPreset.COMPACT, + filters=[IFilter(store=Filters.prune_custom_resources())] + ) + ) +)]) +app.synth() +graph.report()", + "infra/poetry.toml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +[repositories.testpypi] +url = "https://test.pypi.org/legacy/" +", + "infra/project.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "implicitDependencies": [ + "Api-python-infra", + "Website", + ], + "name": "WithApi", + "root": "infra", + "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen build", + "cwd": "infra", + }, + }, + "compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen compile", + "cwd": "infra", + }, + }, + "default": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen default", + "cwd": "infra", + }, + }, + "deploy": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen deploy", + "cwd": "infra", + }, + }, + "destroy": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen destroy", + "cwd": "infra", + }, + }, + "diff": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen diff", + "cwd": "infra", + }, + }, + "install": { + "dependsOn": [ + "^install", + ], + "executor": "nx:run-commands", + "options": { + "command": "npx projen install", + "cwd": "infra", + }, + }, + "package": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen package", + "cwd": "infra", + }, + }, + "post-compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen post-compile", + "cwd": "infra", + }, + }, + "pre-compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen pre-compile", + "cwd": "infra", + }, + }, + "publish": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen publish", + "cwd": "infra", + }, + }, + "publish:test": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen publish:test", + "cwd": "infra", + }, + }, + "synth": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen synth", + "cwd": "infra", + }, + }, + "synth:silent": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen synth:silent", + "cwd": "infra", + }, + }, + "test": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen test", + "cwd": "infra", + }, + }, + "watch": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen watch", + "cwd": "infra", + }, + }, + }, + }, + "infra/pyproject.toml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +[build-system] +requires = [ "poetry_core>=1.0.0" ] +build-backend = "poetry.core.masonry.api" + +[tool.poetry] +name = "WithApi" +version = "0.0.0" +description = "" +authors = [ "pdkuser " ] +readme = "README.md" + + [tool.poetry.dependencies] + aws_pdk = "^0" + aws-cdk-lib = "^2.1.0" + constructs = "^10.0.5" + python = "^3.9" + + [tool.poetry.dependencies.Api-python-infra] + path = "../api/generated/infrastructure/python" + develop = true + + [tool.poetry.dev-dependencies] + pytest = "^7" + syrupy = "^4" +", + "infra/tests/__init__.py": "", + "infra/tests/test_application_stack.py": "import pytest +from aws_cdk import App +from aws_cdk.assertions import Template +from infra.stacks.application_stack import ApplicationStack + +def test_template_with_snapshot(snapshot): + app = App() + stack = ApplicationStack(app, "my-stack-test") + template = Template.from_stack(stack) + assert template.to_json() == snapshot +", +} +`; + +exports[`InfrastructurePyProject With Website 1`] = ` +{ + "infra/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +/.gitattributes linguist-generated +/.gitignore linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/cdk.json linguist-generated +/project.json linguist-generated +/pyproject.toml linguist-generated", + "infra/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +node_modules/ +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/pyproject.toml +/poetry.toml +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST +*.manifest +*.spec +pip-log.txt +pip-delete-this-directory.txt +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ +*.mo +*.pot +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal +instance/ +.webassets-cache +.scrapy +docs/_build/ +.pybuilder/ +target/ +.ipynb_checkpoints +profile_default/ +ipython_config.py +__pypackages__/ +celerybeat-schedule +celerybeat.pid +*.sage.py +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ +.spyderproject +.spyproject +.ropeproject +/site +.mypy_cache/ +.dmypy.json +dmypy.json +.pyre/ +.pytype/ +cython_debug/ +!/cdk.json +/cdk.out/ +.cdk.staging/ +!/project.json +", + "infra/.projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": [ + { + "name": "pytest", + "type": "devenv", + "version": "^7", + }, + { + "name": "syrupy", + "type": "devenv", + "version": "^4", + }, + { + "name": "aws_pdk", + "type": "runtime", + "version": "^0", + }, + { + "name": "aws-cdk-lib", + "type": "runtime", + "version": "^2.1.0", + }, + { + "name": "constructs", + "type": "runtime", + "version": "^10.0.5", + }, + { + "name": "python", + "type": "runtime", + "version": "^3.9", + }, + ], + }, + "infra/.projen/files.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "files": [ + ".gitattributes", + ".gitignore", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "cdk.json", + "poetry.toml", + "project.json", + "pyproject.toml", + ], + }, + "infra/.projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "env": { + "PATH": "$(echo $(env -u VIRTUAL_ENV poetry env info -p || echo '')/bin:$PATH)", + "VIRTUAL_ENV": "$(env -u VIRTUAL_ENV poetry env info -p || echo '')", + }, + "tasks": { + "build": { + "description": "Full release build", + "name": "build", + "steps": [ + { + "spawn": "pre-compile", + }, + { + "spawn": "compile", + }, + { + "spawn": "post-compile", + }, + { + "spawn": "test", + }, + { + "spawn": "package", + }, + ], + }, + "compile": { + "description": "Only compile", + "name": "compile", + }, + "default": { + "description": "Synthesize project files", + "name": "default", + }, + "deploy": { + "description": "Deploys your CDK app to the AWS cloud", + "name": "deploy", + "steps": [ + { + "exec": "cdk deploy", + "receiveArgs": true, + }, + ], + }, + "destroy": { + "description": "Destroys your cdk app in the AWS cloud", + "name": "destroy", + "steps": [ + { + "exec": "cdk destroy", + "receiveArgs": true, + }, + ], + }, + "diff": { + "description": "Diffs the currently deployed app against your code", + "name": "diff", + "steps": [ + { + "exec": "cdk diff", + }, + ], + }, + "install": { + "description": "Install and upgrade dependencies", + "name": "install", + "steps": [ + { + "exec": "poetry update", + }, + ], + }, + "package": { + "description": "Creates the distribution package", + "name": "package", + "steps": [ + { + "exec": "poetry build", + }, + ], + }, + "post-compile": { + "description": "Runs after successful compilation", + "name": "post-compile", + "steps": [ + { + "spawn": "synth:silent", + }, + ], + }, + "pre-compile": { + "description": "Prepare the project for compilation", + "name": "pre-compile", + }, + "publish": { + "description": "Uploads the package to PyPI.", + "name": "publish", + "steps": [ + { + "exec": "poetry publish", + }, + ], + }, + "publish:test": { + "description": "Uploads the package against a test PyPI endpoint.", + "name": "publish:test", + "steps": [ + { + "exec": "poetry publish -r testpypi", + }, + ], + }, + "synth": { + "description": "Synthesizes your cdk app into cdk.out", + "name": "synth", + "steps": [ + { + "exec": "cdk synth", + }, + ], + }, + "synth:silent": { + "description": "Synthesizes your cdk app into cdk.out and suppresses the template in stdout (part of "yarn build")", + "name": "synth:silent", + "steps": [ + { + "exec": "cdk synth -q", + }, + ], + }, + "test": { + "description": "Run tests", + "name": "test", + "steps": [ + { + "exec": "poetry run pytest \${CI:-'--snapshot-update'}", + }, + ], + }, + "watch": { + "description": "Watches changes in your source code and rebuilds and deploys to the current account", + "name": "watch", + "steps": [ + { + "exec": "cdk deploy --hotswap", + }, + { + "exec": "cdk watch", + }, + ], + }, + }, + }, + "infra/README.md": "## Getting started + +Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infrastructure/index.html)", + "infra/cdk.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "app": "python main.py", + "output": "cdk.out", + "watch": { + "exclude": [ + "README.md", + "cdk*.json", + "requirements*.txt", + "source.bat", + "**/__init__.py", + "python/__pycache__", + "tests", + ], + "include": [ + "**", + ], + }, + }, + "infra/infra/constructs/website.py": "from aws_cdk import Stack +from constructs import Construct +from aws_cdk.aws_cloudfront import GeoRestriction +# from infra.constructs.api import ApiConstruct +from aws_pdk.identity import UserIdentity +from aws_pdk.static_website import StaticWebsite, RuntimeOptions, DistributionProps + +# Construct to deploy a Static Website +class WebsiteConstruct(Construct): + def __init__(self, scope: Construct, id: str, user_identity: UserIdentity''', api_construct: ApiConstruct''', **kwargs) -> None: + super().__init__(scope, id, **kwargs) + + StaticWebsite(self, id, + website_content_path='../website/build', + runtime_options=RuntimeOptions( + json_payload={ + 'region': Stack.of(self).region, + 'identityPoolId': user_identity.identity_pool.identity_pool_id, + 'userPoolId': user_identity.user_pool.user_pool_id, + 'userPoolWebClientId': user_identity.user_pool_client.user_pool_client_id, + ''''apiUrl': api_construct.api.api.url_for_path(),''' + } + ), + distribution_props=DistributionProps( + geo_restriction=GeoRestriction.allowlist( + "AU", + "ID", + "IN", + "JP", + "KR", + "SG", + "US" + ) + )) +", + "infra/infra/stacks/application_stack.py": "from aws_cdk import Stack +from aws_pdk.identity import UserIdentity +from constructs import Construct +from infra.constructs.website import WebsiteConstruct + +class ApplicationStack(Stack): + def __init__(self, scope: Construct, id: str, **kwargs) -> None: + super().__init__(scope, id, **kwargs) + + user_identity = UserIdentity(self, '{}UserIdentity'.format(id)) + WebsiteConstruct(self, 'Website', user_identity) + +", + "infra/main.py": "import os +from aws_cdk import Environment +from aws_pdk.cdk_graph import CdkGraph, FilterPreset, Filters, IFilter, IGraphFilterPlan +from aws_pdk.cdk_graph_plugin_diagram import CdkGraphDiagramPlugin, IDiagramConfigBase +from aws_pdk.pdk_nag import PDKNag, AwsPrototypingChecks +from infra.stacks.application_stack import ApplicationStack + +# for development, use account/region from cdk cli +dev_env = Environment( + account=os.getenv('CDK_DEFAULT_ACCOUNT'), + region=os.getenv('CDK_DEFAULT_REGION') +) + +app = PDKNag.app(nag_packs=[AwsPrototypingChecks()]) +ApplicationStack(app, "infra-dev", env=dev_env) + +graph = CdkGraph(app, plugins=[CdkGraphDiagramPlugin( + defaults=IDiagramConfigBase( + filter_plan=IGraphFilterPlan( + preset=FilterPreset.COMPACT, + filters=[IFilter(store=Filters.prune_custom_resources())] + ) + ) +)]) +app.synth() +graph.report()", + "infra/poetry.toml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +[repositories.testpypi] +url = "https://test.pypi.org/legacy/" +", + "infra/project.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "implicitDependencies": [ + "Website", + ], + "name": "WithApi", + "root": "infra", + "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen build", + "cwd": "infra", + }, + }, + "compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen compile", + "cwd": "infra", + }, + }, + "default": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen default", + "cwd": "infra", + }, + }, + "deploy": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen deploy", + "cwd": "infra", + }, + }, + "destroy": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen destroy", + "cwd": "infra", + }, + }, + "diff": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen diff", + "cwd": "infra", + }, + }, + "install": { + "dependsOn": [ + "^install", + ], + "executor": "nx:run-commands", + "options": { + "command": "npx projen install", + "cwd": "infra", + }, + }, + "package": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen package", + "cwd": "infra", + }, + }, + "post-compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen post-compile", + "cwd": "infra", + }, + }, + "pre-compile": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen pre-compile", + "cwd": "infra", + }, + }, + "publish": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen publish", + "cwd": "infra", + }, + }, + "publish:test": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen publish:test", + "cwd": "infra", + }, + }, + "synth": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen synth", + "cwd": "infra", + }, + }, + "synth:silent": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen synth:silent", + "cwd": "infra", + }, + }, + "test": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen test", + "cwd": "infra", + }, + }, + "watch": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen watch", + "cwd": "infra", + }, + }, + }, + }, + "infra/pyproject.toml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +[build-system] +requires = [ "poetry_core>=1.0.0" ] +build-backend = "poetry.core.masonry.api" + +[tool.poetry] +name = "WithApi" +version = "0.0.0" +description = "" +authors = [ "pdkuser " ] +readme = "README.md" + + [tool.poetry.dependencies] + aws_pdk = "^0" + aws-cdk-lib = "^2.1.0" + constructs = "^10.0.5" + python = "^3.9" + + [tool.poetry.dev-dependencies] + pytest = "^7" + syrupy = "^4" +", + "infra/tests/__init__.py": "", + "infra/tests/test_application_stack.py": "import pytest +from aws_cdk import App +from aws_cdk.assertions import Template +from infra.stacks.application_stack import ApplicationStack + +def test_template_with_snapshot(snapshot): + app = App() + stack = ApplicationStack(app, "my-stack-test") + template = Template.from_stack(stack) + assert template.to_json() == snapshot +", +} +`; diff --git a/packages/infrastructure/test/projects/python/infrastructure-py-project.test.ts b/packages/infrastructure/test/projects/python/infrastructure-py-project.test.ts new file mode 100644 index 000000000..3757597c8 --- /dev/null +++ b/packages/infrastructure/test/projects/python/infrastructure-py-project.test.ts @@ -0,0 +1,58 @@ +/*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 */ +import { Language } from "@aws/type-safe-api"; +import { synthSnapshot } from "projen/lib/util/synth"; +import { + InfrastructurePyProject, + InfrastructurePyProjectOptions, +} from "../../../src"; +import { + BuildOptionsProps, + snapshotInfrastructureProject, +} from "../utils/snapshot-infra-project"; + +describe("InfrastructurePyProject", () => { + const snapshot = ( + buildOptions: (props: BuildOptionsProps) => InfrastructurePyProjectOptions + ) => + snapshotInfrastructureProject( + Language.PYTHON, + InfrastructurePyProject, + buildOptions + ); + + it("Defaults", () => { + const project = new InfrastructurePyProject({ + name: "Defaults", + }); + expect(synthSnapshot(project)).toMatchSnapshot(); + }); + + it("With Api", () => { + expect( + snapshot(({ typeSafeApi }) => ({ + name: "WithApi", + typeSafeApi, + })) + ).toMatchSnapshot(); + }); + + it("With Website", () => { + expect( + snapshot(({ cloudscapeReactTsWebsite }) => ({ + name: "WithApi", + cloudscapeReactTsWebsite, + })) + ).toMatchSnapshot(); + }); + + it("With Api and Website", () => { + expect( + snapshot(({ cloudscapeReactTsWebsite, typeSafeApi }) => ({ + name: "WithApi", + typeSafeApi, + cloudscapeReactTsWebsite, + })) + ).toMatchSnapshot(); + }); +}); diff --git a/packages/infrastructure/test/projects/typescript/__snapshots__/infrastructure-ts-project.test.ts.snap b/packages/infrastructure/test/projects/typescript/__snapshots__/infrastructure-ts-project.test.ts.snap new file mode 100644 index 000000000..ae54c5ea7 --- /dev/null +++ b/packages/infrastructure/test/projects/typescript/__snapshots__/infrastructure-ts-project.test.ts.snap @@ -0,0 +1,5015 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`InfrastructureTsProject Defaults 1`] = ` +{ + ".eslintrc.json": { + "env": { + "jest": true, + "node": true, + }, + "extends": [ + "plugin:import/typescript", + "prettier", + "plugin:prettier/recommended", + ], + "ignorePatterns": [ + "*.js", + "*.d.ts", + "node_modules/", + "*.generated.ts", + "coverage", + "!.projenrc.js", + ], + "overrides": [ + { + "files": [ + ".projenrc.js", + ], + "rules": { + "@typescript-eslint/no-require-imports": "off", + "import/no-extraneous-dependencies": "off", + }, + }, + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2018, + "project": "./tsconfig.dev.json", + "sourceType": "module", + }, + "plugins": [ + "@typescript-eslint", + "import", + "prettier", + ], + "root": true, + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { + "default": [ + "public-static-field", + "public-static-method", + "protected-static-field", + "protected-static-method", + "private-static-field", + "private-static-method", + "field", + "constructor", + "method", + ], + }, + ], + "@typescript-eslint/no-floating-promises": [ + "error", + ], + "@typescript-eslint/no-require-imports": [ + "error", + ], + "@typescript-eslint/no-shadow": [ + "error", + ], + "@typescript-eslint/return-await": [ + "error", + ], + "dot-notation": [ + "error", + ], + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": [ + "**/test/**", + "**/build-tools/**", + ], + "optionalDependencies": false, + "peerDependencies": true, + }, + ], + "import/no-unresolved": [ + "error", + ], + "import/order": [ + "warn", + { + "alphabetize": { + "caseInsensitive": true, + "order": "asc", + }, + "groups": [ + "builtin", + "external", + ], + }, + ], + "key-spacing": [ + "error", + ], + "no-bitwise": [ + "error", + ], + "no-duplicate-imports": [ + "error", + ], + "no-multiple-empty-lines": [ + "error", + ], + "no-return-await": [ + "off", + ], + "no-shadow": [ + "off", + ], + "no-trailing-spaces": [ + "error", + ], + "prettier/prettier": [ + "error", + ], + }, + "settings": { + "import/parsers": { + "@typescript-eslint/parser": [ + ".ts", + ".tsx", + ], + }, + "import/resolver": { + "node": {}, + "typescript": { + "alwaysTryTypes": true, + "project": "./tsconfig.dev.json", + }, + }, + }, + }, + ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +*.snap linguist-generated +/.eslintrc.json linguist-generated +/.gitattributes linguist-generated +/.github/pull_request_template.md linguist-generated +/.github/workflows/build.yml linguist-generated +/.github/workflows/pull-request-lint.yml linguist-generated +/.github/workflows/upgrade.yml linguist-generated +/.gitignore linguist-generated +/.mergify.yml linguist-generated +/.npmignore linguist-generated +/.prettierignore linguist-generated +/.prettierrc.json linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/cdk.json linguist-generated +/LICENSE linguist-generated +/package.json linguist-generated +/tsconfig.dev.json linguist-generated +/tsconfig.json linguist-generated +/yarn.lock linguist-generated", + ".github/pull_request_template.md": "Fixes #", + ".github/workflows/build.yml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +name: build +on: + pull_request: {} + workflow_dispatch: {} +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + outputs: + self_mutation_happened: \${{ steps.self_mutation.outputs.self_mutation_happened }} + env: + CI: "true" + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: \${{ github.event.pull_request.head.ref }} + repository: \${{ github.event.pull_request.head.repo.full_name }} + - name: Install dependencies + run: yarn install --check-files + - name: build + run: npx projen build + - name: Find mutations + id: self_mutation + run: |- + git add . + git diff --staged --patch --exit-code > .repo.patch || echo "self_mutation_happened=true" >> $GITHUB_OUTPUT + - name: Upload patch + if: steps.self_mutation.outputs.self_mutation_happened + uses: actions/upload-artifact@v3 + with: + name: .repo.patch + path: .repo.patch + - name: Fail build on mutation + if: steps.self_mutation.outputs.self_mutation_happened + run: |- + echo "::error::Files were changed during build (see build log). If this was triggered from a fork, you will need to update your branch." + cat .repo.patch + exit 1 + self-mutation: + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + if: always() && needs.build.outputs.self_mutation_happened && !(github.event.pull_request.head.repo.full_name != github.repository) + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + token: \${{ secrets.PROJEN_GITHUB_TOKEN }} + ref: \${{ github.event.pull_request.head.ref }} + repository: \${{ github.event.pull_request.head.repo.full_name }} + - name: Download patch + uses: actions/download-artifact@v3 + with: + name: .repo.patch + path: \${{ runner.temp }} + - name: Apply patch + run: '[ -s \${{ runner.temp }}/.repo.patch ] && git apply \${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."' + - name: Set git identity + run: |- + git config user.name "github-actions" + git config user.email "github-actions@github.com" + - name: Push changes + env: + PULL_REQUEST_REF: \${{ github.event.pull_request.head.ref }} + run: |- + git add . + git commit -s -m "chore: self mutation" + git push origin HEAD:$PULL_REQUEST_REF +", + ".github/workflows/pull-request-lint.yml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +name: pull-request-lint +on: + pull_request_target: + types: + - labeled + - opened + - synchronize + - reopened + - ready_for_review + - edited +jobs: + validate: + name: Validate PR title + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: amannn/action-semantic-pull-request@v5.0.2 + env: + GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} + with: + types: |- + feat + fix + chore + requireScope: false + githubBaseUrl: \${{ github.api_url }} +", + ".github/workflows/upgrade.yml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +name: upgrade +on: + workflow_dispatch: {} + schedule: + - cron: 0 0 * * * +jobs: + upgrade: + name: Upgrade + runs-on: ubuntu-latest + permissions: + contents: read + outputs: + patch_created: \${{ steps.create_patch.outputs.patch_created }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install dependencies + run: yarn install --check-files --frozen-lockfile + - name: Upgrade dependencies + run: npx projen upgrade + - name: Find mutations + id: create_patch + run: |- + git add . + git diff --staged --patch --exit-code > .repo.patch || echo "patch_created=true" >> $GITHUB_OUTPUT + - name: Upload patch + if: steps.create_patch.outputs.patch_created + uses: actions/upload-artifact@v3 + with: + name: .repo.patch + path: .repo.patch + pr: + name: Create Pull Request + needs: upgrade + runs-on: ubuntu-latest + permissions: + contents: read + if: \${{ needs.upgrade.outputs.patch_created }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: {} + - name: Download patch + uses: actions/download-artifact@v3 + with: + name: .repo.patch + path: \${{ runner.temp }} + - name: Apply patch + run: '[ -s \${{ runner.temp }}/.repo.patch ] && git apply \${{ runner.temp }}/.repo.patch || echo "Empty patch. Skipping."' + - name: Set git identity + run: |- + git config user.name "github-actions" + git config user.email "github-actions@github.com" + - name: Create Pull Request + id: create-pr + uses: peter-evans/create-pull-request@v4 + with: + token: \${{ secrets.PROJEN_GITHUB_TOKEN }} + commit-message: |- + chore(deps): upgrade dependencies + + Upgrades project dependencies. See details in [workflow run]. + + [Workflow Run]: \${{ github.server_url }}/\${{ github.repository }}/actions/runs/\${{ github.run_id }} + + ------ + + *Automatically created by projen via the "upgrade" workflow* + branch: github-actions/upgrade + title: "chore(deps): upgrade dependencies" + body: |- + Upgrades project dependencies. See details in [workflow run]. + + [Workflow Run]: \${{ github.server_url }}/\${{ github.repository }}/actions/runs/\${{ github.run_id }} + + ------ + + *Automatically created by projen via the "upgrade" workflow* + author: github-actions + committer: github-actions + signoff: true +", + ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/.github/workflows/pull-request-lint.yml +!/package.json +!/LICENSE +!/.npmignore +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +pids +*.pid +*.seed +*.pid.lock +lib-cov +coverage +*.lcov +.nyc_output +build/Release +node_modules/ +jspm_packages/ +*.tsbuildinfo +.eslintcache +*.tgz +.yarn-integrity +.cache +!/.projenrc.js +/test-reports/ +junit.xml +/coverage/ +!/.github/workflows/build.yml +!/.mergify.yml +!/.github/workflows/upgrade.yml +!/.github/pull_request_template.md +!/.prettierignore +!/.prettierrc.json +!/test/ +!/tsconfig.json +!/tsconfig.dev.json +!/src/ +/lib +/dist/ +!/.eslintrc.json +/assets/ +!/cdk.json +/cdk.out/ +.cdk.staging/ +.parcel-cache/ +", + ".mergify.yml": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +queue_rules: + - name: default + update_method: merge + conditions: + - "#approved-reviews-by>=1" + - -label~=(do-not-merge) + - status-success=build +pull_request_rules: + - name: Automatic merge on approval and successful build + actions: + delete_head_branch: {} + queue: + method: squash + name: default + commit_message_template: |- + {{ title }} (#{{ number }}) + + {{ body }} + conditions: + - "#approved-reviews-by>=1" + - -label~=(do-not-merge) + - status-success=build +", + ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +/.projen/ +/test-reports/ +junit.xml +/coverage/ +permissions-backup.acl +/.mergify.yml +/test/ +/tsconfig.dev.json +/src/ +!/lib/ +!/lib/**/*.js +!/lib/**/*.d.ts +dist +/tsconfig.json +/.github/ +/.vscode/ +/.idea/ +/.projenrc.js +tsconfig.tsbuildinfo +/.eslintrc.json +!/assets/ +cdk.out/ +.cdk.staging/ +", + ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +", + ".prettierrc.json": { + "overrides": [], + }, + ".projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": [ + { + "name": "@types/jest", + "type": "build", + }, + { + "name": "@types/node", + "type": "build", + "version": "^16", + }, + { + "name": "@typescript-eslint/eslint-plugin", + "type": "build", + "version": "^6", + }, + { + "name": "@typescript-eslint/parser", + "type": "build", + "version": "^6", + }, + { + "name": "aws-cdk", + "type": "build", + "version": "^2.1.0", + }, + { + "name": "esbuild", + "type": "build", + }, + { + "name": "eslint-config-prettier", + "type": "build", + }, + { + "name": "eslint-import-resolver-node", + "type": "build", + }, + { + "name": "eslint-import-resolver-typescript", + "type": "build", + }, + { + "name": "eslint-plugin-import", + "type": "build", + }, + { + "name": "eslint-plugin-prettier", + "type": "build", + }, + { + "name": "eslint", + "type": "build", + "version": "^8", + }, + { + "name": "jest", + "type": "build", + }, + { + "name": "jest-junit", + "type": "build", + "version": "^15", + }, + { + "name": "npm-check-updates", + "type": "build", + "version": "^16", + }, + { + "name": "prettier", + "type": "build", + }, + { + "name": "projen", + "type": "build", + }, + { + "name": "ts-jest", + "type": "build", + }, + { + "name": "ts-node", + "type": "build", + }, + { + "name": "typescript", + "type": "build", + }, + { + "name": "@aws/pdk", + "type": "runtime", + }, + { + "name": "aws-cdk-lib", + "type": "runtime", + "version": "^2.1.0", + }, + { + "name": "constructs", + "type": "runtime", + "version": "^10.0.5", + }, + ], + }, + ".projen/files.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "files": [ + ".eslintrc.json", + ".gitattributes", + ".github/pull_request_template.md", + ".github/workflows/build.yml", + ".github/workflows/pull-request-lint.yml", + ".github/workflows/upgrade.yml", + ".gitignore", + ".mergify.yml", + ".npmignore", + ".prettierignore", + ".prettierrc.json", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "cdk.json", + "LICENSE", + "tsconfig.dev.json", + "tsconfig.json", + ], + }, + ".projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "env": { + "PATH": "$(npx -c "node --print process.env.PATH")", + }, + "tasks": { + "build": { + "description": "Full release build", + "name": "build", + "steps": [ + { + "spawn": "default", + }, + { + "spawn": "pre-compile", + }, + { + "spawn": "compile", + }, + { + "spawn": "post-compile", + }, + { + "spawn": "test", + }, + { + "spawn": "package", + }, + ], + }, + "bundle": { + "description": "Prepare assets", + "name": "bundle", + }, + "clobber": { + "condition": "git diff --exit-code > /dev/null", + "description": "hard resets to HEAD of origin and cleans the local repo", + "env": { + "BRANCH": "$(git branch --show-current)", + }, + "name": "clobber", + "steps": [ + { + "exec": "git checkout -b scratch", + "name": "save current HEAD in "scratch" branch", + }, + { + "exec": "git checkout $BRANCH", + }, + { + "exec": "git fetch origin", + "name": "fetch latest changes from origin", + }, + { + "exec": "git reset --hard origin/$BRANCH", + "name": "hard reset to origin commit", + }, + { + "exec": "git clean -fdx", + "name": "clean all untracked files", + }, + { + "say": "ready to rock! (unpushed commits are under the "scratch" branch)", + }, + ], + }, + "compile": { + "description": "Only compile", + "name": "compile", + }, + "default": { + "description": "Synthesize project files", + "name": "default", + "steps": [ + { + "exec": "node .projenrc.js", + }, + ], + }, + "deploy": { + "description": "Deploys your CDK app to the AWS cloud", + "name": "deploy", + "steps": [ + { + "exec": "cdk deploy", + "receiveArgs": true, + }, + ], + }, + "destroy": { + "description": "Destroys your cdk app in the AWS cloud", + "name": "destroy", + "steps": [ + { + "exec": "cdk destroy", + "receiveArgs": true, + }, + ], + }, + "diff": { + "description": "Diffs the currently deployed app against your code", + "name": "diff", + "steps": [ + { + "exec": "cdk diff", + }, + ], + }, + "eject": { + "description": "Remove projen from the project", + "env": { + "PROJEN_EJECTING": "true", + }, + "name": "eject", + "steps": [ + { + "spawn": "default", + }, + ], + }, + "eslint": { + "description": "Runs eslint against the codebase", + "name": "eslint", + "steps": [ + { + "exec": "eslint --ext .ts,.tsx --fix --no-error-on-unmatched-pattern src test build-tools .projenrc.js", + }, + ], + }, + "install": { + "description": "Install project dependencies and update lockfile (non-frozen)", + "name": "install", + "steps": [ + { + "exec": "yarn install --check-files", + }, + ], + }, + "install:ci": { + "description": "Install project dependencies using frozen lockfile", + "name": "install:ci", + "steps": [ + { + "exec": "yarn install --check-files --frozen-lockfile", + }, + ], + }, + "package": { + "description": "Creates the distribution package", + "name": "package", + }, + "post-compile": { + "description": "Runs after successful compilation", + "name": "post-compile", + "steps": [ + { + "spawn": "synth:silent", + }, + ], + }, + "post-upgrade": { + "description": "Runs after upgrading dependencies", + "name": "post-upgrade", + }, + "pre-compile": { + "description": "Prepare the project for compilation", + "name": "pre-compile", + }, + "synth": { + "description": "Synthesizes your cdk app into cdk.out", + "name": "synth", + "steps": [ + { + "exec": "cdk synth", + }, + ], + }, + "synth:silent": { + "description": "Synthesizes your cdk app into cdk.out and suppresses the template in stdout (part of "yarn build")", + "name": "synth:silent", + "steps": [ + { + "exec": "cdk synth -q", + }, + ], + }, + "test": { + "description": "Run tests", + "name": "test", + "steps": [ + { + "exec": "jest --passWithNoTests \${CI:-'--updateSnapshot'}", + }, + { + "spawn": "eslint", + }, + ], + }, + "test:watch": { + "description": "Run jest in watch mode", + "name": "test:watch", + "steps": [ + { + "exec": "jest --watch", + }, + ], + }, + "upgrade": { + "description": "upgrade dependencies", + "env": { + "CI": "0", + }, + "name": "upgrade", + "steps": [ + { + "exec": "yarn upgrade npm-check-updates", + }, + { + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,aws-cdk,esbuild,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,jest,jest-junit,npm-check-updates,prettier,projen,ts-jest,ts-node,typescript,@aws/pdk,aws-cdk-lib,constructs", + }, + { + "exec": "yarn install --check-files", + }, + { + "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser aws-cdk esbuild eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint jest jest-junit npm-check-updates prettier projen ts-jest ts-node typescript @aws/pdk aws-cdk-lib constructs", + }, + { + "exec": "npx projen", + }, + { + "spawn": "post-upgrade", + }, + ], + }, + "watch": { + "description": "Watches changes in your source code and rebuilds and deploys to the current account", + "name": "watch", + "steps": [ + { + "exec": "cdk deploy --hotswap", + }, + { + "exec": "cdk watch", + }, + ], + }, + }, + }, + "LICENSE": " + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +", + "README.md": "## Getting started + +Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infrastructure/index.html)", + "cdk.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "app": "npx ts-node -P tsconfig.json --prefer-ts-exts src/main.ts", + "build": "npx projen bundle", + "output": "cdk.out", + "watch": { + "exclude": [ + "README.md", + "cdk*.json", + "**/*.d.ts", + "**/*.js", + "tsconfig.json", + "package*.json", + "yarn.lock", + "node_modules", + ], + "include": [ + "src/**/*.ts", + "test/**/*.ts", + ], + }, + }, + "package.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": { + "@aws/pdk": "*", + "aws-cdk-lib": "^2.1.0", + "constructs": "^10.0.5", + }, + "devDependencies": { + "@types/jest": "*", + "@types/node": "^16", + "@typescript-eslint/eslint-plugin": "^6", + "@typescript-eslint/parser": "^6", + "aws-cdk": "^2.1.0", + "esbuild": "*", + "eslint": "^8", + "eslint-config-prettier": "*", + "eslint-import-resolver-node": "*", + "eslint-import-resolver-typescript": "*", + "eslint-plugin-import": "*", + "eslint-plugin-prettier": "*", + "jest": "*", + "jest-junit": "^15", + "npm-check-updates": "^16", + "prettier": "*", + "projen": "*", + "ts-jest": "*", + "ts-node": "*", + "typescript": "*", + }, + "jest": { + "clearMocks": true, + "collectCoverage": true, + "coverageDirectory": "coverage", + "coveragePathIgnorePatterns": [ + "/node_modules/", + ], + "coverageReporters": [ + "json", + "lcov", + "clover", + "cobertura", + "text", + ], + "globals": { + "ts-jest": { + "tsconfig": "tsconfig.dev.json", + }, + }, + "preset": "ts-jest", + "reporters": [ + "default", + [ + "jest-junit", + { + "outputDirectory": "test-reports", + }, + ], + ], + "testMatch": [ + "/src/**/__tests__/**/*.ts?(x)", + "/(test|src)/**/*(*.)@(spec|test).ts?(x)", + ], + "testPathIgnorePatterns": [ + "/node_modules/", + ], + "watchPathIgnorePatterns": [ + "/node_modules/", + ], + }, + "license": "Apache-2.0", + "name": "Defaults", + "scripts": { + "build": "npx projen build", + "bundle": "npx projen bundle", + "clobber": "npx projen clobber", + "compile": "npx projen compile", + "default": "npx projen default", + "deploy": "npx projen deploy", + "destroy": "npx projen destroy", + "diff": "npx projen diff", + "eject": "npx projen eject", + "eslint": "npx projen eslint", + "package": "npx projen package", + "post-compile": "npx projen post-compile", + "post-upgrade": "npx projen post-upgrade", + "pre-compile": "npx projen pre-compile", + "projen": "npx projen", + "synth": "npx projen synth", + "synth:silent": "npx projen synth:silent", + "test": "npx projen test", + "test:watch": "npx projen test:watch", + "upgrade": "npx projen upgrade", + "watch": "npx projen watch", + }, + "version": "0.0.0", + }, + "src/main.ts": "import { CdkGraph, FilterPreset, Filters } from "@aws/pdk/cdk-graph"; +import { CdkGraphDiagramPlugin } from "@aws/pdk/cdk-graph-plugin-diagram"; +import { AwsPrototypingChecks, PDKNag } from "@aws/pdk/pdk-nag"; +import { ApplicationStack } from "./stacks/application-stack"; + +// for development, use account/region from cdk cli +const devEnv = { + account: process.env.CDK_DEFAULT_ACCOUNT, + region: process.env.CDK_DEFAULT_REGION, +}; + +/* eslint-disable @typescript-eslint/no-floating-promises */ +(async () => { + const app = PDKNag.app({ + nagPacks: [new AwsPrototypingChecks()], + }); + + new ApplicationStack(app, "infra-dev", { env: devEnv }); + + const graph = new CdkGraph(app, { + plugins: [ + new CdkGraphDiagramPlugin({ + defaults: { + filterPlan: { + preset: FilterPreset.COMPACT, + filters: [{ store: Filters.pruneCustomResources() }], + }, + }, + }), + ], + }); + + app.synth(); + await graph.report(); +})(); +", + "src/stacks/application-stack.ts": "import { UserIdentity } from "@aws/pdk/identity"; +import { Stack, StackProps } from "aws-cdk-lib"; +import { Construct } from "constructs"; + +export class ApplicationStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const userIdentity = new UserIdentity(this, \`\${id}UserIdentity\`); + } +} +", + "test/main.test.ts": "import { App } from "aws-cdk-lib"; +import { Template } from "aws-cdk-lib/assertions"; +import { ApplicationStack } from "../src/stacks/application-stack"; + +test("Snapshot", () => { + const app = new App(); + const stack = new ApplicationStack(app, "test"); + + const template = Template.fromStack(stack); + expect(template.toJSON()).toMatchSnapshot(); +}); +", + "tsconfig.dev.json": { + "compilerOptions": { + "alwaysStrict": true, + "declaration": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "inlineSourceMap": true, + "inlineSources": true, + "lib": [ + "es2019", + ], + "module": "CommonJS", + "noEmitOnError": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "resolveJsonModule": true, + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "stripInternal": true, + "target": "ES2019", + }, + "exclude": [ + "node_modules", + ], + "include": [ + ".projenrc.js", + "src/**/*.ts", + "test/**/*.ts", + ], + }, + "tsconfig.json": { + "compilerOptions": { + "alwaysStrict": true, + "declaration": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "inlineSourceMap": true, + "inlineSources": true, + "lib": [ + "es2019", + ], + "module": "CommonJS", + "noEmitOnError": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "lib", + "resolveJsonModule": true, + "rootDir": "src", + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "stripInternal": true, + "target": "ES2019", + }, + "exclude": [ + "cdk.out", + ], + "include": [ + "src/**/*.ts", + ], + }, +} +`; + +exports[`InfrastructureTsProject With Api 1`] = ` +{ + "infra/.eslintrc.json": { + "env": { + "jest": true, + "node": true, + }, + "extends": [ + "plugin:import/typescript", + "prettier", + "plugin:prettier/recommended", + ], + "ignorePatterns": [ + "*.js", + "*.d.ts", + "node_modules/", + "*.generated.ts", + "coverage", + ], + "overrides": [], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2018, + "project": "./tsconfig.dev.json", + "sourceType": "module", + }, + "plugins": [ + "@typescript-eslint", + "import", + "prettier", + ], + "root": true, + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { + "default": [ + "public-static-field", + "public-static-method", + "protected-static-field", + "protected-static-method", + "private-static-field", + "private-static-method", + "field", + "constructor", + "method", + ], + }, + ], + "@typescript-eslint/no-floating-promises": [ + "error", + ], + "@typescript-eslint/no-require-imports": [ + "error", + ], + "@typescript-eslint/no-shadow": [ + "error", + ], + "@typescript-eslint/return-await": [ + "error", + ], + "dot-notation": [ + "error", + ], + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": [ + "**/test/**", + "**/build-tools/**", + ], + "optionalDependencies": false, + "peerDependencies": true, + }, + ], + "import/no-unresolved": [ + "error", + ], + "import/order": [ + "warn", + { + "alphabetize": { + "caseInsensitive": true, + "order": "asc", + }, + "groups": [ + "builtin", + "external", + ], + }, + ], + "key-spacing": [ + "error", + ], + "no-bitwise": [ + "error", + ], + "no-duplicate-imports": [ + "error", + ], + "no-multiple-empty-lines": [ + "error", + ], + "no-return-await": [ + "off", + ], + "no-shadow": [ + "off", + ], + "no-trailing-spaces": [ + "error", + ], + "prettier/prettier": [ + "error", + ], + }, + "settings": { + "import/parsers": { + "@typescript-eslint/parser": [ + ".ts", + ".tsx", + ], + }, + "import/resolver": { + "node": {}, + "typescript": { + "alwaysTryTypes": true, + "project": "./tsconfig.dev.json", + }, + }, + }, + }, + "infra/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +/.eslintrc.json linguist-generated +/.gitattributes linguist-generated +/.gitignore linguist-generated +/.npmignore linguist-generated +/.prettierignore linguist-generated +/.prettierrc.json linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/cdk.json linguist-generated +/LICENSE linguist-generated +/package.json linguist-generated +/project.json linguist-generated +/tsconfig.dev.json linguist-generated +/tsconfig.json linguist-generated +/yarn.lock linguist-generated", + "infra/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/package.json +!/LICENSE +!/.npmignore +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +pids +*.pid +*.seed +*.pid.lock +lib-cov +coverage +*.lcov +.nyc_output +build/Release +node_modules/ +jspm_packages/ +*.tsbuildinfo +.eslintcache +*.tgz +.yarn-integrity +.cache +!/.projenrc.js +/test-reports/ +junit.xml +/coverage/ +!/.prettierignore +!/.prettierrc.json +!/test/ +!/tsconfig.json +!/tsconfig.dev.json +!/src/ +/lib +/dist/ +!/.eslintrc.json +/assets/ +!/cdk.json +/cdk.out/ +.cdk.staging/ +.parcel-cache/ +!/project.json +", + "infra/.npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +/.projen/ +/test-reports/ +junit.xml +/coverage/ +/test/ +/tsconfig.dev.json +/src/ +!/lib/ +!/lib/**/*.js +!/lib/**/*.d.ts +dist +/tsconfig.json +/.github/ +/.vscode/ +/.idea/ +/.projenrc.js +tsconfig.tsbuildinfo +/.eslintrc.json +!/assets/ +cdk.out/ +.cdk.staging/ +", + "infra/.prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +", + "infra/.prettierrc.json": { + "overrides": [], + }, + "infra/.projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": [ + { + "name": "@types/jest", + "type": "build", + }, + { + "name": "@types/node", + "type": "build", + "version": "^16", + }, + { + "name": "@typescript-eslint/eslint-plugin", + "type": "build", + "version": "^6", + }, + { + "name": "@typescript-eslint/parser", + "type": "build", + "version": "^6", + }, + { + "name": "aws-cdk", + "type": "build", + "version": "^2.1.0", + }, + { + "name": "esbuild", + "type": "build", + }, + { + "name": "eslint-config-prettier", + "type": "build", + }, + { + "name": "eslint-import-resolver-node", + "type": "build", + }, + { + "name": "eslint-import-resolver-typescript", + "type": "build", + }, + { + "name": "eslint-plugin-import", + "type": "build", + }, + { + "name": "eslint-plugin-prettier", + "type": "build", + }, + { + "name": "eslint", + "type": "build", + "version": "^8", + }, + { + "name": "jest", + "type": "build", + }, + { + "name": "jest-junit", + "type": "build", + "version": "^15", + }, + { + "name": "npm-check-updates", + "type": "build", + "version": "^16", + }, + { + "name": "prettier", + "type": "build", + }, + { + "name": "projen", + "type": "build", + }, + { + "name": "ts-jest", + "type": "build", + }, + { + "name": "ts-node", + "type": "build", + }, + { + "name": "typescript", + "type": "build", + }, + { + "name": "@aws/pdk", + "type": "runtime", + }, + { + "name": "Api-typescript-infra", + "type": "runtime", + }, + { + "name": "aws-cdk-lib", + "type": "runtime", + "version": "^2.1.0", + }, + { + "name": "constructs", + "type": "runtime", + "version": "^10.0.5", + }, + ], + }, + "infra/.projen/files.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "files": [ + ".eslintrc.json", + ".gitattributes", + ".gitignore", + ".npmignore", + ".prettierignore", + ".prettierrc.json", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "cdk.json", + "LICENSE", + "project.json", + "tsconfig.dev.json", + "tsconfig.json", + ], + }, + "infra/.projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "env": { + "PATH": "$(npx -c "node --print process.env.PATH")", + }, + "tasks": { + "build": { + "description": "Full release build", + "name": "build", + "steps": [ + { + "spawn": "pre-compile", + }, + { + "spawn": "compile", + }, + { + "spawn": "post-compile", + }, + { + "spawn": "test", + }, + { + "spawn": "package", + }, + ], + }, + "bundle": { + "description": "Prepare assets", + "name": "bundle", + }, + "compile": { + "description": "Only compile", + "name": "compile", + }, + "default": { + "description": "Synthesize project files", + "name": "default", + }, + "deploy": { + "description": "Deploys your CDK app to the AWS cloud", + "name": "deploy", + "steps": [ + { + "exec": "cdk deploy", + "receiveArgs": true, + }, + ], + }, + "destroy": { + "description": "Destroys your cdk app in the AWS cloud", + "name": "destroy", + "steps": [ + { + "exec": "cdk destroy", + "receiveArgs": true, + }, + ], + }, + "diff": { + "description": "Diffs the currently deployed app against your code", + "name": "diff", + "steps": [ + { + "exec": "cdk diff", + }, + ], + }, + "eslint": { + "description": "Runs eslint against the codebase", + "name": "eslint", + "steps": [ + { + "exec": "eslint --ext .ts,.tsx --fix --no-error-on-unmatched-pattern src test build-tools", + }, + ], + }, + "install": { + "description": "Install project dependencies and update lockfile (non-frozen)", + "name": "install", + "steps": [ + { + "exec": "yarn install --check-files", + }, + ], + }, + "install:ci": { + "description": "Install project dependencies using frozen lockfile", + "name": "install:ci", + "steps": [ + { + "exec": "yarn install --check-files --frozen-lockfile", + }, + ], + }, + "package": { + "description": "Creates the distribution package", + "name": "package", + }, + "post-compile": { + "description": "Runs after successful compilation", + "name": "post-compile", + "steps": [ + { + "spawn": "synth:silent", + }, + ], + }, + "post-upgrade": { + "description": "Runs after upgrading dependencies", + "name": "post-upgrade", + }, + "pre-compile": { + "description": "Prepare the project for compilation", + "name": "pre-compile", + }, + "synth": { + "description": "Synthesizes your cdk app into cdk.out", + "name": "synth", + "steps": [ + { + "exec": "cdk synth", + }, + ], + }, + "synth:silent": { + "description": "Synthesizes your cdk app into cdk.out and suppresses the template in stdout (part of "yarn build")", + "name": "synth:silent", + "steps": [ + { + "exec": "cdk synth -q", + }, + ], + }, + "test": { + "description": "Run tests", + "name": "test", + "steps": [ + { + "exec": "jest --passWithNoTests \${CI:-'--updateSnapshot'}", + }, + { + "spawn": "eslint", + }, + ], + }, + "test:watch": { + "description": "Run jest in watch mode", + "name": "test:watch", + "steps": [ + { + "exec": "jest --watch", + }, + ], + }, + "upgrade": { + "description": "upgrade dependencies", + "env": { + "CI": "0", + }, + "name": "upgrade", + "steps": [ + { + "exec": "yarn upgrade npm-check-updates", + }, + { + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,aws-cdk,esbuild,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,jest,jest-junit,npm-check-updates,prettier,projen,ts-jest,ts-node,typescript,@aws/pdk,Api-typescript-infra,aws-cdk-lib,constructs", + }, + { + "exec": "yarn install --check-files", + }, + { + "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser aws-cdk esbuild eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint jest jest-junit npm-check-updates prettier projen ts-jest ts-node typescript @aws/pdk Api-typescript-infra aws-cdk-lib constructs", + }, + { + "exec": "npx projen", + }, + { + "spawn": "post-upgrade", + }, + ], + }, + "watch": { + "description": "Watches changes in your source code and rebuilds and deploys to the current account", + "name": "watch", + "steps": [ + { + "exec": "cdk deploy --hotswap", + }, + { + "exec": "cdk watch", + }, + ], + }, + }, + }, + "infra/LICENSE": " + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +", + "infra/README.md": "## Getting started + +Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infrastructure/index.html)", + "infra/cdk.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "app": "npx ts-node -P tsconfig.json --prefer-ts-exts src/main.ts", + "build": "npx projen bundle", + "output": "cdk.out", + "watch": { + "exclude": [ + "README.md", + "cdk*.json", + "**/*.d.ts", + "**/*.js", + "tsconfig.json", + "package*.json", + "yarn.lock", + "node_modules", + ], + "include": [ + "src/**/*.ts", + "test/**/*.ts", + ], + }, + }, + "infra/package.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": { + "@aws/pdk": "*", + "Api-typescript-infra": "*", + "aws-cdk-lib": "^2.1.0", + "constructs": "^10.0.5", + }, + "devDependencies": { + "@types/jest": "*", + "@types/node": "^16", + "@typescript-eslint/eslint-plugin": "^6", + "@typescript-eslint/parser": "^6", + "aws-cdk": "^2.1.0", + "esbuild": "*", + "eslint": "^8", + "eslint-config-prettier": "*", + "eslint-import-resolver-node": "*", + "eslint-import-resolver-typescript": "*", + "eslint-plugin-import": "*", + "eslint-plugin-prettier": "*", + "jest": "*", + "jest-junit": "^15", + "npm-check-updates": "^16", + "prettier": "*", + "projen": "*", + "ts-jest": "*", + "ts-node": "*", + "typescript": "*", + }, + "jest": { + "clearMocks": true, + "collectCoverage": true, + "coverageDirectory": "coverage", + "coveragePathIgnorePatterns": [ + "/node_modules/", + ], + "coverageReporters": [ + "json", + "lcov", + "clover", + "cobertura", + "text", + ], + "globals": { + "ts-jest": { + "tsconfig": "tsconfig.dev.json", + }, + }, + "preset": "ts-jest", + "reporters": [ + "default", + [ + "jest-junit", + { + "outputDirectory": "test-reports", + }, + ], + ], + "testMatch": [ + "/src/**/__tests__/**/*.ts?(x)", + "/(test|src)/**/*(*.)@(spec|test).ts?(x)", + ], + "testPathIgnorePatterns": [ + "/node_modules/", + ], + "watchPathIgnorePatterns": [ + "/node_modules/", + ], + }, + "license": "Apache-2.0", + "name": "WithApi", + "scripts": { + "build": "npx projen build", + "bundle": "npx projen bundle", + "compile": "npx projen compile", + "default": "npx projen default", + "deploy": "npx projen deploy", + "destroy": "npx projen destroy", + "diff": "npx projen diff", + "eslint": "npx projen eslint", + "package": "npx projen package", + "post-compile": "npx projen post-compile", + "post-upgrade": "npx projen post-upgrade", + "pre-compile": "npx projen pre-compile", + "synth": "npx projen synth", + "synth:silent": "npx projen synth:silent", + "test": "npx projen test", + "test:watch": "npx projen test:watch", + "upgrade": "npx projen upgrade", + "watch": "npx projen watch", + }, + "version": "0.0.0", + }, + "infra/project.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "name": "WithApi", + "root": "infra", + "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen build", + "cwd": "infra", + }, + }, + "bundle": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen bundle", + "cwd": "infra", + }, + }, + "compile": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen compile", + "cwd": "infra", + }, + }, + "default": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen default", + "cwd": "infra", + }, + }, + "deploy": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen deploy", + "cwd": "infra", + }, + }, + "destroy": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen destroy", + "cwd": "infra", + }, + }, + "diff": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen diff", + "cwd": "infra", + }, + }, + "eslint": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen eslint", + "cwd": "infra", + }, + }, + "package": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen package", + "cwd": "infra", + }, + }, + "post-compile": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen post-compile", + "cwd": "infra", + }, + }, + "post-upgrade": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen post-upgrade", + "cwd": "infra", + }, + }, + "pre-compile": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen pre-compile", + "cwd": "infra", + }, + }, + "synth": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen synth", + "cwd": "infra", + }, + }, + "synth:silent": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen synth:silent", + "cwd": "infra", + }, + }, + "test": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen test", + "cwd": "infra", + }, + }, + "test:watch": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen test:watch", + "cwd": "infra", + }, + }, + "upgrade": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen upgrade", + "cwd": "infra", + }, + }, + "watch": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen watch", + "cwd": "infra", + }, + }, + }, + }, + "infra/src/constructs/api.ts": "import { UserIdentity } from "@aws/pdk/identity"; +import { Authorizers } from "@aws/pdk/type-safe-api"; +import { Stack } from "aws-cdk-lib"; +import { Cors } from "aws-cdk-lib/aws-apigateway"; +import { + AccountPrincipal, + AnyPrincipal, + Effect, + PolicyDocument, + PolicyStatement, +} from "aws-cdk-lib/aws-iam"; +import { Construct } from "constructs"; +import { Api, MockIntegrations } from "Api-typescript-infra"; + +/** + * Api construct props. + */ +export interface ApiConstructProps { + /** + * Instance of the UserIdentity. + */ + readonly userIdentity: UserIdentity; +} + +/** + * Infrastructure construct to deploy a Type Safe API. + */ +export class ApiConstruct extends Construct { + /** + * API instance + */ + public readonly api: Api; + + constructor(scope: Construct, id: string, props?: ApiConstructProps) { + super(scope, id); + + this.api = new Api(this, id, { + defaultAuthorizer: Authorizers.iam(), + corsOptions: { + allowOrigins: Cors.ALL_ORIGINS, + allowMethods: Cors.ALL_METHODS, + }, + integrations: MockIntegrations.mockAll(), + policy: new PolicyDocument({ + statements: [ + // Here we grant any AWS credentials from the account that the prototype is deployed in to call the api. + // Machine to machine fine-grained access can be defined here using more specific principals (eg roles or + // users) and resources (ie which api paths may be invoked by which principal) if required. + // If doing so, the cognito identity pool authenticated role must still be granted access for cognito users to + // still be granted access to the API. + new PolicyStatement({ + effect: Effect.ALLOW, + principals: [new AccountPrincipal(Stack.of(this).account)], + actions: ["execute-api:Invoke"], + resources: ["execute-api:/*"], + }), + // Open up OPTIONS to allow browsers to make unauthenticated preflight requests + new PolicyStatement({ + effect: Effect.ALLOW, + principals: [new AnyPrincipal()], + actions: ["execute-api:Invoke"], + resources: ["execute-api:/*/OPTIONS/*"], + }), + ], + }), + }); + + // Grant authenticated users access to invoke the api + props?.userIdentity.identityPool.authenticatedRole.addToPrincipalPolicy( + new PolicyStatement({ + effect: Effect.ALLOW, + actions: ["execute-api:Invoke"], + resources: [this.api.api.arnForExecuteApi("*", "/*", "*")], + }), + ); + } +} +", + "infra/src/main.ts": "import { CdkGraph, FilterPreset, Filters } from "@aws/pdk/cdk-graph"; +import { CdkGraphDiagramPlugin } from "@aws/pdk/cdk-graph-plugin-diagram"; +import { AwsPrototypingChecks, PDKNag } from "@aws/pdk/pdk-nag"; +import { ApplicationStack } from "./stacks/application-stack"; + +// for development, use account/region from cdk cli +const devEnv = { + account: process.env.CDK_DEFAULT_ACCOUNT, + region: process.env.CDK_DEFAULT_REGION, +}; + +/* eslint-disable @typescript-eslint/no-floating-promises */ +(async () => { + const app = PDKNag.app({ + nagPacks: [new AwsPrototypingChecks()], + }); + + new ApplicationStack(app, "infra-dev", { env: devEnv }); + + const graph = new CdkGraph(app, { + plugins: [ + new CdkGraphDiagramPlugin({ + defaults: { + filterPlan: { + preset: FilterPreset.COMPACT, + filters: [{ store: Filters.pruneCustomResources() }], + }, + }, + }), + ], + }); + + app.synth(); + await graph.report(); +})(); +", + "infra/src/stacks/application-stack.ts": "import { UserIdentity } from "@aws/pdk/identity"; +import { Stack, StackProps } from "aws-cdk-lib"; +import { Construct } from "constructs"; +import { ApiConstruct } from "../constructs/api"; + +export class ApplicationStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const userIdentity = new UserIdentity(this, \`\${id}UserIdentity\`); + new ApiConstruct(this, "Api", { + userIdentity, + }); + } +} +", + "infra/test/main.test.ts": "import { App } from "aws-cdk-lib"; +import { Template } from "aws-cdk-lib/assertions"; +import { ApplicationStack } from "../src/stacks/application-stack"; + +test("Snapshot", () => { + const app = new App(); + const stack = new ApplicationStack(app, "test"); + + const template = Template.fromStack(stack); + expect(template.toJSON()).toMatchSnapshot(); +}); +", + "infra/tsconfig.dev.json": { + "compilerOptions": { + "alwaysStrict": true, + "declaration": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "inlineSourceMap": true, + "inlineSources": true, + "lib": [ + "es2019", + ], + "module": "CommonJS", + "noEmitOnError": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "resolveJsonModule": true, + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "stripInternal": true, + "target": "ES2019", + }, + "exclude": [ + "node_modules", + ], + "include": [ + ".projenrc.js", + "src/**/*.ts", + "test/**/*.ts", + ], + }, + "infra/tsconfig.json": { + "compilerOptions": { + "alwaysStrict": true, + "declaration": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "inlineSourceMap": true, + "inlineSources": true, + "lib": [ + "es2019", + ], + "module": "CommonJS", + "noEmitOnError": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "lib", + "resolveJsonModule": true, + "rootDir": "src", + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "stripInternal": true, + "target": "ES2019", + }, + "exclude": [ + "cdk.out", + ], + "include": [ + "src/**/*.ts", + ], + }, +} +`; + +exports[`InfrastructureTsProject With Api and Website 1`] = ` +{ + "infra/.eslintrc.json": { + "env": { + "jest": true, + "node": true, + }, + "extends": [ + "plugin:import/typescript", + "prettier", + "plugin:prettier/recommended", + ], + "ignorePatterns": [ + "*.js", + "*.d.ts", + "node_modules/", + "*.generated.ts", + "coverage", + ], + "overrides": [], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2018, + "project": "./tsconfig.dev.json", + "sourceType": "module", + }, + "plugins": [ + "@typescript-eslint", + "import", + "prettier", + ], + "root": true, + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { + "default": [ + "public-static-field", + "public-static-method", + "protected-static-field", + "protected-static-method", + "private-static-field", + "private-static-method", + "field", + "constructor", + "method", + ], + }, + ], + "@typescript-eslint/no-floating-promises": [ + "error", + ], + "@typescript-eslint/no-require-imports": [ + "error", + ], + "@typescript-eslint/no-shadow": [ + "error", + ], + "@typescript-eslint/return-await": [ + "error", + ], + "dot-notation": [ + "error", + ], + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": [ + "**/test/**", + "**/build-tools/**", + ], + "optionalDependencies": false, + "peerDependencies": true, + }, + ], + "import/no-unresolved": [ + "error", + ], + "import/order": [ + "warn", + { + "alphabetize": { + "caseInsensitive": true, + "order": "asc", + }, + "groups": [ + "builtin", + "external", + ], + }, + ], + "key-spacing": [ + "error", + ], + "no-bitwise": [ + "error", + ], + "no-duplicate-imports": [ + "error", + ], + "no-multiple-empty-lines": [ + "error", + ], + "no-return-await": [ + "off", + ], + "no-shadow": [ + "off", + ], + "no-trailing-spaces": [ + "error", + ], + "prettier/prettier": [ + "error", + ], + }, + "settings": { + "import/parsers": { + "@typescript-eslint/parser": [ + ".ts", + ".tsx", + ], + }, + "import/resolver": { + "node": {}, + "typescript": { + "alwaysTryTypes": true, + "project": "./tsconfig.dev.json", + }, + }, + }, + }, + "infra/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +/.eslintrc.json linguist-generated +/.gitattributes linguist-generated +/.gitignore linguist-generated +/.npmignore linguist-generated +/.prettierignore linguist-generated +/.prettierrc.json linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/cdk.json linguist-generated +/LICENSE linguist-generated +/package.json linguist-generated +/project.json linguist-generated +/tsconfig.dev.json linguist-generated +/tsconfig.json linguist-generated +/yarn.lock linguist-generated", + "infra/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/package.json +!/LICENSE +!/.npmignore +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +pids +*.pid +*.seed +*.pid.lock +lib-cov +coverage +*.lcov +.nyc_output +build/Release +node_modules/ +jspm_packages/ +*.tsbuildinfo +.eslintcache +*.tgz +.yarn-integrity +.cache +!/.projenrc.js +/test-reports/ +junit.xml +/coverage/ +!/.prettierignore +!/.prettierrc.json +!/test/ +!/tsconfig.json +!/tsconfig.dev.json +!/src/ +/lib +/dist/ +!/.eslintrc.json +/assets/ +!/cdk.json +/cdk.out/ +.cdk.staging/ +.parcel-cache/ +!/project.json +", + "infra/.npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +/.projen/ +/test-reports/ +junit.xml +/coverage/ +/test/ +/tsconfig.dev.json +/src/ +!/lib/ +!/lib/**/*.js +!/lib/**/*.d.ts +dist +/tsconfig.json +/.github/ +/.vscode/ +/.idea/ +/.projenrc.js +tsconfig.tsbuildinfo +/.eslintrc.json +!/assets/ +cdk.out/ +.cdk.staging/ +", + "infra/.prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +", + "infra/.prettierrc.json": { + "overrides": [], + }, + "infra/.projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": [ + { + "name": "@types/jest", + "type": "build", + }, + { + "name": "@types/node", + "type": "build", + "version": "^16", + }, + { + "name": "@typescript-eslint/eslint-plugin", + "type": "build", + "version": "^6", + }, + { + "name": "@typescript-eslint/parser", + "type": "build", + "version": "^6", + }, + { + "name": "aws-cdk", + "type": "build", + "version": "^2.1.0", + }, + { + "name": "esbuild", + "type": "build", + }, + { + "name": "eslint-config-prettier", + "type": "build", + }, + { + "name": "eslint-import-resolver-node", + "type": "build", + }, + { + "name": "eslint-import-resolver-typescript", + "type": "build", + }, + { + "name": "eslint-plugin-import", + "type": "build", + }, + { + "name": "eslint-plugin-prettier", + "type": "build", + }, + { + "name": "eslint", + "type": "build", + "version": "^8", + }, + { + "name": "jest", + "type": "build", + }, + { + "name": "jest-junit", + "type": "build", + "version": "^15", + }, + { + "name": "npm-check-updates", + "type": "build", + "version": "^16", + }, + { + "name": "prettier", + "type": "build", + }, + { + "name": "projen", + "type": "build", + }, + { + "name": "ts-jest", + "type": "build", + }, + { + "name": "ts-node", + "type": "build", + }, + { + "name": "typescript", + "type": "build", + }, + { + "name": "Website", + "type": "build", + }, + { + "name": "@aws/pdk", + "type": "runtime", + }, + { + "name": "Api-typescript-infra", + "type": "runtime", + }, + { + "name": "aws-cdk-lib", + "type": "runtime", + "version": "^2.1.0", + }, + { + "name": "constructs", + "type": "runtime", + "version": "^10.0.5", + }, + ], + }, + "infra/.projen/files.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "files": [ + ".eslintrc.json", + ".gitattributes", + ".gitignore", + ".npmignore", + ".prettierignore", + ".prettierrc.json", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "cdk.json", + "LICENSE", + "project.json", + "tsconfig.dev.json", + "tsconfig.json", + ], + }, + "infra/.projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "env": { + "PATH": "$(npx -c "node --print process.env.PATH")", + }, + "tasks": { + "build": { + "description": "Full release build", + "name": "build", + "steps": [ + { + "spawn": "pre-compile", + }, + { + "spawn": "compile", + }, + { + "spawn": "post-compile", + }, + { + "spawn": "test", + }, + { + "spawn": "package", + }, + ], + }, + "bundle": { + "description": "Prepare assets", + "name": "bundle", + }, + "compile": { + "description": "Only compile", + "name": "compile", + }, + "default": { + "description": "Synthesize project files", + "name": "default", + }, + "deploy": { + "description": "Deploys your CDK app to the AWS cloud", + "name": "deploy", + "steps": [ + { + "exec": "cdk deploy", + "receiveArgs": true, + }, + ], + }, + "destroy": { + "description": "Destroys your cdk app in the AWS cloud", + "name": "destroy", + "steps": [ + { + "exec": "cdk destroy", + "receiveArgs": true, + }, + ], + }, + "diff": { + "description": "Diffs the currently deployed app against your code", + "name": "diff", + "steps": [ + { + "exec": "cdk diff", + }, + ], + }, + "eslint": { + "description": "Runs eslint against the codebase", + "name": "eslint", + "steps": [ + { + "exec": "eslint --ext .ts,.tsx --fix --no-error-on-unmatched-pattern src test build-tools", + }, + ], + }, + "install": { + "description": "Install project dependencies and update lockfile (non-frozen)", + "name": "install", + "steps": [ + { + "exec": "yarn install --check-files", + }, + ], + }, + "install:ci": { + "description": "Install project dependencies using frozen lockfile", + "name": "install:ci", + "steps": [ + { + "exec": "yarn install --check-files --frozen-lockfile", + }, + ], + }, + "package": { + "description": "Creates the distribution package", + "name": "package", + }, + "post-compile": { + "description": "Runs after successful compilation", + "name": "post-compile", + "steps": [ + { + "spawn": "synth:silent", + }, + ], + }, + "post-upgrade": { + "description": "Runs after upgrading dependencies", + "name": "post-upgrade", + }, + "pre-compile": { + "description": "Prepare the project for compilation", + "name": "pre-compile", + }, + "synth": { + "description": "Synthesizes your cdk app into cdk.out", + "name": "synth", + "steps": [ + { + "exec": "cdk synth", + }, + ], + }, + "synth:silent": { + "description": "Synthesizes your cdk app into cdk.out and suppresses the template in stdout (part of "yarn build")", + "name": "synth:silent", + "steps": [ + { + "exec": "cdk synth -q", + }, + ], + }, + "test": { + "description": "Run tests", + "name": "test", + "steps": [ + { + "exec": "jest --passWithNoTests \${CI:-'--updateSnapshot'}", + }, + { + "spawn": "eslint", + }, + ], + }, + "test:watch": { + "description": "Run jest in watch mode", + "name": "test:watch", + "steps": [ + { + "exec": "jest --watch", + }, + ], + }, + "upgrade": { + "description": "upgrade dependencies", + "env": { + "CI": "0", + }, + "name": "upgrade", + "steps": [ + { + "exec": "yarn upgrade npm-check-updates", + }, + { + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,aws-cdk,esbuild,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,jest,jest-junit,npm-check-updates,prettier,projen,ts-jest,ts-node,typescript,Website,@aws/pdk,Api-typescript-infra,aws-cdk-lib,constructs", + }, + { + "exec": "yarn install --check-files", + }, + { + "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser aws-cdk esbuild eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint jest jest-junit npm-check-updates prettier projen ts-jest ts-node typescript Website @aws/pdk Api-typescript-infra aws-cdk-lib constructs", + }, + { + "exec": "npx projen", + }, + { + "spawn": "post-upgrade", + }, + ], + }, + "watch": { + "description": "Watches changes in your source code and rebuilds and deploys to the current account", + "name": "watch", + "steps": [ + { + "exec": "cdk deploy --hotswap", + }, + { + "exec": "cdk watch", + }, + ], + }, + }, + }, + "infra/LICENSE": " + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +", + "infra/README.md": "## Getting started + +Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infrastructure/index.html)", + "infra/cdk.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "app": "npx ts-node -P tsconfig.json --prefer-ts-exts src/main.ts", + "build": "npx projen bundle", + "output": "cdk.out", + "watch": { + "exclude": [ + "README.md", + "cdk*.json", + "**/*.d.ts", + "**/*.js", + "tsconfig.json", + "package*.json", + "yarn.lock", + "node_modules", + ], + "include": [ + "src/**/*.ts", + "test/**/*.ts", + ], + }, + }, + "infra/package.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": { + "@aws/pdk": "*", + "Api-typescript-infra": "*", + "aws-cdk-lib": "^2.1.0", + "constructs": "^10.0.5", + }, + "devDependencies": { + "@types/jest": "*", + "@types/node": "^16", + "@typescript-eslint/eslint-plugin": "^6", + "@typescript-eslint/parser": "^6", + "Website": "*", + "aws-cdk": "^2.1.0", + "esbuild": "*", + "eslint": "^8", + "eslint-config-prettier": "*", + "eslint-import-resolver-node": "*", + "eslint-import-resolver-typescript": "*", + "eslint-plugin-import": "*", + "eslint-plugin-prettier": "*", + "jest": "*", + "jest-junit": "^15", + "npm-check-updates": "^16", + "prettier": "*", + "projen": "*", + "ts-jest": "*", + "ts-node": "*", + "typescript": "*", + }, + "jest": { + "clearMocks": true, + "collectCoverage": true, + "coverageDirectory": "coverage", + "coveragePathIgnorePatterns": [ + "/node_modules/", + ], + "coverageReporters": [ + "json", + "lcov", + "clover", + "cobertura", + "text", + ], + "globals": { + "ts-jest": { + "tsconfig": "tsconfig.dev.json", + }, + }, + "preset": "ts-jest", + "reporters": [ + "default", + [ + "jest-junit", + { + "outputDirectory": "test-reports", + }, + ], + ], + "testMatch": [ + "/src/**/__tests__/**/*.ts?(x)", + "/(test|src)/**/*(*.)@(spec|test).ts?(x)", + ], + "testPathIgnorePatterns": [ + "/node_modules/", + ], + "watchPathIgnorePatterns": [ + "/node_modules/", + ], + }, + "license": "Apache-2.0", + "name": "WithApi", + "scripts": { + "build": "npx projen build", + "bundle": "npx projen bundle", + "compile": "npx projen compile", + "default": "npx projen default", + "deploy": "npx projen deploy", + "destroy": "npx projen destroy", + "diff": "npx projen diff", + "eslint": "npx projen eslint", + "package": "npx projen package", + "post-compile": "npx projen post-compile", + "post-upgrade": "npx projen post-upgrade", + "pre-compile": "npx projen pre-compile", + "synth": "npx projen synth", + "synth:silent": "npx projen synth:silent", + "test": "npx projen test", + "test:watch": "npx projen test:watch", + "upgrade": "npx projen upgrade", + "watch": "npx projen watch", + }, + "version": "0.0.0", + }, + "infra/project.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "name": "WithApi", + "root": "infra", + "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen build", + "cwd": "infra", + }, + }, + "bundle": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen bundle", + "cwd": "infra", + }, + }, + "compile": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen compile", + "cwd": "infra", + }, + }, + "default": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen default", + "cwd": "infra", + }, + }, + "deploy": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen deploy", + "cwd": "infra", + }, + }, + "destroy": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen destroy", + "cwd": "infra", + }, + }, + "diff": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen diff", + "cwd": "infra", + }, + }, + "eslint": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen eslint", + "cwd": "infra", + }, + }, + "package": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen package", + "cwd": "infra", + }, + }, + "post-compile": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen post-compile", + "cwd": "infra", + }, + }, + "post-upgrade": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen post-upgrade", + "cwd": "infra", + }, + }, + "pre-compile": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen pre-compile", + "cwd": "infra", + }, + }, + "synth": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen synth", + "cwd": "infra", + }, + }, + "synth:silent": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen synth:silent", + "cwd": "infra", + }, + }, + "test": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen test", + "cwd": "infra", + }, + }, + "test:watch": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen test:watch", + "cwd": "infra", + }, + }, + "upgrade": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen upgrade", + "cwd": "infra", + }, + }, + "watch": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen watch", + "cwd": "infra", + }, + }, + }, + }, + "infra/src/constructs/api.ts": "import { UserIdentity } from "@aws/pdk/identity"; +import { Authorizers } from "@aws/pdk/type-safe-api"; +import { Stack } from "aws-cdk-lib"; +import { Cors } from "aws-cdk-lib/aws-apigateway"; +import { + AccountPrincipal, + AnyPrincipal, + Effect, + PolicyDocument, + PolicyStatement, +} from "aws-cdk-lib/aws-iam"; +import { Construct } from "constructs"; +import { Api, MockIntegrations } from "Api-typescript-infra"; + +/** + * Api construct props. + */ +export interface ApiConstructProps { + /** + * Instance of the UserIdentity. + */ + readonly userIdentity: UserIdentity; +} + +/** + * Infrastructure construct to deploy a Type Safe API. + */ +export class ApiConstruct extends Construct { + /** + * API instance + */ + public readonly api: Api; + + constructor(scope: Construct, id: string, props?: ApiConstructProps) { + super(scope, id); + + this.api = new Api(this, id, { + defaultAuthorizer: Authorizers.iam(), + corsOptions: { + allowOrigins: Cors.ALL_ORIGINS, + allowMethods: Cors.ALL_METHODS, + }, + integrations: MockIntegrations.mockAll(), + policy: new PolicyDocument({ + statements: [ + // Here we grant any AWS credentials from the account that the prototype is deployed in to call the api. + // Machine to machine fine-grained access can be defined here using more specific principals (eg roles or + // users) and resources (ie which api paths may be invoked by which principal) if required. + // If doing so, the cognito identity pool authenticated role must still be granted access for cognito users to + // still be granted access to the API. + new PolicyStatement({ + effect: Effect.ALLOW, + principals: [new AccountPrincipal(Stack.of(this).account)], + actions: ["execute-api:Invoke"], + resources: ["execute-api:/*"], + }), + // Open up OPTIONS to allow browsers to make unauthenticated preflight requests + new PolicyStatement({ + effect: Effect.ALLOW, + principals: [new AnyPrincipal()], + actions: ["execute-api:Invoke"], + resources: ["execute-api:/*/OPTIONS/*"], + }), + ], + }), + }); + + // Grant authenticated users access to invoke the api + props?.userIdentity.identityPool.authenticatedRole.addToPrincipalPolicy( + new PolicyStatement({ + effect: Effect.ALLOW, + actions: ["execute-api:Invoke"], + resources: [this.api.api.arnForExecuteApi("*", "/*", "*")], + }), + ); + } +} +", + "infra/src/constructs/website.ts": "import { UserIdentity } from "@aws/pdk/identity"; +import { StaticWebsite } from "@aws/pdk/static-website"; +import { Stack } from "aws-cdk-lib"; +import { GeoRestriction } from "aws-cdk-lib/aws-cloudfront"; +import { Construct } from "constructs"; +import { ApiConstruct } from "./api"; + +/** + * Website construct props + */ +export interface WebsiteConstructProps { + /** + * Instance of an API to configure the website to integrate with + */ + readonly apiConstruct: ApiConstruct; + + /** + * Instance of the UserIdentity. + */ + readonly userIdentity: UserIdentity; +} + +/** + * Construct to deploy a Static Website + */ +export class WebsiteConstruct extends Construct { + constructor(scope: Construct, id: string, props?: WebsiteConstructProps) { + super(scope, id); + + new StaticWebsite(this, id, { + websiteContentPath: "../website/build", + runtimeOptions: { + jsonPayload: { + region: Stack.of(this).region, + identityPoolId: props?.userIdentity.identityPool.identityPoolId, + userPoolId: props?.userIdentity.userPool?.userPoolId, + userPoolWebClientId: + props?.userIdentity.userPoolClient?.userPoolClientId, + apiUrl: props?.apiConstruct.api.api.urlForPath(), + }, + }, + distributionProps: { + geoRestriction: GeoRestriction.allowlist( + "AU", + "ID", + "IN", + "JP", + "KR", + "SG", + "US", + ), + }, + }); + } +} +", + "infra/src/main.ts": "import { CdkGraph, FilterPreset, Filters } from "@aws/pdk/cdk-graph"; +import { CdkGraphDiagramPlugin } from "@aws/pdk/cdk-graph-plugin-diagram"; +import { AwsPrototypingChecks, PDKNag } from "@aws/pdk/pdk-nag"; +import { ApplicationStack } from "./stacks/application-stack"; + +// for development, use account/region from cdk cli +const devEnv = { + account: process.env.CDK_DEFAULT_ACCOUNT, + region: process.env.CDK_DEFAULT_REGION, +}; + +/* eslint-disable @typescript-eslint/no-floating-promises */ +(async () => { + const app = PDKNag.app({ + nagPacks: [new AwsPrototypingChecks()], + }); + + new ApplicationStack(app, "infra-dev", { env: devEnv }); + + const graph = new CdkGraph(app, { + plugins: [ + new CdkGraphDiagramPlugin({ + defaults: { + filterPlan: { + preset: FilterPreset.COMPACT, + filters: [{ store: Filters.pruneCustomResources() }], + }, + }, + }), + ], + }); + + app.synth(); + await graph.report(); +})(); +", + "infra/src/stacks/application-stack.ts": "import { UserIdentity } from "@aws/pdk/identity"; +import { Stack, StackProps } from "aws-cdk-lib"; +import { Construct } from "constructs"; +import { ApiConstruct } from "../constructs/api"; +import { WebsiteConstruct } from "../constructs/website"; + +export class ApplicationStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const userIdentity = new UserIdentity(this, \`\${id}UserIdentity\`); + const apiConstruct = new ApiConstruct(this, "Api", { + userIdentity, + }); + new WebsiteConstruct(this, "Website", { userIdentity, apiConstruct }); + } +} +", + "infra/test/main.test.ts": "import { App } from "aws-cdk-lib"; +import { Template } from "aws-cdk-lib/assertions"; +import { ApplicationStack } from "../src/stacks/application-stack"; + +test("Snapshot", () => { + const app = new App(); + const stack = new ApplicationStack(app, "test"); + + const template = Template.fromStack(stack); + expect(template.toJSON()).toMatchSnapshot(); +}); +", + "infra/tsconfig.dev.json": { + "compilerOptions": { + "alwaysStrict": true, + "declaration": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "inlineSourceMap": true, + "inlineSources": true, + "lib": [ + "es2019", + ], + "module": "CommonJS", + "noEmitOnError": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "resolveJsonModule": true, + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "stripInternal": true, + "target": "ES2019", + }, + "exclude": [ + "node_modules", + ], + "include": [ + ".projenrc.js", + "src/**/*.ts", + "test/**/*.ts", + ], + }, + "infra/tsconfig.json": { + "compilerOptions": { + "alwaysStrict": true, + "declaration": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "inlineSourceMap": true, + "inlineSources": true, + "lib": [ + "es2019", + ], + "module": "CommonJS", + "noEmitOnError": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "lib", + "resolveJsonModule": true, + "rootDir": "src", + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "stripInternal": true, + "target": "ES2019", + }, + "exclude": [ + "cdk.out", + ], + "include": [ + "src/**/*.ts", + ], + }, +} +`; + +exports[`InfrastructureTsProject With Website 1`] = ` +{ + "infra/.eslintrc.json": { + "env": { + "jest": true, + "node": true, + }, + "extends": [ + "plugin:import/typescript", + "prettier", + "plugin:prettier/recommended", + ], + "ignorePatterns": [ + "*.js", + "*.d.ts", + "node_modules/", + "*.generated.ts", + "coverage", + ], + "overrides": [], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2018, + "project": "./tsconfig.dev.json", + "sourceType": "module", + }, + "plugins": [ + "@typescript-eslint", + "import", + "prettier", + ], + "root": true, + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { + "default": [ + "public-static-field", + "public-static-method", + "protected-static-field", + "protected-static-method", + "private-static-field", + "private-static-method", + "field", + "constructor", + "method", + ], + }, + ], + "@typescript-eslint/no-floating-promises": [ + "error", + ], + "@typescript-eslint/no-require-imports": [ + "error", + ], + "@typescript-eslint/no-shadow": [ + "error", + ], + "@typescript-eslint/return-await": [ + "error", + ], + "dot-notation": [ + "error", + ], + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": [ + "**/test/**", + "**/build-tools/**", + ], + "optionalDependencies": false, + "peerDependencies": true, + }, + ], + "import/no-unresolved": [ + "error", + ], + "import/order": [ + "warn", + { + "alphabetize": { + "caseInsensitive": true, + "order": "asc", + }, + "groups": [ + "builtin", + "external", + ], + }, + ], + "key-spacing": [ + "error", + ], + "no-bitwise": [ + "error", + ], + "no-duplicate-imports": [ + "error", + ], + "no-multiple-empty-lines": [ + "error", + ], + "no-return-await": [ + "off", + ], + "no-shadow": [ + "off", + ], + "no-trailing-spaces": [ + "error", + ], + "prettier/prettier": [ + "error", + ], + }, + "settings": { + "import/parsers": { + "@typescript-eslint/parser": [ + ".ts", + ".tsx", + ], + }, + "import/resolver": { + "node": {}, + "typescript": { + "alwaysTryTypes": true, + "project": "./tsconfig.dev.json", + }, + }, + }, + }, + "infra/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +/.eslintrc.json linguist-generated +/.gitattributes linguist-generated +/.gitignore linguist-generated +/.npmignore linguist-generated +/.prettierignore linguist-generated +/.prettierrc.json linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/cdk.json linguist-generated +/LICENSE linguist-generated +/package.json linguist-generated +/project.json linguist-generated +/tsconfig.dev.json linguist-generated +/tsconfig.json linguist-generated +/yarn.lock linguist-generated", + "infra/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/package.json +!/LICENSE +!/.npmignore +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +pids +*.pid +*.seed +*.pid.lock +lib-cov +coverage +*.lcov +.nyc_output +build/Release +node_modules/ +jspm_packages/ +*.tsbuildinfo +.eslintcache +*.tgz +.yarn-integrity +.cache +!/.projenrc.js +/test-reports/ +junit.xml +/coverage/ +!/.prettierignore +!/.prettierrc.json +!/test/ +!/tsconfig.json +!/tsconfig.dev.json +!/src/ +/lib +/dist/ +!/.eslintrc.json +/assets/ +!/cdk.json +/cdk.out/ +.cdk.staging/ +.parcel-cache/ +!/project.json +", + "infra/.npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +/.projen/ +/test-reports/ +junit.xml +/coverage/ +/test/ +/tsconfig.dev.json +/src/ +!/lib/ +!/lib/**/*.js +!/lib/**/*.d.ts +dist +/tsconfig.json +/.github/ +/.vscode/ +/.idea/ +/.projenrc.js +tsconfig.tsbuildinfo +/.eslintrc.json +!/assets/ +cdk.out/ +.cdk.staging/ +", + "infra/.prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +", + "infra/.prettierrc.json": { + "overrides": [], + }, + "infra/.projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": [ + { + "name": "@types/jest", + "type": "build", + }, + { + "name": "@types/node", + "type": "build", + "version": "^16", + }, + { + "name": "@typescript-eslint/eslint-plugin", + "type": "build", + "version": "^6", + }, + { + "name": "@typescript-eslint/parser", + "type": "build", + "version": "^6", + }, + { + "name": "aws-cdk", + "type": "build", + "version": "^2.1.0", + }, + { + "name": "esbuild", + "type": "build", + }, + { + "name": "eslint-config-prettier", + "type": "build", + }, + { + "name": "eslint-import-resolver-node", + "type": "build", + }, + { + "name": "eslint-import-resolver-typescript", + "type": "build", + }, + { + "name": "eslint-plugin-import", + "type": "build", + }, + { + "name": "eslint-plugin-prettier", + "type": "build", + }, + { + "name": "eslint", + "type": "build", + "version": "^8", + }, + { + "name": "jest", + "type": "build", + }, + { + "name": "jest-junit", + "type": "build", + "version": "^15", + }, + { + "name": "npm-check-updates", + "type": "build", + "version": "^16", + }, + { + "name": "prettier", + "type": "build", + }, + { + "name": "projen", + "type": "build", + }, + { + "name": "ts-jest", + "type": "build", + }, + { + "name": "ts-node", + "type": "build", + }, + { + "name": "typescript", + "type": "build", + }, + { + "name": "Website", + "type": "build", + }, + { + "name": "@aws/pdk", + "type": "runtime", + }, + { + "name": "aws-cdk-lib", + "type": "runtime", + "version": "^2.1.0", + }, + { + "name": "constructs", + "type": "runtime", + "version": "^10.0.5", + }, + ], + }, + "infra/.projen/files.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "files": [ + ".eslintrc.json", + ".gitattributes", + ".gitignore", + ".npmignore", + ".prettierignore", + ".prettierrc.json", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "cdk.json", + "LICENSE", + "project.json", + "tsconfig.dev.json", + "tsconfig.json", + ], + }, + "infra/.projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "env": { + "PATH": "$(npx -c "node --print process.env.PATH")", + }, + "tasks": { + "build": { + "description": "Full release build", + "name": "build", + "steps": [ + { + "spawn": "pre-compile", + }, + { + "spawn": "compile", + }, + { + "spawn": "post-compile", + }, + { + "spawn": "test", + }, + { + "spawn": "package", + }, + ], + }, + "bundle": { + "description": "Prepare assets", + "name": "bundle", + }, + "compile": { + "description": "Only compile", + "name": "compile", + }, + "default": { + "description": "Synthesize project files", + "name": "default", + }, + "deploy": { + "description": "Deploys your CDK app to the AWS cloud", + "name": "deploy", + "steps": [ + { + "exec": "cdk deploy", + "receiveArgs": true, + }, + ], + }, + "destroy": { + "description": "Destroys your cdk app in the AWS cloud", + "name": "destroy", + "steps": [ + { + "exec": "cdk destroy", + "receiveArgs": true, + }, + ], + }, + "diff": { + "description": "Diffs the currently deployed app against your code", + "name": "diff", + "steps": [ + { + "exec": "cdk diff", + }, + ], + }, + "eslint": { + "description": "Runs eslint against the codebase", + "name": "eslint", + "steps": [ + { + "exec": "eslint --ext .ts,.tsx --fix --no-error-on-unmatched-pattern src test build-tools", + }, + ], + }, + "install": { + "description": "Install project dependencies and update lockfile (non-frozen)", + "name": "install", + "steps": [ + { + "exec": "yarn install --check-files", + }, + ], + }, + "install:ci": { + "description": "Install project dependencies using frozen lockfile", + "name": "install:ci", + "steps": [ + { + "exec": "yarn install --check-files --frozen-lockfile", + }, + ], + }, + "package": { + "description": "Creates the distribution package", + "name": "package", + }, + "post-compile": { + "description": "Runs after successful compilation", + "name": "post-compile", + "steps": [ + { + "spawn": "synth:silent", + }, + ], + }, + "post-upgrade": { + "description": "Runs after upgrading dependencies", + "name": "post-upgrade", + }, + "pre-compile": { + "description": "Prepare the project for compilation", + "name": "pre-compile", + }, + "synth": { + "description": "Synthesizes your cdk app into cdk.out", + "name": "synth", + "steps": [ + { + "exec": "cdk synth", + }, + ], + }, + "synth:silent": { + "description": "Synthesizes your cdk app into cdk.out and suppresses the template in stdout (part of "yarn build")", + "name": "synth:silent", + "steps": [ + { + "exec": "cdk synth -q", + }, + ], + }, + "test": { + "description": "Run tests", + "name": "test", + "steps": [ + { + "exec": "jest --passWithNoTests \${CI:-'--updateSnapshot'}", + }, + { + "spawn": "eslint", + }, + ], + }, + "test:watch": { + "description": "Run jest in watch mode", + "name": "test:watch", + "steps": [ + { + "exec": "jest --watch", + }, + ], + }, + "upgrade": { + "description": "upgrade dependencies", + "env": { + "CI": "0", + }, + "name": "upgrade", + "steps": [ + { + "exec": "yarn upgrade npm-check-updates", + }, + { + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,aws-cdk,esbuild,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,jest,jest-junit,npm-check-updates,prettier,projen,ts-jest,ts-node,typescript,Website,@aws/pdk,aws-cdk-lib,constructs", + }, + { + "exec": "yarn install --check-files", + }, + { + "exec": "yarn upgrade @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser aws-cdk esbuild eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint jest jest-junit npm-check-updates prettier projen ts-jest ts-node typescript Website @aws/pdk aws-cdk-lib constructs", + }, + { + "exec": "npx projen", + }, + { + "spawn": "post-upgrade", + }, + ], + }, + "watch": { + "description": "Watches changes in your source code and rebuilds and deploys to the current account", + "name": "watch", + "steps": [ + { + "exec": "cdk deploy --hotswap", + }, + { + "exec": "cdk watch", + }, + ], + }, + }, + }, + "infra/LICENSE": " + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +", + "infra/README.md": "## Getting started + +Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infrastructure/index.html)", + "infra/cdk.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "app": "npx ts-node -P tsconfig.json --prefer-ts-exts src/main.ts", + "build": "npx projen bundle", + "output": "cdk.out", + "watch": { + "exclude": [ + "README.md", + "cdk*.json", + "**/*.d.ts", + "**/*.js", + "tsconfig.json", + "package*.json", + "yarn.lock", + "node_modules", + ], + "include": [ + "src/**/*.ts", + "test/**/*.ts", + ], + }, + }, + "infra/package.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": { + "@aws/pdk": "*", + "aws-cdk-lib": "^2.1.0", + "constructs": "^10.0.5", + }, + "devDependencies": { + "@types/jest": "*", + "@types/node": "^16", + "@typescript-eslint/eslint-plugin": "^6", + "@typescript-eslint/parser": "^6", + "Website": "*", + "aws-cdk": "^2.1.0", + "esbuild": "*", + "eslint": "^8", + "eslint-config-prettier": "*", + "eslint-import-resolver-node": "*", + "eslint-import-resolver-typescript": "*", + "eslint-plugin-import": "*", + "eslint-plugin-prettier": "*", + "jest": "*", + "jest-junit": "^15", + "npm-check-updates": "^16", + "prettier": "*", + "projen": "*", + "ts-jest": "*", + "ts-node": "*", + "typescript": "*", + }, + "jest": { + "clearMocks": true, + "collectCoverage": true, + "coverageDirectory": "coverage", + "coveragePathIgnorePatterns": [ + "/node_modules/", + ], + "coverageReporters": [ + "json", + "lcov", + "clover", + "cobertura", + "text", + ], + "globals": { + "ts-jest": { + "tsconfig": "tsconfig.dev.json", + }, + }, + "preset": "ts-jest", + "reporters": [ + "default", + [ + "jest-junit", + { + "outputDirectory": "test-reports", + }, + ], + ], + "testMatch": [ + "/src/**/__tests__/**/*.ts?(x)", + "/(test|src)/**/*(*.)@(spec|test).ts?(x)", + ], + "testPathIgnorePatterns": [ + "/node_modules/", + ], + "watchPathIgnorePatterns": [ + "/node_modules/", + ], + }, + "license": "Apache-2.0", + "name": "WithApi", + "scripts": { + "build": "npx projen build", + "bundle": "npx projen bundle", + "compile": "npx projen compile", + "default": "npx projen default", + "deploy": "npx projen deploy", + "destroy": "npx projen destroy", + "diff": "npx projen diff", + "eslint": "npx projen eslint", + "package": "npx projen package", + "post-compile": "npx projen post-compile", + "post-upgrade": "npx projen post-upgrade", + "pre-compile": "npx projen pre-compile", + "synth": "npx projen synth", + "synth:silent": "npx projen synth:silent", + "test": "npx projen test", + "test:watch": "npx projen test:watch", + "upgrade": "npx projen upgrade", + "watch": "npx projen watch", + }, + "version": "0.0.0", + }, + "infra/project.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "name": "WithApi", + "root": "infra", + "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen build", + "cwd": "infra", + }, + }, + "bundle": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen bundle", + "cwd": "infra", + }, + }, + "compile": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen compile", + "cwd": "infra", + }, + }, + "default": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen default", + "cwd": "infra", + }, + }, + "deploy": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen deploy", + "cwd": "infra", + }, + }, + "destroy": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen destroy", + "cwd": "infra", + }, + }, + "diff": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen diff", + "cwd": "infra", + }, + }, + "eslint": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen eslint", + "cwd": "infra", + }, + }, + "package": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen package", + "cwd": "infra", + }, + }, + "post-compile": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen post-compile", + "cwd": "infra", + }, + }, + "post-upgrade": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen post-upgrade", + "cwd": "infra", + }, + }, + "pre-compile": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen pre-compile", + "cwd": "infra", + }, + }, + "synth": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen synth", + "cwd": "infra", + }, + }, + "synth:silent": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen synth:silent", + "cwd": "infra", + }, + }, + "test": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen test", + "cwd": "infra", + }, + }, + "test:watch": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen test:watch", + "cwd": "infra", + }, + }, + "upgrade": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen upgrade", + "cwd": "infra", + }, + }, + "watch": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen watch", + "cwd": "infra", + }, + }, + }, + }, + "infra/src/constructs/website.ts": "import { UserIdentity } from "@aws/pdk/identity"; +import { StaticWebsite } from "@aws/pdk/static-website"; +import { Stack } from "aws-cdk-lib"; +import { GeoRestriction } from "aws-cdk-lib/aws-cloudfront"; +import { Construct } from "constructs"; +// import { ApiConstruct } from "./api"; + +/** + * Website construct props + */ +export interface WebsiteConstructProps { + /** + * Instance of an API to configure the website to integrate with + */ + // readonly apiConstruct: ApiConstruct; + + /** + * Instance of the UserIdentity. + */ + readonly userIdentity: UserIdentity; +} + +/** + * Construct to deploy a Static Website + */ +export class WebsiteConstruct extends Construct { + constructor(scope: Construct, id: string, props?: WebsiteConstructProps) { + super(scope, id); + + new StaticWebsite(this, id, { + websiteContentPath: "../website/build", + runtimeOptions: { + jsonPayload: { + region: Stack.of(this).region, + identityPoolId: props?.userIdentity.identityPool.identityPoolId, + userPoolId: props?.userIdentity.userPool?.userPoolId, + userPoolWebClientId: + props?.userIdentity.userPoolClient?.userPoolClientId, + // apiUrl: props?.apiConstruct.api.api.urlForPath(), + }, + }, + distributionProps: { + geoRestriction: GeoRestriction.allowlist( + "AU", + "ID", + "IN", + "JP", + "KR", + "SG", + "US", + ), + }, + }); + } +} +", + "infra/src/main.ts": "import { CdkGraph, FilterPreset, Filters } from "@aws/pdk/cdk-graph"; +import { CdkGraphDiagramPlugin } from "@aws/pdk/cdk-graph-plugin-diagram"; +import { AwsPrototypingChecks, PDKNag } from "@aws/pdk/pdk-nag"; +import { ApplicationStack } from "./stacks/application-stack"; + +// for development, use account/region from cdk cli +const devEnv = { + account: process.env.CDK_DEFAULT_ACCOUNT, + region: process.env.CDK_DEFAULT_REGION, +}; + +/* eslint-disable @typescript-eslint/no-floating-promises */ +(async () => { + const app = PDKNag.app({ + nagPacks: [new AwsPrototypingChecks()], + }); + + new ApplicationStack(app, "infra-dev", { env: devEnv }); + + const graph = new CdkGraph(app, { + plugins: [ + new CdkGraphDiagramPlugin({ + defaults: { + filterPlan: { + preset: FilterPreset.COMPACT, + filters: [{ store: Filters.pruneCustomResources() }], + }, + }, + }), + ], + }); + + app.synth(); + await graph.report(); +})(); +", + "infra/src/stacks/application-stack.ts": "import { UserIdentity } from "@aws/pdk/identity"; +import { Stack, StackProps } from "aws-cdk-lib"; +import { Construct } from "constructs"; +import { WebsiteConstruct } from "../constructs/website"; + +export class ApplicationStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const userIdentity = new UserIdentity(this, \`\${id}UserIdentity\`); + new WebsiteConstruct(this, "Website", { userIdentity }); + } +} +", + "infra/test/main.test.ts": "import { App } from "aws-cdk-lib"; +import { Template } from "aws-cdk-lib/assertions"; +import { ApplicationStack } from "../src/stacks/application-stack"; + +test("Snapshot", () => { + const app = new App(); + const stack = new ApplicationStack(app, "test"); + + const template = Template.fromStack(stack); + expect(template.toJSON()).toMatchSnapshot(); +}); +", + "infra/tsconfig.dev.json": { + "compilerOptions": { + "alwaysStrict": true, + "declaration": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "inlineSourceMap": true, + "inlineSources": true, + "lib": [ + "es2019", + ], + "module": "CommonJS", + "noEmitOnError": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "resolveJsonModule": true, + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "stripInternal": true, + "target": "ES2019", + }, + "exclude": [ + "node_modules", + ], + "include": [ + ".projenrc.js", + "src/**/*.ts", + "test/**/*.ts", + ], + }, + "infra/tsconfig.json": { + "compilerOptions": { + "alwaysStrict": true, + "declaration": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "inlineSourceMap": true, + "inlineSources": true, + "lib": [ + "es2019", + ], + "module": "CommonJS", + "noEmitOnError": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "lib", + "resolveJsonModule": true, + "rootDir": "src", + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "stripInternal": true, + "target": "ES2019", + }, + "exclude": [ + "cdk.out", + ], + "include": [ + "src/**/*.ts", + ], + }, +} +`; diff --git a/packages/infrastructure/test/projects/typescript/infrastructure-ts-project.test.ts b/packages/infrastructure/test/projects/typescript/infrastructure-ts-project.test.ts new file mode 100644 index 000000000..87013c9b6 --- /dev/null +++ b/packages/infrastructure/test/projects/typescript/infrastructure-ts-project.test.ts @@ -0,0 +1,58 @@ +/*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 */ +import { Language } from "@aws/type-safe-api"; +import { synthSnapshot } from "projen/lib/util/synth"; +import { + InfrastructureTsProject, + InfrastructureTsProjectOptions, +} from "../../../src"; +import { + BuildOptionsProps, + snapshotInfrastructureProject, +} from "../utils/snapshot-infra-project"; + +describe("InfrastructureTsProject", () => { + const snapshot = ( + buildOptions: (props: BuildOptionsProps) => InfrastructureTsProjectOptions + ) => + snapshotInfrastructureProject( + Language.TYPESCRIPT, + InfrastructureTsProject, + buildOptions + ); + + it("Defaults", () => { + const project = new InfrastructureTsProject({ + name: "Defaults", + }); + expect(synthSnapshot(project)).toMatchSnapshot(); + }); + + it("With Api", () => { + expect( + snapshot(({ typeSafeApi }) => ({ + name: "WithApi", + typeSafeApi, + })) + ).toMatchSnapshot(); + }); + + it("With Website", () => { + expect( + snapshot(({ cloudscapeReactTsWebsite }) => ({ + name: "WithApi", + cloudscapeReactTsWebsite, + })) + ).toMatchSnapshot(); + }); + + it("With Api and Website", () => { + expect( + snapshot(({ cloudscapeReactTsWebsite, typeSafeApi }) => ({ + name: "WithApi", + typeSafeApi, + cloudscapeReactTsWebsite, + })) + ).toMatchSnapshot(); + }); +}); diff --git a/packages/infrastructure/test/projects/utils/snapshot-infra-project.ts b/packages/infrastructure/test/projects/utils/snapshot-infra-project.ts new file mode 100644 index 000000000..51e5f8d83 --- /dev/null +++ b/packages/infrastructure/test/projects/utils/snapshot-infra-project.ts @@ -0,0 +1,70 @@ +/*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 */ +import { CloudscapeReactTsWebsiteProject } from "@aws/cloudscape-react-ts-website"; +import { MonorepoTsProject } from "@aws/monorepo"; +import { + Language, + ModelLanguage, + TypeSafeApiProject, +} from "@aws/type-safe-api"; +import { Project, ProjectOptions } from "projen"; +import { synthSnapshot } from "projen/lib/util/synth"; + +export interface BuildOptionsProps { + readonly typeSafeApi: TypeSafeApiProject; + readonly cloudscapeReactTsWebsite: CloudscapeReactTsWebsiteProject; +} + +export const snapshotInfrastructureProject = < + TProject extends Project, + TOptions extends ProjectOptions +>( + language: Language, + InfrastructureProject: new (opts: TOptions) => TProject, + buildOptions: (props: BuildOptionsProps) => TOptions +) => { + const monorepo = new MonorepoTsProject({ + name: "monorepo", + }); + + const typeSafeApi = new TypeSafeApiProject({ + parent: monorepo, + outdir: "api", + name: "Api", + model: { + language: ModelLanguage.SMITHY, + options: { + smithy: { + serviceName: { + namespace: "com.aws", + serviceName: "Api", + }, + }, + }, + }, + infrastructure: { + language, + }, + }); + + const cloudscapeReactTsWebsite = new CloudscapeReactTsWebsiteProject({ + parent: monorepo, + outdir: "website", + name: "Website", + }); + + new InfrastructureProject({ + ...buildOptions({ typeSafeApi, cloudscapeReactTsWebsite }), + parent: monorepo, + outdir: "infra", + }); + + const monorepoSnapshot = synthSnapshot(monorepo); + + // Filter to only the infrastructure project we're interested in + return Object.fromEntries( + Object.entries(monorepoSnapshot).filter(([filePath]) => + filePath.startsWith("infra/") + ) + ); +}; From d76ffc580a22d21d28e2cb38a66bd97770a0ad26 Mon Sep 17 00:00:00 2001 From: Jack Stevenson Date: Thu, 2 Nov 2023 16:27:54 +1100 Subject: [PATCH 19/21] feat(infrastructure): add deploy:dev task to infrastructure projects for cdk hotswap deployment (#630) Adds a `deploy:dev` task to the infrastructure projects which perform a CDK hotswap deployment if possible in order to reduce dev cycle times. Given the dev cycle time reduction we consider this a better option than a local dev server, since local dev server requires managing credentials locally, as well as things like environment variables for pointing to other resources (eg ddb tables). Fixes #599 --- .../getting_started/shopping_list_app.md | 4 +- .../your_first_aws_pdk_project.md | 11 ++- .../developer_guides/infrastructure/index.md | 3 + .../src/components/infrastructure-commands.ts | 50 ++++++++++++ .../java/infrastructure-java-project.ts | 3 + .../python/infrastructure-py-project.ts | 3 + .../typescript/infrastructure-ts-project.ts | 3 + .../infrastructure-java-project.test.ts.snap | 61 ++++++++++++++ .../infrastructure-py-project.test.ts.snap | 61 ++++++++++++++ .../infrastructure-ts-project.test.ts.snap | 65 +++++++++++++++ packages/pdk/_scripts/exec-command.js | 6 +- .../developer_guides/type-safe-api/index.md | 79 ++++++++++--------- 12 files changed, 306 insertions(+), 43 deletions(-) create mode 100644 packages/infrastructure/src/components/infrastructure-commands.ts diff --git a/docs/content/getting_started/shopping_list_app.md b/docs/content/getting_started/shopping_list_app.md index 1d3600f44..e38dbd524 100644 --- a/docs/content/getting_started/shopping_list_app.md +++ b/docs/content/getting_started/shopping_list_app.md @@ -708,7 +708,7 @@ We are now ready to deploy our API. To do so, run the following steps: ```bash pdk build cd packages/infra -pdk run deploy --require-approval never +pdk deploy:dev ``` Once the deployment completes, we can test our API by navigating the the website (either via Cloudfront or locally) and trying out the API Explorer. @@ -1192,7 +1192,7 @@ If you are happy with your website locally, you can go ahead and deploy it to AW ```bash pdk build cd packages/infra -pdk run deploy --require-approval never +pdk deploy:dev ``` Once the deployment completes, navigate to your cloudfront URL to play around with your deployed website. diff --git a/docs/content/getting_started/your_first_aws_pdk_project.md b/docs/content/getting_started/your_first_aws_pdk_project.md index 3683b82d1..84f91ad5b 100644 --- a/docs/content/getting_started/your_first_aws_pdk_project.md +++ b/docs/content/getting_started/your_first_aws_pdk_project.md @@ -86,7 +86,7 @@ Inspecting the `projenrc` file, we notice that a single construct is instantiate - Any parameter listed here can be passed in via the `pdk new` command i.e: `--name="some-other-name"`. - For python, the moduleName defaults to a snake-cased project name. -You will also notice that the `synth()` method is called on this instance at the end of the file. When you run the `pdk` command, this file will be executed by your runtime and will synthesize this instance which will result in all the files that you see in the previous image. +You will also notice that the `synth()` method is called on this instance at the end of the file. When you run the `pdk` command, this file will be executed by your runtime and will synthesize this instance which will result in all the files that you see in the previous image. !!!info Whenever you change the `projenrc` file, make sure you run the `pdk` command from the root of your project to ensure your files are synthesized. @@ -293,7 +293,7 @@ For more details on these packages, refer to the [Type-Safe API Developer Guide] Now, lets build our API by running `pdk build` from the root of our monorepo. You will notice that each package in the monorepo is built in dependency order. !!!tip - If you run the `pdk build` command again without changing any files, you will notice that the build completes in a fraction of the time (1.7s as per below snippet) as it uses [cached results](https://nx.dev/concepts/how-caching-works) and will only re-build packages that have changed since the last time it was built. + If you run the `pdk build` command again without changing any files, you will notice that the build completes in a fraction of the time (1.7s as per below snippet) as it uses [cached results](https://nx.dev/concepts/how-caching-works) and will only re-build packages that have changed since the last time it was built. ```bash > NX Successfully ran target build for 7 projects @@ -738,9 +738,12 @@ We now can deploy our infrastructure by running the following command: ```bash cd packages/infra -pdk run deploy --require-approval never +pdk deploy:dev ``` +!!!note + The `pdk deploy:dev` command attempts a [CDK hotswap deployment](https://aws.amazon.com/blogs/developer/increasing-development-speed-with-cdk-watch/) if possible. In a production setting (for example in a ci/cd pipeline) use the `pdk deploy` command to ensure a full CloudFormation deployment is performed. + Once the deployment completes, you should see an output that resembles the following: @@ -756,7 +759,7 @@ In order to log in to your website, you first need to create a Cognito user. By 1. Navigate to the Cognito AWS console within the account you just deployed to. 1. Click on the user pool you just created 1. Click "Create user" -1. In invitation settings, select "Send an email invitation" +1. In invitation settings, select "Send an email invitation" 1. Enter a username 1. Enter an email address 1. In temporary password, select "Generate a password" diff --git a/packages/infrastructure/docs/developer_guides/infrastructure/index.md b/packages/infrastructure/docs/developer_guides/infrastructure/index.md index 4749da4eb..c70c9c56f 100644 --- a/packages/infrastructure/docs/developer_guides/infrastructure/index.md +++ b/packages/infrastructure/docs/developer_guides/infrastructure/index.md @@ -145,6 +145,9 @@ Congratulations! You have successfully deployed a website and api to AWS! To check out your website, navigate to the distribution link in the CDK deployment output above to view your website. +!!!tip + Use the `pdk deploy:dev` command in your infrastructure package to perform a CDK hotswap deployment for faster development iterations! + ## Destroying the deployed resources Now that you're done creating your first PDK project, destroy your deployed resources to avoid incurring any costs as follows: diff --git a/packages/infrastructure/src/components/infrastructure-commands.ts b/packages/infrastructure/src/components/infrastructure-commands.ts new file mode 100644 index 000000000..56d156efb --- /dev/null +++ b/packages/infrastructure/src/components/infrastructure-commands.ts @@ -0,0 +1,50 @@ +/*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. +SPDX-License-Identifier: Apache-2.0 */ +import { ProjectUtils } from "@aws/monorepo"; +import { Component, Project } from "projen"; + +/** + * Common commands for infrastructure projects + */ +export class InfrastructureCommands extends Component { + /** + * Retrieves an instance of InfrastructureCommands if one is associated to the given project + * @param project project instance + */ + static of(project: Project): InfrastructureCommands | undefined { + return project.components.find((c) => + ProjectUtils.isNamedInstanceOf(c, InfrastructureCommands) + ) as InfrastructureCommands | undefined; + } + + /** + * Retrieves an instance of InfrastructureCommands if one is associated to the given project, + * otherwise creates an InfrastructureCommands instance for the project. + * @param project project instance + */ + static ensure(project: Project): InfrastructureCommands { + return ( + InfrastructureCommands.of(project) || new InfrastructureCommands(project) + ); + } + + constructor(project: Project) { + super(project); + + // Add a development deployment task which uses hotswap for faster deployments + // See: https://aws.amazon.com/blogs/developer/increasing-development-speed-with-cdk-watch/ + const deployDevTask = project.addTask("deploy:dev", { + receiveArgs: true, + description: + "Performs a hotswap CDK deployment, useful for faster development cycles", + }); + // --hotswap-fallback falls back to a regular deployment if there are resources which have + // changed that cannot be hotswapped + deployDevTask.exec( + "cdk deploy --hotswap-fallback --require-approval never", + { + receiveArgs: true, + } + ); + } +} diff --git a/packages/infrastructure/src/projects/java/infrastructure-java-project.ts b/packages/infrastructure/src/projects/java/infrastructure-java-project.ts index 9f4989af8..07838979b 100644 --- a/packages/infrastructure/src/projects/java/infrastructure-java-project.ts +++ b/packages/infrastructure/src/projects/java/infrastructure-java-project.ts @@ -9,6 +9,7 @@ import * as Mustache from "mustache"; import { SampleFile } from "projen"; import { AwsCdkJavaApp } from "projen/lib/awscdk"; import { AwsCdkJavaAppOptions } from "./aws-cdk-java-app-options"; +import { InfrastructureCommands } from "../../components/infrastructure-commands"; import { DEFAULT_STACK_NAME } from "../../consts"; /** @@ -65,6 +66,8 @@ export class InfrastructureJavaProject extends AwsCdkJavaApp { }, }); + InfrastructureCommands.ensure(this); + this.pom.addPlugin("org.apache.maven.plugins/maven-surefire-plugin@3.1.2"); this.pom.addPlugin("org.apache.maven.plugins/maven-compiler-plugin@3.8.1", { configuration: { diff --git a/packages/infrastructure/src/projects/python/infrastructure-py-project.ts b/packages/infrastructure/src/projects/python/infrastructure-py-project.ts index 6b15e944c..eb8826a7b 100644 --- a/packages/infrastructure/src/projects/python/infrastructure-py-project.ts +++ b/packages/infrastructure/src/projects/python/infrastructure-py-project.ts @@ -9,6 +9,7 @@ import * as Mustache from "mustache"; import { SampleFile } from "projen"; import { AwsCdkPythonApp } from "projen/lib/awscdk"; import { AwsCdkPythonAppOptions } from "./aws-cdk-py-app-options"; +import { InfrastructureCommands } from "../../components/infrastructure-commands"; import { DEFAULT_STACK_NAME } from "../../consts"; /** @@ -66,6 +67,8 @@ export class InfrastructurePyProject extends AwsCdkPythonApp { }, }); + InfrastructureCommands.ensure(this); + ["pytest@^7", "syrupy@^4"].forEach((devDep) => this.addDevDependency(devDep) ); diff --git a/packages/infrastructure/src/projects/typescript/infrastructure-ts-project.ts b/packages/infrastructure/src/projects/typescript/infrastructure-ts-project.ts index 97496ebcf..5a02013a8 100644 --- a/packages/infrastructure/src/projects/typescript/infrastructure-ts-project.ts +++ b/packages/infrastructure/src/projects/typescript/infrastructure-ts-project.ts @@ -10,6 +10,7 @@ import { SampleFile } from "projen"; import { AwsCdkTypeScriptApp } from "projen/lib/awscdk"; import { NodeProject } from "projen/lib/javascript"; import { AwsCdkTypeScriptAppOptions } from "./aws-cdk-ts-app-options"; +import { InfrastructureCommands } from "../../components/infrastructure-commands"; import { DEFAULT_STACK_NAME } from "../../consts"; /** @@ -66,6 +67,8 @@ export class InfrastructureTsProject extends AwsCdkTypeScriptApp { }, }); + InfrastructureCommands.ensure(this); + this.addDeps("@aws/pdk"); const srcDir = path.resolve( diff --git a/packages/infrastructure/test/projects/java/__snapshots__/infrastructure-java-project.test.ts.snap b/packages/infrastructure/test/projects/java/__snapshots__/infrastructure-java-project.test.ts.snap index c50914a3c..44653b2af 100644 --- a/packages/infrastructure/test/projects/java/__snapshots__/infrastructure-java-project.test.ts.snap +++ b/packages/infrastructure/test/projects/java/__snapshots__/infrastructure-java-project.test.ts.snap @@ -316,6 +316,16 @@ dist/java }, ], }, + "deploy:dev": { + "description": "Performs a hotswap CDK deployment, useful for faster development cycles", + "name": "deploy:dev", + "steps": [ + { + "exec": "cdk deploy --hotswap-fallback --require-approval never", + "receiveArgs": true, + }, + ], + }, "destroy": { "description": "Destroys your cdk app in the AWS cloud", "name": "destroy", @@ -924,6 +934,16 @@ dist/java }, ], }, + "deploy:dev": { + "description": "Performs a hotswap CDK deployment, useful for faster development cycles", + "name": "deploy:dev", + "steps": [ + { + "exec": "cdk deploy --hotswap-fallback --require-approval never", + "receiveArgs": true, + }, + ], + }, "destroy": { "description": "Destroys your cdk app in the AWS cloud", "name": "destroy", @@ -1213,6 +1233,13 @@ Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infras "cwd": "infra", }, }, + "deploy:dev": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen deploy:dev", + "cwd": "infra", + }, + }, "destroy": { "executor": "nx:run-commands", "options": { @@ -1697,6 +1724,16 @@ dist/java }, ], }, + "deploy:dev": { + "description": "Performs a hotswap CDK deployment, useful for faster development cycles", + "name": "deploy:dev", + "steps": [ + { + "exec": "cdk deploy --hotswap-fallback --require-approval never", + "receiveArgs": true, + }, + ], + }, "destroy": { "description": "Destroys your cdk app in the AWS cloud", "name": "destroy", @@ -1987,6 +2024,13 @@ Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infras "cwd": "infra", }, }, + "deploy:dev": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen deploy:dev", + "cwd": "infra", + }, + }, "destroy": { "executor": "nx:run-commands", "options": { @@ -2515,6 +2559,16 @@ dist/java }, ], }, + "deploy:dev": { + "description": "Performs a hotswap CDK deployment, useful for faster development cycles", + "name": "deploy:dev", + "steps": [ + { + "exec": "cdk deploy --hotswap-fallback --require-approval never", + "receiveArgs": true, + }, + ], + }, "destroy": { "description": "Destroys your cdk app in the AWS cloud", "name": "destroy", @@ -2793,6 +2847,13 @@ Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infras "cwd": "infra", }, }, + "deploy:dev": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen deploy:dev", + "cwd": "infra", + }, + }, "destroy": { "executor": "nx:run-commands", "options": { diff --git a/packages/infrastructure/test/projects/python/__snapshots__/infrastructure-py-project.test.ts.snap b/packages/infrastructure/test/projects/python/__snapshots__/infrastructure-py-project.test.ts.snap index 8df0b65fe..e3541f3a6 100644 --- a/packages/infrastructure/test/projects/python/__snapshots__/infrastructure-py-project.test.ts.snap +++ b/packages/infrastructure/test/projects/python/__snapshots__/infrastructure-py-project.test.ts.snap @@ -271,6 +271,16 @@ cython_debug/ }, ], }, + "deploy:dev": { + "description": "Performs a hotswap CDK deployment, useful for faster development cycles", + "name": "deploy:dev", + "steps": [ + { + "exec": "cdk deploy --hotswap-fallback --require-approval never", + "receiveArgs": true, + }, + ], + }, "destroy": { "description": "Destroys your cdk app in the AWS cloud", "name": "destroy", @@ -696,6 +706,16 @@ cython_debug/ }, ], }, + "deploy:dev": { + "description": "Performs a hotswap CDK deployment, useful for faster development cycles", + "name": "deploy:dev", + "steps": [ + { + "exec": "cdk deploy --hotswap-fallback --require-approval never", + "receiveArgs": true, + }, + ], + }, "destroy": { "description": "Destroys your cdk app in the AWS cloud", "name": "destroy", @@ -959,6 +979,13 @@ url = "https://test.pypi.org/legacy/" "cwd": "infra", }, }, + "deploy:dev": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen deploy:dev", + "cwd": "infra", + }, + }, "destroy": { "executor": "nx:run-commands", "options": { @@ -1291,6 +1318,16 @@ cython_debug/ }, ], }, + "deploy:dev": { + "description": "Performs a hotswap CDK deployment, useful for faster development cycles", + "name": "deploy:dev", + "steps": [ + { + "exec": "cdk deploy --hotswap-fallback --require-approval never", + "receiveArgs": true, + }, + ], + }, "destroy": { "description": "Destroys your cdk app in the AWS cloud", "name": "destroy", @@ -1592,6 +1629,13 @@ url = "https://test.pypi.org/legacy/" "cwd": "infra", }, }, + "deploy:dev": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen deploy:dev", + "cwd": "infra", + }, + }, "destroy": { "executor": "nx:run-commands", "options": { @@ -1919,6 +1963,16 @@ cython_debug/ }, ], }, + "deploy:dev": { + "description": "Performs a hotswap CDK deployment, useful for faster development cycles", + "name": "deploy:dev", + "steps": [ + { + "exec": "cdk deploy --hotswap-fallback --require-approval never", + "receiveArgs": true, + }, + ], + }, "destroy": { "description": "Destroys your cdk app in the AWS cloud", "name": "destroy", @@ -2165,6 +2219,13 @@ url = "https://test.pypi.org/legacy/" "cwd": "infra", }, }, + "deploy:dev": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen deploy:dev", + "cwd": "infra", + }, + }, "destroy": { "executor": "nx:run-commands", "options": { diff --git a/packages/infrastructure/test/projects/typescript/__snapshots__/infrastructure-ts-project.test.ts.snap b/packages/infrastructure/test/projects/typescript/__snapshots__/infrastructure-ts-project.test.ts.snap index ae54c5ea7..29085de46 100644 --- a/packages/infrastructure/test/projects/typescript/__snapshots__/infrastructure-ts-project.test.ts.snap +++ b/packages/infrastructure/test/projects/typescript/__snapshots__/infrastructure-ts-project.test.ts.snap @@ -684,6 +684,16 @@ cdk.out/ }, ], }, + "deploy:dev": { + "description": "Performs a hotswap CDK deployment, useful for faster development cycles", + "name": "deploy:dev", + "steps": [ + { + "exec": "cdk deploy --hotswap-fallback --require-approval never", + "receiveArgs": true, + }, + ], + }, "destroy": { "description": "Destroys your cdk app in the AWS cloud", "name": "destroy", @@ -1149,6 +1159,7 @@ Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infras "compile": "npx projen compile", "default": "npx projen default", "deploy": "npx projen deploy", + "deploy:dev": "npx projen deploy:dev", "destroy": "npx projen destroy", "diff": "npx projen diff", "eject": "npx projen eject", @@ -1708,6 +1719,16 @@ cdk.out/ }, ], }, + "deploy:dev": { + "description": "Performs a hotswap CDK deployment, useful for faster development cycles", + "name": "deploy:dev", + "steps": [ + { + "exec": "cdk deploy --hotswap-fallback --require-approval never", + "receiveArgs": true, + }, + ], + }, "destroy": { "description": "Destroys your cdk app in the AWS cloud", "name": "destroy", @@ -2161,6 +2182,7 @@ Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infras "compile": "npx projen compile", "default": "npx projen default", "deploy": "npx projen deploy", + "deploy:dev": "npx projen deploy:dev", "destroy": "npx projen destroy", "diff": "npx projen diff", "eslint": "npx projen eslint", @@ -2217,6 +2239,13 @@ Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infras "cwd": "infra", }, }, + "deploy:dev": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen deploy:dev", + "cwd": "infra", + }, + }, "destroy": { "executor": "nx:run-commands", "options": { @@ -2937,6 +2966,16 @@ cdk.out/ }, ], }, + "deploy:dev": { + "description": "Performs a hotswap CDK deployment, useful for faster development cycles", + "name": "deploy:dev", + "steps": [ + { + "exec": "cdk deploy --hotswap-fallback --require-approval never", + "receiveArgs": true, + }, + ], + }, "destroy": { "description": "Destroys your cdk app in the AWS cloud", "name": "destroy", @@ -3391,6 +3430,7 @@ Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infras "compile": "npx projen compile", "default": "npx projen default", "deploy": "npx projen deploy", + "deploy:dev": "npx projen deploy:dev", "destroy": "npx projen destroy", "diff": "npx projen diff", "eslint": "npx projen eslint", @@ -3447,6 +3487,13 @@ Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infras "cwd": "infra", }, }, + "deploy:dev": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen deploy:dev", + "cwd": "infra", + }, + }, "destroy": { "executor": "nx:run-commands", "options": { @@ -4221,6 +4268,16 @@ cdk.out/ }, ], }, + "deploy:dev": { + "description": "Performs a hotswap CDK deployment, useful for faster development cycles", + "name": "deploy:dev", + "steps": [ + { + "exec": "cdk deploy --hotswap-fallback --require-approval never", + "receiveArgs": true, + }, + ], + }, "destroy": { "description": "Destroys your cdk app in the AWS cloud", "name": "destroy", @@ -4674,6 +4731,7 @@ Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infras "compile": "npx projen compile", "default": "npx projen default", "deploy": "npx projen deploy", + "deploy:dev": "npx projen deploy:dev", "destroy": "npx projen destroy", "diff": "npx projen diff", "eslint": "npx projen eslint", @@ -4730,6 +4788,13 @@ Refer to [Developer Guide](https://aws.github.io/aws-pdk/developer_guides/infras "cwd": "infra", }, }, + "deploy:dev": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen deploy:dev", + "cwd": "infra", + }, + }, "destroy": { "executor": "nx:run-commands", "options": { diff --git a/packages/pdk/_scripts/exec-command.js b/packages/pdk/_scripts/exec-command.js index 653ce4bf7..13c20d768 100755 --- a/packages/pdk/_scripts/exec-command.js +++ b/packages/pdk/_scripts/exec-command.js @@ -27,7 +27,11 @@ const engines = JSON.parse( ).engines; if (engines) { - const pkgMgrCmd = engines.pnpm ? "pnpm" : engines.yarn ? "yarn" : "npm run"; + let pkgMgrCmd = engines.pnpm ? "pnpm" : engines.yarn ? "yarn" : "npm run"; + // Deploy is a pnpm command, but it's more likely users want to run the deploy task + if (engines.pnpm && process.argv[0] === "deploy") { + pkgMgrCmd += " run"; + } execa.commandSync(`${pkgMgrCmd}${isSynth ? " default" : ""} ${process.argv.join(" ")}`, { stdio: "inherit" }); } else { execa.commandSync(`npx projen ${process.argv.join(" ")}`, { stdio: "inherit"}); diff --git a/packages/type-safe-api/docs/developer_guides/type-safe-api/index.md b/packages/type-safe-api/docs/developer_guides/type-safe-api/index.md index cd42685fd..85d5adb81 100644 --- a/packages/type-safe-api/docs/developer_guides/type-safe-api/index.md +++ b/packages/type-safe-api/docs/developer_guides/type-safe-api/index.md @@ -331,21 +331,21 @@ You can implement your lambda handlers in any of the supported languages, or mix Response, LoggingInterceptor, } from "myapi-typescript-runtime"; - + /** * Type-safe handler for the SayHello operation */ export const sayHello: SayHelloChainedHandlerFunction = async (request) => { LoggingInterceptor.getLogger(request).info("Start SayHello Operation"); - + // TODO: Implement SayHello Operation. `input` contains the request input. const { input } = request; - + return Response.internalFailure({ message: "Not Implemented!", }); }; - + /** * Entry point for the AWS Lambda handler for the SayHello operation. * The sayHelloHandler method wraps the type-safe handler and manages marshalling inputs and outputs @@ -356,10 +356,10 @@ You can implement your lambda handlers in any of the supported languages, or mix === "JAVA" In Java, you'll notice you have a lambda handler stub in `packages/api/handlers/java/src/main/java/com/generated/api/myapijavahandlers/handlers/SayHelloHandler.java`: - + ```java package com.generated.api.myapijavahandlers.handlers; - + import com.generated.api.myapijavaruntime.runtime.api.interceptors.DefaultInterceptors; import com.generated.api.myapijavaruntime.runtime.api.interceptors.powertools.LoggingInterceptor; import com.generated.api.myapijavaruntime.runtime.api.handlers.Interceptor; @@ -369,9 +369,9 @@ You can implement your lambda handlers in any of the supported languages, or mix import com.generated.api.myapijavaruntime.runtime.api.handlers.say_hello.SayHelloRequestInput; import com.generated.api.myapijavaruntime.runtime.api.handlers.say_hello.SayHelloResponse; import com.generated.api.myapijavaruntime.runtime.model.*; - + import java.util.List; - + /** * Entry point for the AWS Lambda handler for the SayHello operation. * The SayHello class manages marshalling inputs and outputs. @@ -385,17 +385,17 @@ You can implement your lambda handlers in any of the supported languages, or mix public List> getInterceptors() { return DefaultInterceptors.all(); } - + /** * Type-safe handler for the SayHello operation */ @Override public SayHelloResponse handle(final SayHelloRequestInput request) { LoggingInterceptor.getLogger(request).info("Start SayHello Operation"); - + // TODO: Implement SayHello Operation. `input` contains the request input. SayHelloInput input = request.getInput(); - + return SayHello500Response.of(InternalFailureErrorResponseContent.builder() .message("Not Implemented!") .build()); @@ -415,21 +415,21 @@ You can implement your lambda handlers in any of the supported languages, or mix from myapi_python_runtime.api.operation_config import ( say_hello_handler, SayHelloRequest, SayHelloOperationResponses ) - - + + def say_hello(input: SayHelloRequest, **kwargs) -> SayHelloOperationResponses: """ Type-safe handler for the SayHello operation """ LoggingInterceptor.get_logger(input).info("Start SayHello Operation") - + # TODO: Implement SayHello Operation. `input` contains the request input - + return Response.internal_failure(InternalFailureErrorResponseContent( message="Not Implemented!" )) - - + + # Entry point for the AWS Lambda handler for the SayHello operation. # The say_hello_handler method wraps the type-safe handler and manages marshalling inputs and outputs handler = say_hello_handler(interceptors=INTERCEPTORS)(say_hello) @@ -448,9 +448,9 @@ We can replace the stubbed response with a real implementation: */ export const sayHello: SayHelloChainedHandlerFunction = async (request) => { LoggingInterceptor.getLogger(request).info("Start SayHello Operation"); - + const { input } = request; - + return Response.success({ message: `Hello ${input.requestParameters.name}!`, }); @@ -484,7 +484,7 @@ We can replace the stubbed response with a real implementation: Type-safe handler for the SayHello operation """ LoggingInterceptor.get_logger(input).info("Start SayHello Operation") - + return Response.success(SayHelloResponseContent( message=f"Hello {input.request_parameters.name}!" )) @@ -521,7 +521,7 @@ Given we used the AWS PDK vended infrastructure project, this will be configured Api, SayHelloFunction, } from "myapi-typescript-infra"; - + /** * Api construct props. */ @@ -531,7 +531,7 @@ Given we used the AWS PDK vended infrastructure project, this will be configured */ readonly userIdentity: UserIdentity; } - + /** * Infrastructure construct to deploy a Type Safe API. */ @@ -540,10 +540,10 @@ Given we used the AWS PDK vended infrastructure project, this will be configured * API instance */ public readonly api: Api; - + constructor(scope: Construct, id: string, props?: ApiConstructProps) { super(scope, id); - + this.api = new Api(this, id, { defaultAuthorizer: Authorizers.iam(), corsOptions: { @@ -578,7 +578,7 @@ Given we used the AWS PDK vended infrastructure project, this will be configured ], }), }); - + // Grant authenticated users access to invoke the api props?.userIdentity.identityPool.authenticatedRole.addToPrincipalPolicy( new PolicyStatement({ @@ -597,14 +597,14 @@ Given we used the AWS PDK vended infrastructure project, this will be configured ```java hl_lines="5 44-49" package software.aws.infra.constructs; - + import com.generated.api.myapijavainfra.infra.Api; import com.generated.api.myapijavainfra.infra.ApiProps; import com.generated.api.myapijavainfra.infra.functions.SayHelloFunction; import com.generated.api.myapijavaruntime.runtime.api.operation_config.OperationConfig; - + import java.util.Arrays; - + import software.amazon.awscdk.Stack; import software.amazon.awscdk.services.apigateway.Cors; import software.amazon.awscdk.services.apigateway.CorsOptions; @@ -620,7 +620,7 @@ Given we used the AWS PDK vended infrastructure project, this will be configured import software.aws.pdk.type_safe_api.TypeSafeApiIntegration; import software.aws.pdk.type_safe_api.Integrations; import software.constructs.Construct; - + /** * Infrastructure construct to deploy a Type Safe API. */ @@ -629,10 +629,10 @@ Given we used the AWS PDK vended infrastructure project, this will be configured * API instance */ public final Api api; - + public ApiConstruct(Construct scope, String id, UserIdentity userIdentity) { super(scope, id); - + this.api = new Api(this, id, ApiProps.builder() .defaultAuthorizer(Authorizers.iam()) .corsOptions(CorsOptions.builder() @@ -668,7 +668,7 @@ Given we used the AWS PDK vended infrastructure project, this will be configured )) .build())) .build()); - + userIdentity.getIdentityPool().getAuthenticatedRole() .addToPrincipalPolicy(new PolicyStatement(PolicyStatementProps.builder() .effect(Effect.ALLOW) @@ -693,12 +693,12 @@ Given we used the AWS PDK vended infrastructure project, this will be configured from aws_pdk.type_safe_api import Authorizers, TypeSafeApiIntegration, Integrations from aws_cdk.aws_apigateway import CorsOptions, Cors from aws_cdk.aws_iam import AccountPrincipal, AnyPrincipal, Effect, PolicyDocument, PolicyStatement - + # Infrastructure construct to deploy a Type Safe API. class ApiConstruct(Construct): def __init__(self, scope: Construct, id: str, user_identity: UserIdentity, **kwargs) -> None: super().__init__(scope, id, **kwargs) - + self.api = Api(self, id, default_authorizer=Authorizers.iam(), cors_options=CorsOptions( @@ -732,7 +732,7 @@ Given we used the AWS PDK vended infrastructure project, this will be configured ) ] )) - + user_identity.identity_pool.authenticated_role.add_to_principal_policy( PolicyStatement( effect=Effect.ALLOW, @@ -920,7 +920,14 @@ After you implement your new operation, build your project again and deploy it: ```bash pdk build cd packages/infra -pdk run deploy --require-approval never +pdk deploy:dev ``` +!!!tip + If you want to quickly test changes to your lambda handler code, you can re-package the handlers, then run `pdk deploy:dev` in your infrastructure project to perform a fast [hotswap deployment](https://aws.amazon.com/blogs/developer/increasing-development-speed-with-cdk-watch/). For example from the root of your project: + + ```bash + pdk nx run myapi-typescript-handlers:package && pdk nx run infra:deploy\:dev + ``` + Try out your new API! You can use a tool such as [awscurl](https://github.com/okigan/awscurl) to make Sigv4 signed requests to your API, since we set the default authorizer to `Authorizers.iam()`. Alternatively, you can deploy the [`CloudscapeReactTsWebsiteProject`](../cloudscape-react-ts-website/index.md) and try out the [API Explorer](../cloudscape-react-ts-website/api_explorer.md). \ No newline at end of file From ae0177eb36ccae606c309d013fcdcaa0b8affd7e Mon Sep 17 00:00:00 2001 From: Adrian Dimech <51220968+agdimech@users.noreply.github.com> Date: Thu, 2 Nov 2023 17:01:44 +1100 Subject: [PATCH 20/21] feat: add support for Bun (#631) fix #576 --- .projen/deps.json | 5 +- package.json | 3 +- .../src/projects/typescript/monorepo-ts.ts | 13 +- packages/monorepo/src/utils/node.ts | 35 +- .../test/__snapshots__/monorepo.test.ts.snap | 2595 +++++++++++++++-- packages/monorepo/test/monorepo.test.ts | 17 + packages/pdk/_scripts/exec-command.js | 3 +- .../generated-typescript-handlers-project.ts | 20 +- ...d-typescript-cdk-infrastructure-project.ts | 20 +- .../typescript-react-query-hooks-library.ts | 16 +- .../generated-typescript-runtime-project.ts | 16 +- .../type-safe-api-project.test.ts.snap | 202 +- pnpm-lock.yaml | 14 +- 13 files changed, 2388 insertions(+), 571 deletions(-) diff --git a/.projen/deps.json b/.projen/deps.json index 96407ffce..4cfb91853 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -220,6 +220,7 @@ }, { "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "version": "latest", "type": "runtime" }, { @@ -239,10 +240,6 @@ "name": "cdk-nag", "type": "runtime" }, - { - "name": "constructs", - "type": "runtime" - }, { "name": "fast-xml-parser", "type": "runtime" diff --git a/package.json b/package.json index 8ebaf5052..f15426c30 100644 --- a/package.json +++ b/package.json @@ -59,12 +59,11 @@ "nx": "^16" }, "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "^2.103.1-alpha.0", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "@mrgrain/jsii-struct-builder": "^0.5.7", "@pnpm/types": "^9.0.0", "aws-cdk-lib": "^2.93.0", "cdk-nag": "^2.27.115", - "constructs": "^10.2.70", "fast-xml-parser": "^4.2.7", "projen": "^0.76" }, diff --git a/packages/monorepo/src/projects/typescript/monorepo-ts.ts b/packages/monorepo/src/projects/typescript/monorepo-ts.ts index ad7dc52b8..747307a04 100644 --- a/packages/monorepo/src/projects/typescript/monorepo-ts.ts +++ b/packages/monorepo/src/projects/typescript/monorepo-ts.ts @@ -175,9 +175,8 @@ export class MonorepoTsProject devDeps: ["nx@^16", "@aws/pdk@^0", ...(options.devDeps || [])], deps: [ "aws-cdk-lib", - "constructs", "cdk-nag", - "@aws-cdk/aws-cognito-identitypool-alpha", + "@aws-cdk/aws-cognito-identitypool-alpha@latest", ...(options.deps || []), ], }); @@ -190,6 +189,10 @@ export class MonorepoTsProject // engines this.package.addEngine("node", ">=16"); switch (this.package.packageManager) { + case NodePackageManager.BUN: { + this.package.addEngine("bun", ">=1"); + break; + } case NodePackageManager.PNPM: { // https://pnpm.io/package_json // https://github.com/pnpm/pnpm/releases/tag/v8.0.0 @@ -408,9 +411,9 @@ export class MonorepoTsProject public addWorkspacePackages(...packageGlobs: string[]) { // Any subprojects that were added since the last call to this method need to be added first, in order to ensure // we add the workspace packages in a sane order. - const relativeSubProjectWorkspacePackages = this.sortedSubProjects.map( - (project) => path.relative(this.outdir, project.outdir) - ); + const relativeSubProjectWorkspacePackages = this.sortedSubProjects + .filter((s) => ProjectUtils.isNamedInstanceOf(s, NodeProject)) + .map((project) => path.relative(this.outdir, project.outdir)); const existingWorkspacePackages = new Set(this.workspacePackages); this.workspacePackages.push( ...relativeSubProjectWorkspacePackages.filter( diff --git a/packages/monorepo/src/utils/node.ts b/packages/monorepo/src/utils/node.ts index 4948c8e2a..26cb697c8 100644 --- a/packages/monorepo/src/utils/node.ts +++ b/packages/monorepo/src/utils/node.ts @@ -124,6 +124,8 @@ export namespace NodePackageUtils { return withArgs("yarn run", args); case NodePackageManager.PNPM: return withArgs("pnpm run", args); + case NodePackageManager.BUN: + return withArgs("bun run", args); default: return withArgs("npm run", args); } @@ -156,6 +158,8 @@ export namespace NodePackageUtils { return withArgs("yarn exec", args); case NodePackageManager.PNPM: return withArgs("pnpm exec", args); + case NodePackageManager.BUN: + return withArgs("bun x", args); default: return withArgs("npx", args); } @@ -174,6 +178,8 @@ export namespace NodePackageUtils { return withArgs("yarn dlx", args); case NodePackageManager.PNPM: return withArgs("pnpm dlx", args); + case NodePackageManager.BUN: + return withArgs("bun x", args); default: return withArgs("npx", args); } @@ -193,6 +199,8 @@ export namespace NodePackageUtils { return withArgs("yarn install", args); case NodePackageManager.PNPM: return withArgs("pnpm i", args); + case NodePackageManager.BUN: + return withArgs("bun install", args); default: return withArgs("npm install", args); } @@ -213,33 +221,13 @@ export namespace NodePackageUtils { return withArgs("yarn", args); case NodePackageManager.PNPM: return withArgs("pnpm", args); + case NodePackageManager.BUN: + return withArgs("bun", args); default: return withArgs("npm", args); } } - export function execInWorkspace( - packageManager: NodePackageManager, - packageName: string, - ...args: string[] - ) { - switch (packageManager) { - case NodePackageManager.YARN: - case NodePackageManager.YARN2: - case NodePackageManager.YARN_CLASSIC: - case NodePackageManager.YARN_BERRY: - return withArgs("yarn workspace", [packageName, ...args]); - case NodePackageManager.PNPM: - return withArgs("pnpm", [ - `--filter "${packageName}"`, - "exec", - ...args, - ]); - default: - return withArgs("npx", ["-p", packageName, ...args]); - } - } - /** * Get bash command for executing an executable in the package manager /bin dir. * Example: `$(yarn bin)/${cmd}` @@ -256,8 +244,9 @@ export namespace NodePackageUtils { return `$(yarn bin)/${_cmd}`; case NodePackageManager.PNPM: return `$(pnpm bin)/${_cmd}`; + case NodePackageManager.BUN: default: - return `$(npm bin)/${_cmd}`; + return `$(npm root)/.bin/${_cmd}`; } } } diff --git a/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap b/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap index de715d563..be9793f8d 100644 --- a/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap +++ b/packages/monorepo/test/__snapshots__/monorepo.test.ts.snap @@ -350,6 +350,7 @@ resolution-mode=highest { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -359,10 +360,6 @@ resolution-mode=highest "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -569,13 +566,13 @@ resolution-mode=highest "exec": "pnpm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "pnpm i --no-frozen-lockfile", }, { - "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "pnpm exec projen", @@ -900,10 +897,9 @@ resolution-mode=highest "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -2396,6 +2392,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -2405,10 +2402,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -2613,13 +2606,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "yarn projen", @@ -2944,10 +2937,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -4431,6 +4423,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -4440,10 +4433,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -4648,13 +4637,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "yarn exec projen", @@ -4979,10 +4968,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -6461,6 +6449,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -6470,10 +6459,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -6678,13 +6663,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -7009,10 +6994,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -7073,10 +7057,7 @@ tsconfig.tsbuildinfo "types": "lib/index.d.ts", "version": "0.0.0", "workspaces": { - "packages": [ - "packages/consumer", - "packages/library", - ], + "packages": [], }, }, "packages/consumer/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -8315,6 +8296,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -8324,10 +8306,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -8540,13 +8518,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -8871,10 +8849,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -8936,10 +8913,7 @@ tsconfig.tsbuildinfo "types": "lib/index.d.ts", "version": "0.0.0", "workspaces": { - "packages": [ - "packages/consumer", - "packages/library", - ], + "packages": [], }, }, "packages/consumer/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -10069,6 +10043,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -10078,10 +10053,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -10286,13 +10257,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -10617,10 +10588,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -10762,7 +10732,7 @@ tsconfig.tsbuildinfo } `; -exports[`NX Monorepo Unit Tests Composite 1`] = ` +exports[`NX Monorepo Unit Tests BUN 1`] = ` { ".eslintrc.json": { "env": { @@ -10904,7 +10874,7 @@ exports[`NX Monorepo Unit Tests Composite 1`] = ` }, }, }, - ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "bun x projen". *.snap linguist-generated /.eslintrc.json linguist-generated @@ -10919,13 +10889,13 @@ exports[`NX Monorepo Unit Tests Composite 1`] = ` /.projen/files.json linguist-generated /.projen/tasks.json linguist-generated /.syncpackrc.json linguist-generated +/bun.lockb linguist-generated /LICENSE linguist-generated /nx.json linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated -/tsconfig.json linguist-generated -/yarn.lock linguist-generated", - ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +/tsconfig.json linguist-generated", + ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "bun x projen". !/.gitattributes !/.projen/tasks.json !/.projen/deps.json @@ -10972,7 +10942,7 @@ jspm_packages/ !/.nxignore !/.syncpackrc.json ", - ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "bun x projen". /.projen/ /test/ /tsconfig.dev.json @@ -10989,18 +10959,18 @@ dist tsconfig.tsbuildinfo /.eslintrc.json ", - ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "bun x projen". .tmp .env .pytest_cache ", - ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "bun x projen". ", ".prettierrc.json": { "overrides": [], }, ".projen/deps.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "bun x projen".", "dependencies": [ { "name": "@aws/pdk", @@ -11104,6 +11074,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -11113,14 +11084,10 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "bun x projen".", "files": [ ".eslintrc.json", ".gitattributes", @@ -11140,7 +11107,7 @@ tsconfig.tsbuildinfo ], }, ".projen/tasks.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "bun x projen".", "env": { "PATH": "$(npx -c "node --print process.env.PATH")", }, @@ -11150,7 +11117,7 @@ tsconfig.tsbuildinfo "name": "build", "steps": [ { - "exec": "yarn nx run-many --target=build --output-style=stream --nx-bail", + "exec": "bun x nx run-many --target=build --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -11192,7 +11159,7 @@ tsconfig.tsbuildinfo "name": "compile", "steps": [ { - "exec": "yarn nx run-many --target=compile --output-style=stream --nx-bail", + "exec": "bun x nx run-many --target=compile --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -11223,7 +11190,7 @@ tsconfig.tsbuildinfo "name": "eslint", "steps": [ { - "exec": "yarn nx run-many --target=eslint --output-style=stream --nx-bail", + "exec": "bun x nx run-many --target=eslint --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -11233,7 +11200,7 @@ tsconfig.tsbuildinfo "name": "graph", "steps": [ { - "exec": "yarn nx graph", + "exec": "bun x nx graph", "receiveArgs": true, }, ], @@ -11243,7 +11210,7 @@ tsconfig.tsbuildinfo "name": "install", "steps": [ { - "exec": "yarn install --check-files", + "exec": "bun install", }, ], }, @@ -11252,7 +11219,7 @@ tsconfig.tsbuildinfo "name": "install:ci", "steps": [ { - "exec": "yarn install --check-files --frozen-lockfile", + "exec": "bun install --frozen-lockfile", }, ], }, @@ -11261,7 +11228,7 @@ tsconfig.tsbuildinfo "name": "package", "steps": [ { - "exec": "yarn nx run-many --target=package --output-style=stream --nx-bail", + "exec": "bun x nx run-many --target=package --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -11271,7 +11238,7 @@ tsconfig.tsbuildinfo "name": "post-compile", "steps": [ { - "exec": "yarn nx run-many --target=post-compile --output-style=stream --nx-bail", + "exec": "bun x nx run-many --target=post-compile --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -11280,20 +11247,12 @@ tsconfig.tsbuildinfo "description": "Runs after upgrading dependencies", "name": "post-upgrade", }, - "postinstall": { - "name": "postinstall", - "steps": [ - { - "exec": "yarn nx run-many --target=install --output-style=stream --parallel=1 --nx-bail --projects=py-subproject", - }, - ], - }, "pre-compile": { "description": "Prepare the project for compilation for all affected projects", "name": "pre-compile", "steps": [ { - "exec": "yarn nx run-many --target=pre-compile --output-style=stream --nx-bail", + "exec": "bun x nx run-many --target=pre-compile --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -11303,7 +11262,7 @@ tsconfig.tsbuildinfo "name": "run-many", "steps": [ { - "exec": "yarn nx run-many", + "exec": "bun x nx run-many", "receiveArgs": true, }, ], @@ -11313,7 +11272,7 @@ tsconfig.tsbuildinfo "name": "test", "steps": [ { - "exec": "yarn nx run-many --target=test --output-style=stream --nx-bail", + "exec": "bun x nx run-many --target=test --output-style=stream --nx-bail", "receiveArgs": true, }, ], @@ -11326,19 +11285,19 @@ tsconfig.tsbuildinfo "name": "upgrade", "steps": [ { - "exec": "yarn upgrade npm-check-updates", + "exec": "bun update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { - "exec": "yarn install --check-files", + "exec": "bun install", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "bun update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { - "exec": "npx projen", + "exec": "bun x projen", }, { "spawn": "post-upgrade", @@ -11349,16 +11308,16 @@ tsconfig.tsbuildinfo "name": "upgrade-deps", "steps": [ { - "exec": "yarn npm-check-updates --deep --rejectVersion 0.0.0 -u --dep prod,dev,peer,optional,bundle --target=minor", + "exec": "bun x npm-check-updates --deep --rejectVersion 0.0.0 -u --dep prod,dev,peer,optional,bundle --target=minor", }, { - "exec": "yarn syncpack fix-mismatches", + "exec": "bun x syncpack fix-mismatches", }, { - "exec": "yarn install", + "exec": "bun install", }, { - "exec": "yarn projen", + "exec": "bun x projen", }, ], }, @@ -11367,7 +11326,7 @@ tsconfig.tsbuildinfo "name": "watch", "steps": [ { - "exec": "yarn nx run-many --target=watch --output-style=stream --skip-nx-cache --nx-ignore-cycles --nx-bail", + "exec": "bun x nx run-many --target=watch --output-style=stream --skip-nx-cache --nx-ignore-cycles --nx-bail", "receiveArgs": true, }, ], @@ -11375,7 +11334,7 @@ tsconfig.tsbuildinfo }, }, ".syncpackrc.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "bun x projen".", "dependencyTypes": [], "dev": true, "filter": ".", @@ -11611,7 +11570,7 @@ tsconfig.tsbuildinfo ", "README.md": "# replace this", "nx.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "bun x projen".", "affected": { "defaultBase": "mainline", }, @@ -11658,12 +11617,11 @@ tsconfig.tsbuildinfo }, }, "package.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "bun x projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -11686,12 +11644,12 @@ tsconfig.tsbuildinfo "typescript": "*", }, "engines": { + "bun": ">=1", "node": ">=16", - "yarn": ">=1 <2", }, "license": "Apache-2.0", "main": "lib/index.js", - "name": "Composite", + "name": "BUN", "peerDependencies": { "nx": "^16", }, @@ -11702,178 +11660,2209 @@ tsconfig.tsbuildinfo "wrap-ansi": "^7.0.0", }, "scripts": { - "build": "npx projen build", - "clobber": "npx projen clobber", - "compile": "npx projen compile", - "default": "npx projen default", - "eject": "npx projen eject", - "eslint": "npx projen eslint", - "graph": "npx projen graph", - "install:ci": "yarn projen install:ci", - "package": "npx projen package", - "post-compile": "npx projen post-compile", - "post-upgrade": "npx projen post-upgrade", - "postinstall": "npx projen postinstall", - "pre-compile": "npx projen pre-compile", - "run-many": "npx projen run-many", - "synth-workspace": "yarn projen", - "test": "npx projen test", - "upgrade": "npx projen upgrade", - "upgrade-deps": "npx projen upgrade-deps", - "watch": "npx projen watch", + "build": "bun x projen build", + "clobber": "bun x projen clobber", + "compile": "bun x projen compile", + "default": "bun x projen default", + "eject": "bun x projen eject", + "eslint": "bun x projen eslint", + "graph": "bun x projen graph", + "install:ci": "bun x projen install:ci", + "package": "bun x projen package", + "post-compile": "bun x projen post-compile", + "post-upgrade": "bun x projen post-upgrade", + "pre-compile": "bun x projen pre-compile", + "run-many": "bun x projen run-many", + "synth-workspace": "bun x projen", + "test": "bun x projen test", + "upgrade": "bun x projen upgrade", + "upgrade-deps": "bun x projen upgrade-deps", + "watch": "bun x projen watch", }, "types": "lib/index.d.ts", "version": "0.0.0", "workspaces": { "packages": [ - "packages/py-subproject", "packages/ts-subproject", - "packages/ts-subproject2", ], }, }, - "packages/py-subproject/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". - -/.gitattributes linguist-generated -/.gitignore linguist-generated -/.projen/** linguist-generated -/.projen/deps.json linguist-generated -/.projen/files.json linguist-generated -/.projen/tasks.json linguist-generated -/project.json linguist-generated -/requirements-dev.txt linguist-generated -/requirements.txt linguist-generated", - "packages/py-subproject/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". -node_modules/ -!/.gitattributes -!/.projen/tasks.json -!/.projen/deps.json -!/.projen/files.json -/.env -!/requirements.txt -!/requirements-dev.txt -__pycache__/ -*.py[cod] -*$py.class -*.so -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST -*.manifest -*.spec -pip-log.txt -pip-delete-this-directory.txt -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ -*.mo -*.pot -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal -instance/ -.webassets-cache -.scrapy -docs/_build/ -.pybuilder/ -target/ -.ipynb_checkpoints -profile_default/ -ipython_config.py -__pypackages__/ -celerybeat-schedule -celerybeat.pid -*.sage.py -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ -.spyderproject -.spyproject -.ropeproject -/site -.mypy_cache/ -.dmypy.json -dmypy.json -.pyre/ -.pytype/ -cython_debug/ -!/project.json -", - "packages/py-subproject/.projen/deps.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", - "dependencies": [ - { - "name": "pytest", - "type": "test", - "version": "6.2.1", - }, + "packages/ts-subproject/.eslintrc.json": { + "env": { + "jest": true, + "node": true, + }, + "extends": [ + "plugin:import/typescript", ], - }, - "packages/py-subproject/.projen/files.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", - "files": [ - ".gitattributes", - ".gitignore", - ".projen/deps.json", - ".projen/files.json", - ".projen/tasks.json", - "project.json", - "requirements-dev.txt", - "requirements.txt", + "ignorePatterns": [ + "*.js", + "*.d.ts", + "node_modules/", + "*.generated.ts", + "coverage", ], - }, - "packages/py-subproject/.projen/tasks.json": { - "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", - "env": { - "PATH": "$(echo $PWD/.env/bin:$PATH)", - "VIRTUAL_ENV": "$(echo $PWD/.env)", + "overrides": [], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2018, + "project": "./tsconfig.dev.json", + "sourceType": "module", }, - "tasks": { - "build": { - "description": "Full release build", - "name": "build", - "steps": [ - { - "spawn": "pre-compile", - }, - { - "spawn": "compile", - }, - { - "spawn": "post-compile", - }, - { - "spawn": "test", + "plugins": [ + "@typescript-eslint", + "import", + ], + "root": true, + "rules": { + "@typescript-eslint/indent": [ + "error", + 2, + ], + "@typescript-eslint/member-delimiter-style": [ + "error", + ], + "@typescript-eslint/member-ordering": [ + "error", + { + "default": [ + "public-static-field", + "public-static-method", + "protected-static-field", + "protected-static-method", + "private-static-field", + "private-static-method", + "field", + "constructor", + "method", + ], + }, + ], + "@typescript-eslint/no-floating-promises": [ + "error", + ], + "@typescript-eslint/no-require-imports": [ + "error", + ], + "@typescript-eslint/no-shadow": [ + "error", + ], + "@typescript-eslint/return-await": [ + "error", + ], + "array-bracket-newline": [ + "error", + "consistent", + ], + "array-bracket-spacing": [ + "error", + "never", + ], + "brace-style": [ + "error", + "1tbs", + { + "allowSingleLine": true, + }, + ], + "comma-dangle": [ + "error", + "always-multiline", + ], + "comma-spacing": [ + "error", + { + "after": true, + "before": false, + }, + ], + "curly": [ + "error", + "multi-line", + "consistent", + ], + "dot-notation": [ + "error", + ], + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": [ + "**/test/**", + "**/build-tools/**", + ], + "optionalDependencies": false, + "peerDependencies": true, + }, + ], + "import/no-unresolved": [ + "error", + ], + "import/order": [ + "warn", + { + "alphabetize": { + "caseInsensitive": true, + "order": "asc", + }, + "groups": [ + "builtin", + "external", + ], + }, + ], + "indent": [ + "off", + ], + "key-spacing": [ + "error", + ], + "keyword-spacing": [ + "error", + ], + "max-len": [ + "error", + { + "code": 150, + "ignoreComments": true, + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreUrls": true, + }, + ], + "no-bitwise": [ + "error", + ], + "no-duplicate-imports": [ + "error", + ], + "no-multi-spaces": [ + "error", + { + "ignoreEOLComments": false, + }, + ], + "no-multiple-empty-lines": [ + "error", + ], + "no-return-await": [ + "off", + ], + "no-shadow": [ + "off", + ], + "no-trailing-spaces": [ + "error", + ], + "object-curly-newline": [ + "error", + { + "consistent": true, + "multiline": true, + }, + ], + "object-curly-spacing": [ + "error", + "always", + ], + "object-property-newline": [ + "error", + { + "allowAllPropertiesOnSameLine": true, + }, + ], + "quote-props": [ + "error", + "consistent-as-needed", + ], + "quotes": [ + "error", + "single", + { + "avoidEscape": true, + }, + ], + "semi": [ + "error", + "always", + ], + "space-before-blocks": [ + "error", + ], + }, + "settings": { + "import/parsers": { + "@typescript-eslint/parser": [ + ".ts", + ".tsx", + ], + }, + "import/resolver": { + "node": {}, + "typescript": { + "alwaysTryTypes": true, + "project": "./tsconfig.dev.json", + }, + }, + }, + }, + "packages/ts-subproject/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +/.eslintrc.json linguist-generated +/.gitattributes linguist-generated +/.gitignore linguist-generated +/.npmignore linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/bun.lockb linguist-generated +/LICENSE linguist-generated +/package.json linguist-generated +/project.json linguist-generated +/tsconfig.dev.json linguist-generated +/tsconfig.json linguist-generated", + "packages/ts-subproject/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/package.json +!/LICENSE +!/.npmignore +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +pids +*.pid +*.seed +*.pid.lock +lib-cov +coverage +*.lcov +.nyc_output +build/Release +node_modules/ +jspm_packages/ +*.tsbuildinfo +.eslintcache +*.tgz +.yarn-integrity +.cache +!/.projenrc.js +/test-reports/ +junit.xml +/coverage/ +!/test/ +!/tsconfig.json +!/tsconfig.dev.json +!/src/ +/lib +/dist/ +!/.eslintrc.json +!/project.json +", + "packages/ts-subproject/.npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +/.projen/ +/test-reports/ +junit.xml +/coverage/ +/test/ +/tsconfig.dev.json +/src/ +!/lib/ +!/lib/**/*.js +!/lib/**/*.d.ts +dist +/tsconfig.json +/.github/ +/.vscode/ +/.idea/ +/.projenrc.js +tsconfig.tsbuildinfo +/.eslintrc.json +", + "packages/ts-subproject/.projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": [ + { + "name": "@types/jest", + "type": "build", + }, + { + "name": "@types/node", + "type": "build", + "version": "^16", + }, + { + "name": "@typescript-eslint/eslint-plugin", + "type": "build", + "version": "^6", + }, + { + "name": "@typescript-eslint/parser", + "type": "build", + "version": "^6", + }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, + { + "name": "eslint-import-resolver-node", + "type": "build", + }, + { + "name": "eslint-import-resolver-typescript", + "type": "build", + }, + { + "name": "eslint-plugin-import", + "type": "build", + }, + { + "name": "eslint", + "type": "build", + "version": "^8", + }, + { + "name": "jest", + "type": "build", + }, + { + "name": "jest-junit", + "type": "build", + "version": "^15", + }, + { + "name": "npm-check-updates", + "type": "build", + "version": "^16", + }, + { + "name": "projen", + "type": "build", + }, + { + "name": "ts-jest", + "type": "build", + }, + { + "name": "typescript", + "type": "build", + }, + ], + }, + "packages/ts-subproject/.projen/files.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "files": [ + ".eslintrc.json", + ".gitattributes", + ".gitignore", + ".npmignore", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "LICENSE", + "project.json", + "tsconfig.dev.json", + "tsconfig.json", + ], + }, + "packages/ts-subproject/.projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "env": { + "PATH": "$(npx -c "node --print process.env.PATH")", + }, + "tasks": { + "build": { + "description": "Full release build", + "name": "build", + "steps": [ + { + "spawn": "pre-compile", + }, + { + "spawn": "compile", + }, + { + "spawn": "post-compile", + }, + { + "spawn": "test", + }, + { + "spawn": "package", + }, + ], + }, + "compile": { + "description": "Only compile", + "name": "compile", + "steps": [ + { + "exec": "tsc --build", + }, + ], + }, + "default": { + "description": "Synthesize project files", + "name": "default", + }, + "eslint": { + "description": "Runs eslint against the codebase", + "name": "eslint", + "steps": [ + { + "exec": "eslint --ext .ts,.tsx --fix --no-error-on-unmatched-pattern src test build-tools", + }, + ], + }, + "install": { + "description": "Install project dependencies and update lockfile (non-frozen)", + "name": "install", + "steps": [ + { + "exec": "bun install", + }, + ], + }, + "install:ci": { + "description": "Install project dependencies using frozen lockfile", + "name": "install:ci", + "steps": [ + { + "exec": "bun install --frozen-lockfile", + }, + ], + }, + "package": { + "description": "Creates the distribution package", + "name": "package", + "steps": [ + { + "exec": "mkdir -p dist/js", + }, + { + "exec": "mv $(npm pack) dist/js/", + }, + ], + }, + "post-compile": { + "description": "Runs after successful compilation", + "name": "post-compile", + }, + "post-upgrade": { + "description": "Runs after upgrading dependencies", + "name": "post-upgrade", + }, + "pre-compile": { + "description": "Prepare the project for compilation", + "name": "pre-compile", + }, + "test": { + "description": "Run tests", + "name": "test", + "steps": [ + { + "exec": "jest --passWithNoTests --updateSnapshot", + "receiveArgs": true, + }, + { + "spawn": "eslint", + }, + ], + }, + "test:watch": { + "description": "Run jest in watch mode", + "name": "test:watch", + "steps": [ + { + "exec": "jest --watch", + }, + ], + }, + "upgrade": { + "description": "upgrade dependencies", + "env": { + "CI": "0", + }, + "name": "upgrade", + "steps": [ + { + "exec": "bun update npm-check-updates", + }, + { + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint,jest,jest-junit,npm-check-updates,projen,ts-jest,typescript", + }, + { + "exec": "bun install", + }, + { + "exec": "bun update @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint jest jest-junit npm-check-updates projen ts-jest typescript", + }, + { + "exec": "npx projen", + }, + { + "spawn": "post-upgrade", + }, + ], + }, + "watch": { + "description": "Watch & compile in the background", + "name": "watch", + "steps": [ + { + "exec": "tsc --build -w", + }, + ], + }, + }, + }, + "packages/ts-subproject/LICENSE": " + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +", + "packages/ts-subproject/README.md": "# replace this", + "packages/ts-subproject/package.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "devDependencies": { + "@types/jest": "*", + "@types/node": "^16", + "@typescript-eslint/eslint-plugin": "^6", + "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", + "eslint": "^8", + "eslint-import-resolver-node": "*", + "eslint-import-resolver-typescript": "*", + "eslint-plugin-import": "*", + "jest": "*", + "jest-junit": "^15", + "npm-check-updates": "^16", + "projen": "*", + "ts-jest": "*", + "typescript": "*", + }, + "jest": { + "clearMocks": true, + "collectCoverage": true, + "coverageDirectory": "coverage", + "coveragePathIgnorePatterns": [ + "/node_modules/", + ], + "coverageReporters": [ + "json", + "lcov", + "clover", + "cobertura", + "text", + ], + "globals": { + "ts-jest": { + "tsconfig": "tsconfig.dev.json", + }, + }, + "preset": "ts-jest", + "reporters": [ + "default", + [ + "jest-junit", + { + "outputDirectory": "test-reports", + }, + ], + ], + "testMatch": [ + "/src/**/__tests__/**/*.ts?(x)", + "/(test|src)/**/*(*.)@(spec|test).ts?(x)", + ], + "testPathIgnorePatterns": [ + "/node_modules/", + ], + "watchPathIgnorePatterns": [ + "/node_modules/", + ], + }, + "license": "Apache-2.0", + "main": "lib/index.js", + "name": "ts-subproject", + "scripts": { + "build": "npx projen build", + "compile": "npx projen compile", + "default": "npx projen default", + "eslint": "npx projen eslint", + "package": "npx projen package", + "post-compile": "npx projen post-compile", + "post-upgrade": "npx projen post-upgrade", + "pre-compile": "npx projen pre-compile", + "test": "npx projen test", + "test:watch": "npx projen test:watch", + "upgrade": "npx projen upgrade", + "watch": "npx projen watch", + }, + "types": "lib/index.d.ts", + "version": "0.0.0", + }, + "packages/ts-subproject/project.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "name": "ts-subproject", + "root": "packages/ts-subproject", + "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "command": "bun x projen build", + "cwd": "packages/ts-subproject", + }, + }, + "compile": { + "executor": "nx:run-commands", + "options": { + "command": "bun x projen compile", + "cwd": "packages/ts-subproject", + }, + }, + "default": { + "executor": "nx:run-commands", + "options": { + "command": "bun x projen default", + "cwd": "packages/ts-subproject", + }, + }, + "eslint": { + "executor": "nx:run-commands", + "options": { + "command": "bun x projen eslint", + "cwd": "packages/ts-subproject", + }, + }, + "package": { + "executor": "nx:run-commands", + "options": { + "command": "bun x projen package", + "cwd": "packages/ts-subproject", + }, + }, + "post-compile": { + "executor": "nx:run-commands", + "options": { + "command": "bun x projen post-compile", + "cwd": "packages/ts-subproject", + }, + }, + "post-upgrade": { + "executor": "nx:run-commands", + "options": { + "command": "bun x projen post-upgrade", + "cwd": "packages/ts-subproject", + }, + }, + "pre-compile": { + "executor": "nx:run-commands", + "options": { + "command": "bun x projen pre-compile", + "cwd": "packages/ts-subproject", + }, + }, + "test": { + "executor": "nx:run-commands", + "options": { + "command": "bun x projen test", + "cwd": "packages/ts-subproject", + }, + }, + "test:watch": { + "executor": "nx:run-commands", + "options": { + "command": "bun x projen test:watch", + "cwd": "packages/ts-subproject", + }, + }, + "upgrade": { + "executor": "nx:run-commands", + "options": { + "command": "bun x projen upgrade", + "cwd": "packages/ts-subproject", + }, + }, + "watch": { + "executor": "nx:run-commands", + "options": { + "command": "bun x projen watch", + "cwd": "packages/ts-subproject", + }, + }, + }, + }, + "packages/ts-subproject/src/index.ts": "export class Hello { + public sayHello() { + return 'hello, world!'; + } +}", + "packages/ts-subproject/test/hello.test.ts": "import { Hello } from '../src'; + +test('hello', () => { + expect(new Hello().sayHello()).toBe('hello, world!'); +});", + "packages/ts-subproject/tsconfig.dev.json": { + "compilerOptions": { + "alwaysStrict": true, + "declaration": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "inlineSourceMap": true, + "inlineSources": true, + "lib": [ + "es2019", + ], + "module": "CommonJS", + "noEmitOnError": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "resolveJsonModule": true, + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "stripInternal": true, + "target": "ES2019", + }, + "exclude": [ + "node_modules", + ], + "include": [ + ".projenrc.js", + "src/**/*.ts", + "test/**/*.ts", + ], + }, + "packages/ts-subproject/tsconfig.json": { + "compilerOptions": { + "alwaysStrict": true, + "declaration": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "inlineSourceMap": true, + "inlineSources": true, + "lib": [ + "es2019", + ], + "module": "CommonJS", + "noEmitOnError": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "lib", + "resolveJsonModule": true, + "rootDir": "src", + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "stripInternal": true, + "target": "ES2019", + }, + "exclude": [], + "include": [ + "src/**/*.ts", + ], + }, + "tsconfig.dev.json": { + "compilerOptions": { + "alwaysStrict": true, + "declaration": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "inlineSourceMap": true, + "inlineSources": true, + "lib": [ + "es2019", + ], + "module": "CommonJS", + "noEmitOnError": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "resolveJsonModule": true, + "rootDir": ".", + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "stripInternal": true, + "target": "ES2019", + }, + "exclude": [ + "node_modules", + ], + "include": [ + ".projenrc.js", + "src/**/*.ts", + "test/**/*.ts", + "**/*.ts", + ".projenrc.ts", + ".projenrc.ts", + "projenrc/**/*.ts", + ], + }, + "tsconfig.json": { + "compilerOptions": { + "alwaysStrict": true, + "declaration": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "inlineSourceMap": true, + "inlineSources": true, + "lib": [ + "es2019", + ], + "module": "CommonJS", + "noEmitOnError": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "lib", + "resolveJsonModule": true, + "rootDir": ".", + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "stripInternal": true, + "target": "ES2019", + }, + "exclude": [], + "include": [ + "src/**/*.ts", + "**/*.ts", + ".projenrc.ts", + ], + }, +} +`; + +exports[`NX Monorepo Unit Tests Composite 1`] = ` +{ + ".eslintrc.json": { + "env": { + "jest": true, + "node": true, + }, + "extends": [ + "plugin:import/typescript", + "prettier", + "plugin:prettier/recommended", + ], + "ignorePatterns": [ + "packages/**/*.*", + "!.projenrc.ts", + "!projenrc/**/*.ts", + ], + "overrides": [ + { + "files": [ + ".projenrc.ts", + ], + "rules": { + "@typescript-eslint/no-require-imports": "off", + "import/no-extraneous-dependencies": "off", + }, + }, + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2018, + "project": "./tsconfig.dev.json", + "sourceType": "module", + }, + "plugins": [ + "@typescript-eslint", + "import", + "prettier", + ], + "root": true, + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { + "default": [ + "public-static-field", + "public-static-method", + "protected-static-field", + "protected-static-method", + "private-static-field", + "private-static-method", + "field", + "constructor", + "method", + ], + }, + ], + "@typescript-eslint/no-floating-promises": [ + "error", + ], + "@typescript-eslint/no-require-imports": [ + "error", + ], + "@typescript-eslint/no-shadow": [ + "error", + ], + "@typescript-eslint/return-await": [ + "error", + ], + "dot-notation": [ + "error", + ], + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": [ + "**/test/**", + "**/build-tools/**", + ".projenrc.ts", + "projenrc/**/*.ts", + ], + "optionalDependencies": false, + "peerDependencies": true, + }, + ], + "import/no-unresolved": [ + "error", + ], + "import/order": [ + "warn", + { + "alphabetize": { + "caseInsensitive": true, + "order": "asc", + }, + "groups": [ + "builtin", + "external", + ], + }, + ], + "key-spacing": [ + "error", + ], + "no-bitwise": [ + "error", + ], + "no-duplicate-imports": [ + "error", + ], + "no-multiple-empty-lines": [ + "error", + ], + "no-return-await": [ + "off", + ], + "no-shadow": [ + "off", + ], + "no-trailing-spaces": [ + "error", + ], + "prettier/prettier": [ + "error", + ], + }, + "settings": { + "import/parsers": { + "@typescript-eslint/parser": [ + ".ts", + ".tsx", + ], + }, + "import/resolver": { + "node": {}, + "typescript": { + "alwaysTryTypes": true, + "project": "./tsconfig.dev.json", + }, + }, + }, + }, + ".gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". + +*.snap linguist-generated +/.eslintrc.json linguist-generated +/.gitattributes linguist-generated +/.gitignore linguist-generated +/.npmignore linguist-generated +/.nxignore linguist-generated +/.prettierignore linguist-generated +/.prettierrc.json linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/.syncpackrc.json linguist-generated +/LICENSE linguist-generated +/nx.json linguist-generated +/package.json linguist-generated +/tsconfig.dev.json linguist-generated +/tsconfig.json linguist-generated +/yarn.lock linguist-generated", + ".gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +!/package.json +!/LICENSE +!/.npmignore +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +pids +*.pid +*.seed +*.pid.lock +lib-cov +coverage +*.lcov +.nyc_output +build/Release +node_modules/ +jspm_packages/ +*.tsbuildinfo +.eslintcache +*.tgz +.yarn-integrity +.cache +.tmp +!/.projenrc.js +!/.prettierignore +!/.prettierrc.json +!/test/ +!/tsconfig.json +!/tsconfig.dev.json +!/src/ +/lib +/dist/ +!/.eslintrc.json +.nx/cache +!/nx.json +!/.nxignore +!/.syncpackrc.json +", + ".npmignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +/.projen/ +/test/ +/tsconfig.dev.json +/src/ +!/lib/ +!/lib/**/*.js +!/lib/**/*.d.ts +dist +/tsconfig.json +/.github/ +/.vscode/ +/.idea/ +/.projenrc.js +tsconfig.tsbuildinfo +/.eslintrc.json +", + ".nxignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +.tmp +.env +.pytest_cache +", + ".prettierignore": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". +", + ".prettierrc.json": { + "overrides": [], + }, + ".projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "dependencies": [ + { + "name": "@aws/pdk", + "type": "build", + "version": "^0", + }, + { + "name": "@types/node", + "type": "build", + "version": "^16", + }, + { + "name": "@typescript-eslint/eslint-plugin", + "type": "build", + "version": "^6", + }, + { + "name": "@typescript-eslint/parser", + "type": "build", + "version": "^6", + }, + { + "name": "constructs", + "type": "build", + "version": "^10.0.0", + }, + { + "name": "eslint-config-prettier", + "type": "build", + }, + { + "name": "eslint-import-resolver-node", + "type": "build", + }, + { + "name": "eslint-import-resolver-typescript", + "type": "build", + }, + { + "name": "eslint-plugin-import", + "type": "build", + }, + { + "name": "eslint-plugin-prettier", + "type": "build", + }, + { + "name": "eslint", + "type": "build", + "version": "^8", + }, + { + "name": "npm-check-updates", + "type": "build", + }, + { + "name": "nx", + "type": "build", + "version": "^16", + }, + { + "name": "prettier", + "type": "build", + }, + { + "name": "projen", + "type": "build", + }, + { + "name": "syncpack", + "type": "build", + }, + { + "name": "ts-node", + "type": "build", + }, + { + "name": "typescript", + "type": "build", + }, + { + "name": "@types/babel__traverse", + "type": "override", + "version": "7.18.2", + }, + { + "name": "@zkochan/js-yaml", + "type": "override", + "version": "npm:js-yaml@4.1.0", + }, + { + "name": "wrap-ansi", + "type": "override", + "version": "^7.0.0", + }, + { + "name": "nx", + "type": "peer", + "version": "^16", + }, + { + "name": "@aws-cdk/aws-cognito-identitypool-alpha", + "type": "runtime", + "version": "latest", + }, + { + "name": "aws-cdk-lib", + "type": "runtime", + }, + { + "name": "cdk-nag", + "type": "runtime", + }, + ], + }, + ".projen/files.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "files": [ + ".eslintrc.json", + ".gitattributes", + ".gitignore", + ".npmignore", + ".nxignore", + ".prettierignore", + ".prettierrc.json", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + ".syncpackrc.json", + "LICENSE", + "nx.json", + "tsconfig.dev.json", + "tsconfig.json", + ], + }, + ".projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "env": { + "PATH": "$(npx -c "node --print process.env.PATH")", + }, + "tasks": { + "build": { + "description": "Full release build for all affected projects", + "name": "build", + "steps": [ + { + "exec": "yarn nx run-many --target=build --output-style=stream --nx-bail", + "receiveArgs": true, + }, + ], + }, + "clobber": { + "condition": "git diff --exit-code > /dev/null", + "description": "hard resets to HEAD of origin and cleans the local repo", + "env": { + "BRANCH": "$(git branch --show-current)", + }, + "name": "clobber", + "steps": [ + { + "exec": "git checkout -b scratch", + "name": "save current HEAD in "scratch" branch", + }, + { + "exec": "git checkout $BRANCH", + }, + { + "exec": "git fetch origin", + "name": "fetch latest changes from origin", + }, + { + "exec": "git reset --hard origin/$BRANCH", + "name": "hard reset to origin commit", + }, + { + "exec": "git clean -fdx", + "name": "clean all untracked files", + }, + { + "say": "ready to rock! (unpushed commits are under the "scratch" branch)", + }, + ], + }, + "compile": { + "description": "Only compile for all affected projects", + "name": "compile", + "steps": [ + { + "exec": "yarn nx run-many --target=compile --output-style=stream --nx-bail", + "receiveArgs": true, + }, + ], + }, + "default": { + "description": "Synthesize project files", + "name": "default", + "steps": [ + { + "exec": "ts-node --project tsconfig.dev.json .projenrc.ts", + }, + ], + }, + "eject": { + "description": "Remove projen from the project", + "env": { + "PROJEN_EJECTING": "true", + }, + "name": "eject", + "steps": [ + { + "spawn": "default", + }, + ], + }, + "eslint": { + "description": "Runs eslint against the codebase for all affected projects", + "name": "eslint", + "steps": [ + { + "exec": "yarn nx run-many --target=eslint --output-style=stream --nx-bail", + "receiveArgs": true, + }, + ], + }, + "graph": { + "description": "Generate dependency graph for monorepo", + "name": "graph", + "steps": [ + { + "exec": "yarn nx graph", + "receiveArgs": true, + }, + ], + }, + "install": { + "description": "Install project dependencies and update lockfile (non-frozen)", + "name": "install", + "steps": [ + { + "exec": "yarn install --check-files", + }, + ], + }, + "install:ci": { + "description": "Install project dependencies using frozen lockfile", + "name": "install:ci", + "steps": [ + { + "exec": "yarn install --check-files --frozen-lockfile", + }, + ], + }, + "package": { + "description": "Creates the distribution package for all affected projects", + "name": "package", + "steps": [ + { + "exec": "yarn nx run-many --target=package --output-style=stream --nx-bail", + "receiveArgs": true, + }, + ], + }, + "post-compile": { + "description": "Runs after successful compilation for all affected projects", + "name": "post-compile", + "steps": [ + { + "exec": "yarn nx run-many --target=post-compile --output-style=stream --nx-bail", + "receiveArgs": true, + }, + ], + }, + "post-upgrade": { + "description": "Runs after upgrading dependencies", + "name": "post-upgrade", + }, + "postinstall": { + "name": "postinstall", + "steps": [ + { + "exec": "yarn nx run-many --target=install --output-style=stream --parallel=1 --nx-bail --projects=py-subproject", + }, + ], + }, + "pre-compile": { + "description": "Prepare the project for compilation for all affected projects", + "name": "pre-compile", + "steps": [ + { + "exec": "yarn nx run-many --target=pre-compile --output-style=stream --nx-bail", + "receiveArgs": true, + }, + ], + }, + "run-many": { + "description": "Run task against multiple workspace projects", + "name": "run-many", + "steps": [ + { + "exec": "yarn nx run-many", + "receiveArgs": true, + }, + ], + }, + "test": { + "description": "Run tests for all affected projects", + "name": "test", + "steps": [ + { + "exec": "yarn nx run-many --target=test --output-style=stream --nx-bail", + "receiveArgs": true, + }, + ], + }, + "upgrade": { + "description": "upgrade dependencies", + "env": { + "CI": "0", + }, + "name": "upgrade", + "steps": [ + { + "exec": "yarn upgrade npm-check-updates", + }, + { + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", + }, + { + "exec": "yarn install --check-files", + }, + { + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", + }, + { + "exec": "npx projen", + }, + { + "spawn": "post-upgrade", + }, + ], + }, + "upgrade-deps": { + "name": "upgrade-deps", + "steps": [ + { + "exec": "yarn npm-check-updates --deep --rejectVersion 0.0.0 -u --dep prod,dev,peer,optional,bundle --target=minor", + }, + { + "exec": "yarn syncpack fix-mismatches", + }, + { + "exec": "yarn install", + }, + { + "exec": "yarn projen", + }, + ], + }, + "watch": { + "description": "Watch & compile in the background for all affected projects", + "name": "watch", + "steps": [ + { + "exec": "yarn nx run-many --target=watch --output-style=stream --skip-nx-cache --nx-ignore-cycles --nx-bail", + "receiveArgs": true, + }, + ], + }, + }, + }, + ".syncpackrc.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "dependencyTypes": [], + "dev": true, + "filter": ".", + "indent": " ", + "overrides": true, + "peer": true, + "pnpmOverrides": true, + "prod": true, + "resolutions": true, + "semverGroups": [], + "semverRange": "", + "sortAz": [ + "contributors", + "dependencies", + "devDependencies", + "keywords", + "peerDependencies", + "resolutions", + "scripts", + ], + "sortFirst": [ + "name", + "description", + "version", + "author", + ], + "source": [], + "versionGroups": [], + "workspace": true, + }, + "LICENSE": " + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +", + "README.md": "# replace this", + "nx.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "affected": { + "defaultBase": "mainline", + }, + "extends": "nx/presets/npm.json", + "namedInputs": { + "default": [ + "{projectRoot}/**/*", + ], + }, + "npmScope": "monorepo", + "targetDefaults": { + "build": { + "dependsOn": [ + "^build", + ], + "inputs": [ + "default", + "^default", + ], + "outputs": [ + "{projectRoot}/dist", + "{projectRoot}/lib", + "{projectRoot}/build", + "{projectRoot}/coverage", + "{projectRoot}/test-reports", + "{projectRoot}/target", + "{projectRoot}/cdk.out", + "{projectRoot}/LICENSE_THIRD_PARTY", + "{projectRoot}/.jsii", + ], + }, + }, + "tasksRunnerOptions": { + "default": { + "options": { + "cacheableOperations": [ + "build", + "test", + ], + "useDaemonProcess": false, + }, + "runner": "nx/tasks-runners/default", + }, + }, + }, + "package.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", + "dependencies": { + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", + "aws-cdk-lib": "*", + "cdk-nag": "*", + }, + "devDependencies": { + "@aws/pdk": "^0", + "@types/node": "^16", + "@typescript-eslint/eslint-plugin": "^6", + "@typescript-eslint/parser": "^6", + "constructs": "^10.0.0", + "eslint": "^8", + "eslint-config-prettier": "*", + "eslint-import-resolver-node": "*", + "eslint-import-resolver-typescript": "*", + "eslint-plugin-import": "*", + "eslint-plugin-prettier": "*", + "npm-check-updates": "*", + "nx": "16.0.0", + "prettier": "*", + "projen": "*", + "syncpack": "*", + "ts-node": "*", + "typescript": "*", + }, + "engines": { + "node": ">=16", + "yarn": ">=1 <2", + }, + "license": "Apache-2.0", + "main": "lib/index.js", + "name": "Composite", + "peerDependencies": { + "nx": "^16", + }, + "private": true, + "resolutions": { + "@types/babel__traverse": "7.18.2", + "@zkochan/js-yaml": "npm:js-yaml@4.1.0", + "wrap-ansi": "^7.0.0", + }, + "scripts": { + "build": "npx projen build", + "clobber": "npx projen clobber", + "compile": "npx projen compile", + "default": "npx projen default", + "eject": "npx projen eject", + "eslint": "npx projen eslint", + "graph": "npx projen graph", + "install:ci": "yarn projen install:ci", + "package": "npx projen package", + "post-compile": "npx projen post-compile", + "post-upgrade": "npx projen post-upgrade", + "postinstall": "npx projen postinstall", + "pre-compile": "npx projen pre-compile", + "run-many": "npx projen run-many", + "synth-workspace": "yarn projen", + "test": "npx projen test", + "upgrade": "npx projen upgrade", + "upgrade-deps": "npx projen upgrade-deps", + "watch": "npx projen watch", + }, + "types": "lib/index.d.ts", + "version": "0.0.0", + "workspaces": { + "packages": [ + "packages/ts-subproject", + "packages/ts-subproject2", + ], + }, + }, + "packages/py-subproject/.gitattributes": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". + +/.gitattributes linguist-generated +/.gitignore linguist-generated +/.projen/** linguist-generated +/.projen/deps.json linguist-generated +/.projen/files.json linguist-generated +/.projen/tasks.json linguist-generated +/project.json linguist-generated +/requirements-dev.txt linguist-generated +/requirements.txt linguist-generated", + "packages/py-subproject/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". +node_modules/ +!/.gitattributes +!/.projen/tasks.json +!/.projen/deps.json +!/.projen/files.json +/.env +!/requirements.txt +!/requirements-dev.txt +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST +*.manifest +*.spec +pip-log.txt +pip-delete-this-directory.txt +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ +*.mo +*.pot +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal +instance/ +.webassets-cache +.scrapy +docs/_build/ +.pybuilder/ +target/ +.ipynb_checkpoints +profile_default/ +ipython_config.py +__pypackages__/ +celerybeat-schedule +celerybeat.pid +*.sage.py +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ +.spyderproject +.spyproject +.ropeproject +/site +.mypy_cache/ +.dmypy.json +dmypy.json +.pyre/ +.pytype/ +cython_debug/ +!/project.json +", + "packages/py-subproject/.projen/deps.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "dependencies": [ + { + "name": "pytest", + "type": "test", + "version": "6.2.1", + }, + ], + }, + "packages/py-subproject/.projen/files.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "files": [ + ".gitattributes", + ".gitignore", + ".projen/deps.json", + ".projen/files.json", + ".projen/tasks.json", + "project.json", + "requirements-dev.txt", + "requirements.txt", + ], + }, + "packages/py-subproject/.projen/tasks.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "env": { + "PATH": "$(echo $PWD/.env/bin:$PATH)", + "VIRTUAL_ENV": "$(echo $PWD/.env)", + }, + "tasks": { + "build": { + "description": "Full release build", + "name": "build", + "steps": [ + { + "spawn": "pre-compile", + }, + { + "spawn": "compile", + }, + { + "spawn": "post-compile", + }, + { + "spawn": "test", }, { "spawn": "package", @@ -14441,6 +16430,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -14450,10 +16440,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -14659,13 +16645,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -14990,10 +16976,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -15476,6 +17461,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -15485,10 +17471,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -15693,13 +17675,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -16024,10 +18006,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -16513,6 +18494,7 @@ pattern1.txt { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -16522,10 +18504,6 @@ pattern1.txt "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -16730,13 +18708,13 @@ pattern1.txt "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -17061,10 +19039,9 @@ pattern1.txt "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -17556,6 +19533,7 @@ resolution-mode=highest { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -17565,10 +19543,6 @@ resolution-mode=highest "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -17775,13 +19749,13 @@ resolution-mode=highest "exec": "pnpm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "pnpm i --no-frozen-lockfile", }, { - "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "pnpm exec projen", @@ -18106,10 +20080,9 @@ resolution-mode=highest "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -19595,6 +21568,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -19604,10 +21578,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -19812,13 +21782,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -20156,10 +22126,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -20643,6 +22612,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -20652,10 +22622,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -20860,13 +22826,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -21191,10 +23157,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", diff --git a/packages/monorepo/test/monorepo.test.ts b/packages/monorepo/test/monorepo.test.ts index 0bc49917a..473054877 100644 --- a/packages/monorepo/test/monorepo.test.ts +++ b/packages/monorepo/test/monorepo.test.ts @@ -182,6 +182,23 @@ describe("NX Monorepo Unit Tests", () => { expect(synthSnapshot(project)).toMatchSnapshot(); }); + it("BUN", () => { + const project = new MonorepoTsProject({ + defaultReleaseBranch: "mainline", + name: "BUN", + packageManager: NodePackageManager.BUN, + }); + new TypeScriptProject({ + name: "ts-subproject", + outdir: "packages/ts-subproject", + parent: project, + packageManager: NodePackageManager.BUN, + defaultReleaseBranch: "mainline", + }); + + expect(synthSnapshot(project)).toMatchSnapshot(); + }); + it("Validate consistent Package Managers", () => { const project = new MonorepoTsProject({ defaultReleaseBranch: "mainline", diff --git a/packages/pdk/_scripts/exec-command.js b/packages/pdk/_scripts/exec-command.js index 13c20d768..62634b0f0 100755 --- a/packages/pdk/_scripts/exec-command.js +++ b/packages/pdk/_scripts/exec-command.js @@ -27,7 +27,8 @@ const engines = JSON.parse( ).engines; if (engines) { - let pkgMgrCmd = engines.pnpm ? "pnpm" : engines.yarn ? "yarn" : "npm run"; + let pkgMgrCmd = engines.pnpm ? "pnpm" : engines.yarn ? "yarn" : engines.bun ? "bun" : "npm run"; + // Deploy is a pnpm command, but it's more likely users want to run the deploy task if (engines.pnpm && process.argv[0] === "deploy") { pkgMgrCmd += " run"; diff --git a/packages/type-safe-api/src/project/codegen/handlers/generated-typescript-handlers-project.ts b/packages/type-safe-api/src/project/codegen/handlers/generated-typescript-handlers-project.ts index 3a9279070..4d9280195 100644 --- a/packages/type-safe-api/src/project/codegen/handlers/generated-typescript-handlers-project.ts +++ b/packages/type-safe-api/src/project/codegen/handlers/generated-typescript-handlers-project.ts @@ -142,17 +142,6 @@ export class GeneratedTypescriptHandlersProject extends TypeScriptProject { // If we're not in a monorepo, we need to link the generated types such that the local dependency can be resolved if (!options.isWithinMonorepo) { switch (this.package.packageManager) { - case NodePackageManager.NPM: - case NodePackageManager.YARN: - case NodePackageManager.YARN2: - case NodePackageManager.YARN_CLASSIC: - case NodePackageManager.YARN_BERRY: - this.tasks - .tryFind("install") - ?.prependExec( - `${this.package.packageManager} link ${this.options.generatedTypescriptTypes.package.packageName}` - ); - break; case NodePackageManager.PNPM: this.tasks .tryFind("install") @@ -164,9 +153,12 @@ export class GeneratedTypescriptHandlersProject extends TypeScriptProject { ); break; default: - console.warn( - `Unknown package manager ${this.package.packageManager}. Cannot link generated typescript client.` - ); + this.tasks + .tryFind("install") + ?.prependExec( + `${this.package.packageManager} link ${this.options.generatedTypescriptTypes.package.packageName}` + ); + break; } } } diff --git a/packages/type-safe-api/src/project/codegen/infrastructure/cdk/generated-typescript-cdk-infrastructure-project.ts b/packages/type-safe-api/src/project/codegen/infrastructure/cdk/generated-typescript-cdk-infrastructure-project.ts index b11bb831f..76e149232 100644 --- a/packages/type-safe-api/src/project/codegen/infrastructure/cdk/generated-typescript-cdk-infrastructure-project.ts +++ b/packages/type-safe-api/src/project/codegen/infrastructure/cdk/generated-typescript-cdk-infrastructure-project.ts @@ -156,17 +156,6 @@ export class GeneratedTypescriptCdkInfrastructureProject extends TypeScriptProje // If we're not in a monorepo, we need to link the generated types such that the local dependency can be resolved if (!options.isWithinMonorepo) { switch (this.package.packageManager) { - case NodePackageManager.NPM: - case NodePackageManager.YARN: - case NodePackageManager.YARN2: - case NodePackageManager.YARN_CLASSIC: - case NodePackageManager.YARN_BERRY: - this.tasks - .tryFind("install") - ?.prependExec( - `${this.package.packageManager} link ${this.options.generatedTypescriptTypes.package.packageName}` - ); - break; case NodePackageManager.PNPM: this.tasks .tryFind("install") @@ -178,9 +167,12 @@ export class GeneratedTypescriptCdkInfrastructureProject extends TypeScriptProje ); break; default: - console.warn( - `Unknown package manager ${this.package.packageManager}. Cannot link generated typescript client.` - ); + this.tasks + .tryFind("install") + ?.prependExec( + `${this.package.packageManager} link ${this.options.generatedTypescriptTypes.package.packageName}` + ); + break; } } } diff --git a/packages/type-safe-api/src/project/codegen/library/typescript-react-query-hooks-library.ts b/packages/type-safe-api/src/project/codegen/library/typescript-react-query-hooks-library.ts index 1bffe88f5..bbec8ac22 100644 --- a/packages/type-safe-api/src/project/codegen/library/typescript-react-query-hooks-library.ts +++ b/packages/type-safe-api/src/project/codegen/library/typescript-react-query-hooks-library.ts @@ -135,24 +135,16 @@ export class TypescriptReactQueryHooksLibrary extends TypeScriptProject { // resolved if (!options.isWithinMonorepo) { switch (this.package.packageManager) { - case NodePackageManager.NPM: - case NodePackageManager.YARN: - case NodePackageManager.YARN2: - case NodePackageManager.YARN_CLASSIC: - case NodePackageManager.YARN_BERRY: + case NodePackageManager.PNPM: + // Nothing to do for pnpm, since the pnpm link command handles both the dependant and dependee + break; + default: this.tasks .tryFind("install") ?.exec( NodePackageUtils.command.cmd(this.package.packageManager, "link") ); break; - case NodePackageManager.PNPM: - // Nothing to do for pnpm, since the pnpm link command handles both the dependant and dependee - break; - default: - console.warn( - `Unknown package manager ${this.package.packageManager}. Cannot link generated typescript runtime project.` - ); } } } diff --git a/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts b/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts index d61d62d09..e16e474ba 100644 --- a/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts +++ b/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts @@ -133,24 +133,16 @@ export class GeneratedTypescriptRuntimeProject extends TypeScriptProject { // resolved if (!options.isWithinMonorepo) { switch (this.package.packageManager) { - case NodePackageManager.NPM: - case NodePackageManager.YARN: - case NodePackageManager.YARN2: - case NodePackageManager.YARN_CLASSIC: - case NodePackageManager.YARN_BERRY: + case NodePackageManager.PNPM: + // Nothing to do for pnpm, since the pnpm link command handles both the dependant and dependee + break; + default: this.tasks .tryFind("install") ?.exec( NodePackageUtils.command.cmd(this.package.packageManager, "link") ); break; - case NodePackageManager.PNPM: - // Nothing to do for pnpm, since the pnpm link command handles both the dependant and dependee - break; - default: - console.warn( - `Unknown package manager ${this.package.packageManager}. Cannot link generated typescript runtime project.` - ); } } } diff --git a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap index 3df77dc70..b0a6e00b2 100644 --- a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap +++ b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap @@ -3281,6 +3281,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -3290,10 +3291,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -3509,13 +3506,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -3840,10 +3837,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -3906,16 +3902,7 @@ tsconfig.tsbuildinfo "version": "0.0.0", "workspaces": { "packages": [ - "packages/api", - "packages/api/generated/documentation/html_redoc", - "packages/api/generated/documentation/html2", - "packages/api/generated/documentation/markdown", - "packages/api/generated/documentation/plantuml", - "packages/api/model", - "packages/api/generated/runtime/python", "packages/api/generated/runtime/typescript", - "packages/api/generated/infrastructure/java", - "packages/api/generated/runtime/java", ], }, }, @@ -10505,6 +10492,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -10514,10 +10502,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -10733,13 +10717,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -11064,10 +11048,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -11130,16 +11113,7 @@ tsconfig.tsbuildinfo "version": "0.0.0", "workspaces": { "packages": [ - "packages/api", - "packages/api/generated/documentation/html_redoc", - "packages/api/generated/documentation/html2", - "packages/api/generated/documentation/markdown", - "packages/api/generated/documentation/plantuml", - "packages/api/model", - "packages/api/generated/infrastructure/python", - "packages/api/generated/runtime/python", "packages/api/generated/runtime/typescript", - "packages/api/generated/runtime/java", ], }, }, @@ -17933,6 +17907,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -17942,10 +17917,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -18161,13 +18132,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -18492,10 +18463,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -18558,16 +18528,8 @@ tsconfig.tsbuildinfo "version": "0.0.0", "workspaces": { "packages": [ - "packages/api", - "packages/api/generated/documentation/html_redoc", - "packages/api/generated/documentation/html2", - "packages/api/generated/documentation/markdown", - "packages/api/generated/documentation/plantuml", - "packages/api/model", - "packages/api/generated/runtime/python", "packages/api/generated/infrastructure/typescript", "packages/api/generated/runtime/typescript", - "packages/api/generated/runtime/java", ], }, }, @@ -32745,6 +32707,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -32754,10 +32717,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -32973,13 +32932,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -33304,10 +33263,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -33370,16 +33328,7 @@ tsconfig.tsbuildinfo "version": "0.0.0", "workspaces": { "packages": [ - "packages/api", - "packages/api/generated/documentation/html_redoc", - "packages/api/generated/documentation/html2", - "packages/api/generated/documentation/markdown", - "packages/api/generated/documentation/plantuml", - "packages/api/model", - "packages/api/generated/runtime/python", "packages/api/generated/runtime/typescript", - "packages/api/generated/infrastructure/java", - "packages/api/generated/runtime/java", ], }, }, @@ -39575,6 +39524,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -39584,10 +39534,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -39795,13 +39741,13 @@ tsconfig.tsbuildinfo "exec": "npm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "npm install", }, { - "exec": "npm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "npm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -40126,10 +40072,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -40190,12 +40135,6 @@ tsconfig.tsbuildinfo "version": "0.0.0", "workspaces": { "packages": [ - "packages/api", - "packages/api/generated/documentation/html_redoc", - "packages/api/generated/documentation/html2", - "packages/api/generated/documentation/markdown", - "packages/api/generated/documentation/plantuml", - "packages/api/model", "packages/api/generated/infrastructure/typescript", "packages/api/generated/runtime/typescript", ], @@ -45578,6 +45517,7 @@ resolution-mode=highest { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -45587,10 +45527,6 @@ resolution-mode=highest "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -45800,13 +45736,13 @@ resolution-mode=highest "exec": "pnpm update npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "pnpm i --no-frozen-lockfile", }, { - "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "pnpm update @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "pnpm exec projen", @@ -46131,10 +46067,9 @@ resolution-mode=highest "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -46198,12 +46133,6 @@ resolution-mode=highest "version": "0.0.0", "workspaces": { "packages": [ - "packages/api", - "packages/api/generated/documentation/html_redoc", - "packages/api/generated/documentation/html2", - "packages/api/generated/documentation/markdown", - "packages/api/generated/documentation/plantuml", - "packages/api/model", "packages/api/generated/infrastructure/typescript", "packages/api/generated/runtime/typescript", ], @@ -48875,12 +48804,6 @@ structure NotAuthorizedError { "pnpm-workspace.yaml": "# ~~ Generated by projen. To modify, edit .projenrc.ts and run "pnpm exec projen". packages: - - packages/api - - packages/api/generated/documentation/html_redoc - - packages/api/generated/documentation/html2 - - packages/api/generated/documentation/markdown - - packages/api/generated/documentation/plantuml - - packages/api/model - packages/api/generated/infrastructure/typescript - packages/api/generated/runtime/typescript ", @@ -52168,6 +52091,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -52177,10 +52101,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -52396,13 +52316,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -52727,10 +52647,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -52793,16 +52712,7 @@ tsconfig.tsbuildinfo "version": "0.0.0", "workspaces": { "packages": [ - "packages/api", - "packages/api/generated/documentation/html_redoc", - "packages/api/generated/documentation/html2", - "packages/api/generated/documentation/markdown", - "packages/api/generated/documentation/plantuml", - "packages/api/model", - "packages/api/generated/infrastructure/python", - "packages/api/generated/runtime/python", "packages/api/generated/runtime/typescript", - "packages/api/generated/runtime/java", ], }, }, @@ -59782,6 +59692,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -59791,10 +59702,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -60010,13 +59917,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "npx projen", @@ -60341,10 +60248,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -60407,16 +60313,8 @@ tsconfig.tsbuildinfo "version": "0.0.0", "workspaces": { "packages": [ - "packages/api", - "packages/api/generated/documentation/html_redoc", - "packages/api/generated/documentation/html2", - "packages/api/generated/documentation/markdown", - "packages/api/generated/documentation/plantuml", - "packages/api/model", - "packages/api/generated/runtime/python", "packages/api/generated/infrastructure/typescript", "packages/api/generated/runtime/typescript", - "packages/api/generated/runtime/java", ], }, }, @@ -66812,6 +66710,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -66821,10 +66720,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -67032,13 +66927,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "yarn exec projen", @@ -67363,10 +67258,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn exec projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -67428,12 +67322,6 @@ tsconfig.tsbuildinfo "version": "0.0.0", "workspaces": { "packages": [ - "packages/api", - "packages/api/generated/documentation/html_redoc", - "packages/api/generated/documentation/html2", - "packages/api/generated/documentation/markdown", - "packages/api/generated/documentation/plantuml", - "packages/api/model", "packages/api/generated/infrastructure/typescript", "packages/api/generated/runtime/typescript", ], @@ -72800,6 +72688,7 @@ tsconfig.tsbuildinfo { "name": "@aws-cdk/aws-cognito-identitypool-alpha", "type": "runtime", + "version": "latest", }, { "name": "aws-cdk-lib", @@ -72809,10 +72698,6 @@ tsconfig.tsbuildinfo "name": "cdk-nag", "type": "runtime", }, - { - "name": "constructs", - "type": "runtime", - }, ], }, ".projen/files.json": { @@ -73020,13 +72905,13 @@ tsconfig.tsbuildinfo "exec": "yarn upgrade npm-check-updates", }, { - "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,@aws-cdk/aws-cognito-identitypool-alpha,aws-cdk-lib,cdk-nag", + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@aws/pdk,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-node,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint,npm-check-updates,nx,prettier,projen,syncpack,ts-node,typescript,aws-cdk-lib,cdk-nag", }, { "exec": "yarn install --check-files", }, { - "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript @aws-cdk/aws-cognito-identitypool-alpha aws-cdk-lib cdk-nag", + "exec": "yarn upgrade @aws/pdk @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-node eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint npm-check-updates nx prettier projen syncpack ts-node typescript aws-cdk-lib cdk-nag", }, { "exec": "yarn projen", @@ -73351,10 +73236,9 @@ tsconfig.tsbuildinfo "package.json": { "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run "yarn projen".", "dependencies": { - "@aws-cdk/aws-cognito-identitypool-alpha": "*", + "@aws-cdk/aws-cognito-identitypool-alpha": "latest", "aws-cdk-lib": "*", "cdk-nag": "*", - "constructs": "*", }, "devDependencies": { "@aws/pdk": "^0", @@ -73416,12 +73300,6 @@ tsconfig.tsbuildinfo "version": "0.0.0", "workspaces": { "packages": [ - "packages/api", - "packages/api/generated/documentation/html_redoc", - "packages/api/generated/documentation/html2", - "packages/api/generated/documentation/markdown", - "packages/api/generated/documentation/plantuml", - "packages/api/model", "packages/api/generated/infrastructure/typescript", "packages/api/generated/runtime/typescript", ], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 042d2bc4f..39e01802c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,7 +27,7 @@ importers: .: dependencies: '@aws-cdk/aws-cognito-identitypool-alpha': - specifier: ^2.103.1-alpha.0 + specifier: latest version: 2.103.1-alpha.0(aws-cdk-lib@2.93.0)(constructs@10.2.70) '@mrgrain/jsii-struct-builder': specifier: ^0.5.7 @@ -41,9 +41,6 @@ importers: cdk-nag: specifier: ^2.27.115 version: 2.27.117(aws-cdk-lib@2.93.0)(constructs@10.2.70) - constructs: - specifier: ^10.2.70 - version: 10.2.70 fast-xml-parser: specifier: ^4.2.7 version: 4.2.7 @@ -84,6 +81,9 @@ importers: commitizen: specifier: ^4.3.0 version: 4.3.0 + constructs: + specifier: ^10.0.0 + version: 10.2.70 cz-conventional-changelog: specifier: ^3.3.0 version: 3.3.0 @@ -6863,7 +6863,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.3.0-dev.20231031 + typescript: 5.3.0-dev.20231101 dev: true /duplexer2@0.0.2: @@ -13605,8 +13605,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - /typescript@5.3.0-dev.20231031: - resolution: {integrity: sha512-+w6szmOFr7GSWj/eNFgHdYqubMux9B5ao5LFoGdn712gbDYMpLwqLNkPLpJHD9chl/2wc/W96iSfALkZs7sVXQ==} + /typescript@5.3.0-dev.20231101: + resolution: {integrity: sha512-yt5zz7L+TBfzeJhMA/tAEO1YU8J2DWsFN3LbeMslNPXL3S0lR3yvePdl6fXCk7QFjnfaRtXH0noNdWg2imHWXg==} engines: {node: '>=14.17'} hasBin: true dev: true From 9870c9b59548ebf51b1174a86b94fc8220affd4e Mon Sep 17 00:00:00 2001 From: Janek Lasocki-Biczysko Date: Sat, 4 Nov 2023 01:17:03 +0000 Subject: [PATCH 21/21] fix(docs): typo in monorepo synthesis docs (#634) --- .../monorepo/docs/developer_guides/monorepo/synthesis.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/monorepo/docs/developer_guides/monorepo/synthesis.md b/packages/monorepo/docs/developer_guides/monorepo/synthesis.md index fe2e84426..62bb9ee61 100644 --- a/packages/monorepo/docs/developer_guides/monorepo/synthesis.md +++ b/packages/monorepo/docs/developer_guides/monorepo/synthesis.md @@ -17,7 +17,7 @@ To extend the synth process, components and projects can override each of these Whenever you make a change to the `.projenrc` file, you will need to re-synthesize your project(s). To do so, run the `pdk` command from the root of your monorepo. This will re-generate all managed files and will any new dependencies. -## Synthesizing your project within installing dependencies +## Synthesizing your project without installing dependencies -In some instances, it may be desirable to synthesize all your files without installing any dependencies. -To do this, run the `pdk --no-post` command. \ No newline at end of file +In some instances, it may be desirable to synthesize all your files without installing any dependencies. +To do this, run the `pdk --no-post` command.