From 943944ae11eee82c34e127606b62a61f465b7745 Mon Sep 17 00:00:00 2001 From: "martin.mueller" Date: Wed, 25 Nov 2020 17:54:15 +0100 Subject: [PATCH] feat: cleanup --- .projenrc.js | 26 ++++++------ API.md | 20 ++++++++- package.json | 18 ++++---- .../__snapshots__/integ.snapshot.test.ts.snap | 10 ++--- yarn.lock | 41 ++++++++----------- 5 files changed, 65 insertions(+), 50 deletions(-) diff --git a/.projenrc.js b/.projenrc.js index cebf30e..91df86a 100644 --- a/.projenrc.js +++ b/.projenrc.js @@ -1,25 +1,23 @@ const { AwsCdkConstructLibrary } = require('projen'); -const alpsUnifiedDependencies = { - "unified": "https://github.com/mamund/alps-unified", - "boxen": "^4.2.0", - "chalk": "^4.1.0", - "yamljs": "^0.3.0", - "yargs": "^16.1.1", -} +const deps = [ + 'boxen', + 'chalk', + 'yamljs', + 'yargs@16.1.1', + 'unified@https://github.com/mamund/alps-unified' +]; const project = new AwsCdkConstructLibrary({ authorAddress: "damadden88@googlemail.com", authorName: "Martin Mueller", - cdkVersion: "1.75.0", name: "cdk-alps-spec-rest-api", + defaultReleaseBranch: "main", + cdkVersion: "1.75.0", repository: "https://github.com/mmuller88/cdk-alps-spec-rest-api.git", - dependencies: { - ...alpsUnifiedDependencies, - "js-yaml": "^3.14.0", - "@types/js-yaml": "^3.12.5", - }, - devDependencies: {}, + deps: deps, + // peerDeps: deps, + bundledDeps: deps, cdkDependencies: [ '@aws-cdk/core', '@aws-cdk/aws-apigateway', diff --git a/API.md b/API.md index 6a89276..8cd025d 100644 --- a/API.md +++ b/API.md @@ -28,15 +28,25 @@ __Extends__: [Construct](#aws-cdk-core-construct) ```ts -new AlpsSpecRestApi(scope: Construct, id: string, props?: AlpsSpecRestApiProps) +new AlpsSpecRestApi(scope: Construct, id: string, props: AlpsSpecRestApiProps) ``` * **scope** ([Construct](#aws-cdk-core-construct)) *No description* * **id** (string) *No description* * **props** ([AlpsSpecRestApiProps](#cdk-alps-spec-rest-api-alpsspecrestapiprops)) *No description* + * **alpsSpecFile** (string) ALPS Spec File. + * **operationIdLambdaMapping** (Map) Optional mapping from openApi spec operationId to Lambda name. __*Optional*__ +### Properties + + +Name | Type | Description +-----|------|------------- +**operationIdLambdaMapping**? | Map | __*Optional*__ + + ## struct AlpsSpecRestApiProps @@ -44,3 +54,11 @@ new AlpsSpecRestApi(scope: Construct, id: string, props?: AlpsSpecRestApiProps) + +Name | Type | Description +-----|------|------------- +**alpsSpecFile** | string | ALPS Spec File. +**operationIdLambdaMapping**? | Map | Optional mapping from openApi spec operationId to Lambda name.
__*Optional*__ + + + diff --git a/package.json b/package.json index 1d2a639..e16bf0c 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "projen": "node .projenrc.js", "no-changes": "(git log --oneline -1 | grep -q \"chore(release):\") && echo \"No changes to release.\"", "bump": "yarn run --silent no-changes || standard-version", - "release": "yarn run --silent no-changes || (yarn run bump && git push --follow-tags origin master)", + "release": "yarn run --silent no-changes || (yarn run bump && git push --follow-tags origin main)", "test": "rm -fr lib/ && jest --passWithNoTests --updateSnapshot && yarn run eslint", "test:watch": "jest --watch", "test:update": "jest --updateSnapshot", @@ -47,7 +47,7 @@ "jsii-pacmak": "^1.14.1", "jsii-release": "^0.2.3", "json-schema": "^0.2.5", - "projen": "^0.3.178", + "projen": "^0.5.2", "standard-version": "^9.0.0", "ts-jest": "^26.4.4", "typescript": "^3.9.5" @@ -62,15 +62,19 @@ "@aws-cdk/aws-apigateway": "^1.75.0", "@aws-cdk/aws-iam": "^1.75.0", "@aws-cdk/core": "^1.75.0", - "@types/js-yaml": "^3.12.5", "boxen": "^4.2.0", "chalk": "^4.1.0", - "js-yaml": "^3.14.0", "unified": "https://github.com/mamund/alps-unified", "yamljs": "^0.3.0", - "yargs": "^16.1.1" + "yargs": "16.1.1" }, - "bundledDependencies": [], + "bundledDependencies": [ + "boxen", + "chalk", + "unified", + "yamljs", + "yargs" + ], "keywords": [ "cdk" ], @@ -92,7 +96,7 @@ "category": 2 }, "release": { - "desc": "Bumps version & push to master", + "desc": "Bumps version & push to main", "command": "yarn run release", "category": 2 }, diff --git a/test/__snapshots__/integ.snapshot.test.ts.snap b/test/__snapshots__/integ.snapshot.test.ts.snap index fd471cd..501891e 100644 --- a/test/__snapshots__/integ.snapshot.test.ts.snap +++ b/test/__snapshots__/integ.snapshot.test.ts.snap @@ -40,11 +40,11 @@ Object { "description": "todo item", "properties": Object { "body": Object { - "example": "01oqjycmwd3nkf13sies1x", + "example": "qa9skatpxclrm3l6iforcf", "type": "string", }, "id": Object { - "example": 8545, + "example": 4308, "type": "string", }, }, @@ -135,7 +135,7 @@ Object { }, }, }, - "description": "get todoList", + "description": "todoList", }, }, "summary": "return list of todo items", @@ -281,7 +281,7 @@ Object { }, "Type": "AWS::IAM::Role", }, - "AlpsSpecRestApiDeployment5AF0C3D4736c2d748d9384524fb958a8e240fad2": Object { + "AlpsSpecRestApiDeployment5AF0C3D455a285fea5d5be68da643c7d27723f9d": Object { "Properties": Object { "Description": "Automatically created by the RestApi construct", "RestApiId": Object { @@ -293,7 +293,7 @@ Object { "AlpsSpecRestApiDeploymentStageprod5A00266D": Object { "Properties": Object { "DeploymentId": Object { - "Ref": "AlpsSpecRestApiDeployment5AF0C3D4736c2d748d9384524fb958a8e240fad2", + "Ref": "AlpsSpecRestApiDeployment5AF0C3D455a285fea5d5be68da643c7d27723f9d", }, "RestApiId": Object { "Ref": "AlpsSpecRestApi18BF1E38", diff --git a/yarn.lock b/yarn.lock index 3360112..5346f51 100644 --- a/yarn.lock +++ b/yarn.lock @@ -906,11 +906,6 @@ jest-diff "^26.0.0" pretty-format "^26.0.0" -"@types/js-yaml@^3.12.5": - version "3.12.5" - resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.12.5.tgz#136d5e6a57a931e1cce6f9d8126aa98a9c92a6bb" - integrity sha512-JCcp6J0GV66Y4ZMDAQCXot4xprYB+Zfd3meK9+INSJeVZwJmHAW30BBEEkPzXswMXuiyReUGOP3GxrADc9wPww== - "@types/json-schema@^7.0.3": version "7.0.6" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0" @@ -3908,7 +3903,7 @@ js-tokens@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@^3.13.1, js-yaml@^3.14.0: +js-yaml@^3.13.1: version "3.14.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== @@ -5046,10 +5041,10 @@ progress@^2.0.0: resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== -projen@^0.3.178: - version "0.3.178" - resolved "https://registry.yarnpkg.com/projen/-/projen-0.3.178.tgz#9deca24b579c5b52b16ae6ad66b286e466012c43" - integrity sha512-e80c1KOu0cSrB14Zis6azdtTdDfbIp+Nf9Fi8nwk9yLGhzXC7WZroN+W29XRIafZfe0Rk8Cp4Z0ikZ0O4RM4bw== +projen@^0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/projen/-/projen-0.5.2.tgz#d717d75978ffecd7ef473b601e8a82af10920e6f" + integrity sha512-wCy/UcEQJHcOWENFENrQfSf4uEW2uDHzpsNeuylX1F3l8IilNgVUeX872XS6NTciz1+rN2wEdluW08PKwui7Hw== dependencies: "@iarna/toml" "^2.2.5" chalk "^4.1.0" @@ -6561,6 +6556,19 @@ yargs-parser@^18.1.2, yargs-parser@^18.1.3: camelcase "^5.0.0" decamelize "^1.2.0" +yargs@16.1.1, yargs@^16.0.3, yargs@^16.1.1: + version "16.1.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.1.1.tgz#5a4a095bd1ca806b0a50d0c03611d38034d219a1" + integrity sha512-hAD1RcFP/wfgfxgMVswPE+z3tlPFtxG8/yWUrG2i17sTWGCGqWnxKcLTF4cUKDUK8fzokwsmO9H0TDkRbMHy8w== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + yargs@^15.3.1, yargs@^15.4.1: version "15.4.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" @@ -6577,16 +6585,3 @@ yargs@^15.3.1, yargs@^15.4.1: which-module "^2.0.0" y18n "^4.0.0" yargs-parser "^18.1.2" - -yargs@^16.0.3, yargs@^16.1.1: - version "16.1.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.1.1.tgz#5a4a095bd1ca806b0a50d0c03611d38034d219a1" - integrity sha512-hAD1RcFP/wfgfxgMVswPE+z3tlPFtxG8/yWUrG2i17sTWGCGqWnxKcLTF4cUKDUK8fzokwsmO9H0TDkRbMHy8w== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2"