From 925f02c7c65fce9a779db3b5deb766cca6833fc0 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 10 Jan 2022 10:15:30 +0100 Subject: [PATCH 1/3] test --- .github/workflows/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflows/build.yml b/.github/workflows/workflows/build.yml index 257cb8f..dd35f41 100644 --- a/.github/workflows/workflows/build.yml +++ b/.github/workflows/workflows/build.yml @@ -1,7 +1,7 @@ name: build on: pull_request: {} - workflow_dispatch: + workflow_dispatch: {} jobs: build: runs-on: ubuntu-latest From a6b10f80634a1efb2f73b0a5ed54c398ded500da Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 10 Jan 2022 11:40:49 +0100 Subject: [PATCH 2/3] workflow does not work if it contains another folder --- .github/workflows/{workflows => }/build.yml | 0 .github/workflows/{workflows => }/pull-request-lint.yml | 0 .github/workflows/{workflows => }/release.yml | 0 .github/workflows/{workflows => }/stale.yml | 0 .github/workflows/{workflows => }/upgrade-main.yml | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{workflows => }/build.yml (100%) rename .github/workflows/{workflows => }/pull-request-lint.yml (100%) rename .github/workflows/{workflows => }/release.yml (100%) rename .github/workflows/{workflows => }/stale.yml (100%) rename .github/workflows/{workflows => }/upgrade-main.yml (100%) diff --git a/.github/workflows/workflows/build.yml b/.github/workflows/build.yml similarity index 100% rename from .github/workflows/workflows/build.yml rename to .github/workflows/build.yml diff --git a/.github/workflows/workflows/pull-request-lint.yml b/.github/workflows/pull-request-lint.yml similarity index 100% rename from .github/workflows/workflows/pull-request-lint.yml rename to .github/workflows/pull-request-lint.yml diff --git a/.github/workflows/workflows/release.yml b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/workflows/release.yml rename to .github/workflows/release.yml diff --git a/.github/workflows/workflows/stale.yml b/.github/workflows/stale.yml similarity index 100% rename from .github/workflows/workflows/stale.yml rename to .github/workflows/stale.yml diff --git a/.github/workflows/workflows/upgrade-main.yml b/.github/workflows/upgrade-main.yml similarity index 100% rename from .github/workflows/workflows/upgrade-main.yml rename to .github/workflows/upgrade-main.yml From e6da55d19e325e57996c0856c2613ce43ab2c8ca Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 10 Jan 2022 11:53:07 +0100 Subject: [PATCH 3/3] fix lock and jsii --- .jsii | 9 +++++---- .projen/tasks.json | 3 ++- package.json | 5 ++--- yarn.lock | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.jsii b/.jsii index 9b0cba3..ce12241 100644 --- a/.jsii +++ b/.jsii @@ -2854,7 +2854,7 @@ "stability": "stable" }, "homepage": "https://github.com/amelnyk/cdk-lambda-powertools-python-layer.git", - "jsiiVersion": "1.47.0 (build 86d2c33)", + "jsiiVersion": "1.52.0 (build d7c9e27)", "keywords": [ "aws", "cdk", @@ -2870,11 +2870,12 @@ "pacmak": { "hasDefaultInterfaces": true } - } + }, + "tscRootDir": "src" }, "name": "cdk-lambda-powertools-python-layer", "readme": { - "markdown": "# Lambda powertools python layer\n\n## Why this project exists\nThis is a custom construct that will create AWS Lambda Layer with AWS Powertools for Python library.\nThere are different ways how to create a layer and when working with CDK you need to install the library, create a zip file and wire it correctly.\nWith this construct you don't have to care about packaging and dependency management, just create a construct and add it to your function.\nThe construct is an extension of the existing [`LayerVersion`](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-lambda.LayerVersion.html) construct from the CDK library, so you have access to all fields and methods.\n\n```typescript\nimport { LambdaPowertoolsLayer } from 'cdk-lambda-powertools-python-layer';\n\nconst powertoolsLayer = new LambdaPowertoolsLayer(this, 'TestLayer');\n```\n\n## How to test\n\nThis module is not published yet, therefore you need to install few tools to test it.\nThis section will be deleted after the construct is released to a public repository.\n\n### Requirements\n\n* cdk v2\n* docker\n* npm or yarn, whatever you prefer\n\n### Build construct\n\nAfter you have checked out the repo:\n\n```shell\nnpm i\nnpm run build\n```\n\nThis will create a tgz file in `dist/js` directory. You can copy this file to your test project then install this module\nwith\n\n```shell\nnpm i file:PATH_TO_PACKAGE/cdk-lambda-powertools-python-layer@0.0.0.jsii.tgz\n```\n\n## Install\n\nTypeSript/JavaScript:\n\n```shell\nnpm i cdk-lambda-powertools-python-layer\n```\n\nPython:\n\n```shell\npip install cdk-lambda-powertools-python-layer\n```\n\n## Usage\n\nA single line will create a layer with powertools for python:\n\n```typescript\nimport { LambdaPowertoolsLayer } from 'cdk-lambda-powertools-python-layer';\n\nconst powertoolsLayer = new LambdaPowertoolsLayer(this, 'TestLayer', {\n version: '1.22.0',\n});\n```\n\nYou can then add the layer to your funciton:\n\n```typescript\nnew Function(this, 'LambdaFunction', {\n code: Code.fromAsset(path.join('./function')),\n handler: 'app.handler',\n runtime: Runtime.PYTHON_3_9,\n layers: [powertoolsLayer],\n});\n```\n\nYou can specify the powertools version by passing the optional `version` paramter, otherwise the construct will take the latest\nversion from pypi repository.\n\n```typescript\nnew LambdaPowertoolsLayer(this, 'PowertoolsLayer', {\n version: '1.21.0'\n});\n```\n\nAdditionally, powertools have extras depenedncies such as Pydantic, [documented here](https://awslabs.github.io/aws-lambda-powertools-python/latest/#lambda-layer).\nThis is not included by default, and you have to set this option in the construct definition if you need it:\n\n```typescript\nnew LambdaPowertoolsLayer(this, 'PowertoolsLayer', {\n includeExtras: true\n});\n```\n\nFull example:\n\n```typescript\nimport { Stack, StackProps } from 'aws-cdk-lib';\nimport { Construct } from 'constructs';\nimport { LambdaPowertoolsLayer } from 'cdk-lambda-powertools-python-layer';\nimport { Code, Function, Runtime } from 'aws-cdk-lib/aws-lambda';\nimport * as path from 'path';\n\nexport class CdkPowertoolsExampleStack extends Stack {\n constructor(scope: Construct, id: string, props?: StackProps) {\n super(scope, id, props);\n\n const powertoolsLayer = new LambdaPowertoolsLayer(this, 'TestLayer', {\n version: '1.22.0',\n includeExtras: true\n });\n\n new Function(this, 'LambdaFunction', {\n code: Code.fromAsset(path.join('./function')),\n handler: 'app.handler',\n runtime: Runtime.PYTHON_3_9,\n layers: [powertoolsLayer],\n });\n }\n}\n\n```\n" + "markdown": "# Lambda powertools python layer\n\n## Why this project exists\nThis is a custom construct that will create AWS Lambda Layer with AWS Powertools for Python library.\nThere are different ways how to create a layer and when working with CDK you need to install the library, create a zip file and wire it correctly.\nWith this construct you don't have to care about packaging and dependency management, just create a construct and add it to your function.\nThe construct is an extension of the existing [`LayerVersion`](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-lambda.LayerVersion.html) construct from the CDK library, so you have access to all fields and methods.\n\n```typescript\nimport { LambdaPowertoolsLayer } from 'cdk-lambda-powertools-python-layer';\n\nconst powertoolsLayer = new LambdaPowertoolsLayer(this, 'TestLayer');\n```\n\n\n## Install\n\nTypeSript/JavaScript:\n\n```shell\nnpm i cdk-lambda-powertools-python-layer\n```\n\nPython:\n\n```shell\npip install cdk-lambda-powertools-python-layer\n```\n\n## Usage\n\nA single line will create a layer with powertools for python:\n\n```typescript\nimport { LambdaPowertoolsLayer } from 'cdk-lambda-powertools-python-layer';\n\nconst powertoolsLayer = new LambdaPowertoolsLayer(this, 'TestLayer', {\n version: '1.22.0',\n});\n```\n\nYou can then add the layer to your funciton:\n\n```typescript\nnew Function(this, 'LambdaFunction', {\n code: Code.fromAsset(path.join('./function')),\n handler: 'app.handler',\n runtime: Runtime.PYTHON_3_9,\n layers: [powertoolsLayer],\n});\n```\n\nYou can specify the powertools version by passing the optional `version` paramter, otherwise the construct will take the latest\nversion from pypi repository.\n\n```typescript\nnew LambdaPowertoolsLayer(this, 'PowertoolsLayer', {\n version: '1.21.0'\n});\n```\n\nAdditionally, powertools have extras depenedncies such as Pydantic, [documented here](https://awslabs.github.io/aws-lambda-powertools-python/latest/#lambda-layer).\nThis is not included by default, and you have to set this option in the construct definition if you need it:\n\n```typescript\nnew LambdaPowertoolsLayer(this, 'PowertoolsLayer', {\n includeExtras: true\n});\n```\n\nFull example:\n\n```typescript\nimport { Stack, StackProps } from 'aws-cdk-lib';\nimport { Construct } from 'constructs';\nimport { LambdaPowertoolsLayer } from 'cdk-lambda-powertools-python-layer';\nimport { Code, Function, Runtime } from 'aws-cdk-lib/aws-lambda';\nimport * as path from 'path';\n\nexport class CdkPowertoolsExampleStack extends Stack {\n constructor(scope: Construct, id: string, props?: StackProps) {\n super(scope, id, props);\n\n const powertoolsLayer = new LambdaPowertoolsLayer(this, 'TestLayer', {\n version: '1.22.0',\n includeExtras: true\n });\n\n new Function(this, 'LambdaFunction', {\n code: Code.fromAsset(path.join('./function')),\n handler: 'app.handler',\n runtime: Runtime.PYTHON_3_9,\n layers: [powertoolsLayer],\n });\n }\n}\n\n```\n" }, "repository": { "type": "git", @@ -3028,5 +3029,5 @@ } }, "version": "0.0.0", - "fingerprint": "d0Vv2mqbhdMR/bcmrWttHIiURebjXsLVUdEv5TudkjE=" + "fingerprint": "yi+OPgpzqxFOD5bLwt3fMMOHfi2Rs2/uE1SPJT3c56Y=" } diff --git a/.projen/tasks.json b/.projen/tasks.json index 65b73b3..b95cd9a 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -143,7 +143,8 @@ "name": "release", "description": "Prepare a release from \"main\" branch", "env": { - "RELEASE": "true" + "RELEASE": "true", + "MAJOR": "0" }, "steps": [ { diff --git a/package.json b/package.json index ae257a6..fbd0728 100644 --- a/package.json +++ b/package.json @@ -39,10 +39,10 @@ "@typescript-eslint/parser": "^5", "aws-cdk-lib": "2.2.0", "constructs": "10.0.5", + "eslint": "^8", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^2.5.0", "eslint-plugin-import": "^2.25.4", - "eslint": "^8", "jest": "^27.4.7", "jest-junit": "^13", "jsii": "^1.52.0", @@ -60,7 +60,6 @@ "aws-cdk-lib": "^2.2.0", "constructs": "^10.0.5" }, - "dependencies": {}, "bundledDependencies": [], "keywords": [ "aws", @@ -133,4 +132,4 @@ "announce": false }, "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 91ae31d..ea8c21b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -743,7 +743,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@*": +"@types/jest@^27.4.0": version "27.4.0" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.4.0.tgz#037ab8b872067cae842a320841693080f9cb84ed" integrity sha512-gHl8XuC1RZ8H2j5sHv/JqsaxXkDDM9iDOgu0Wp8sjs4u/snb2PVehyWXJPr+ORA0RPpgw231mnutWI1+0hgjIQ==