From 844633f38c1f33712f253f1f785340044143935f Mon Sep 17 00:00:00 2001 From: Michael Brewer Date: Wed, 5 Jan 2022 11:18:36 -0800 Subject: [PATCH 1/5] fix(build): Update contributing.md and fix npm ci Changes: - Update CONTRIBUTING.md to use > aws-lambda-powertools-typescript@0.0.1 preinstall > (cd packages/commons && npm ci); (cd packages/logger && npm ci); (cd packages/metrics && npm ci); (cd packages/tracing && npm ci); > @aws-lambda-powertools/commons@0.2.0 prepare > npm run build > @aws-lambda-powertools/commons@0.2.0 build > tsc added 586 packages, and audited 587 packages in 4s 84 packages are looking for funding run `npm fund` for details found 0 vulnerabilities > @aws-lambda-powertools/logger@0.2.0 prepare > npm run build > @aws-lambda-powertools/logger@0.2.0 build > tsc added 488 packages, and audited 489 packages in 4s 72 packages are looking for funding run `npm fund` for details found 0 vulnerabilities > @aws-lambda-powertools/metrics@0.2.0 prepare > npm run build > @aws-lambda-powertools/metrics@0.2.0 build > tsc added 822 packages, and audited 852 packages in 10s 91 packages are looking for funding run `npm fund` for details found 0 vulnerabilities > @aws-lambda-powertools/tracer@0.2.0 prepare > npm run build > @aws-lambda-powertools/tracer@0.2.0 build > tsc added 836 packages, and audited 859 packages in 8s 72 packages are looking for funding run `npm fund` for details found 0 vulnerabilities added 1327 packages, removed 2761 packages, changed 10 packages, and audited 1383 packages in 40s 100 packages are looking for funding run `npm fund` for details found 0 vulnerabilities - Add a preinstall task to install all of the sub packages closes #415 --- CONTRIBUTING.md | 10 ++++++---- package.json | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 11d5f69a9..c13607c3d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,6 +7,7 @@ Please read through this document before submitting any issues or pull requests information to effectively respond to your bug report or contribution. ## Security issue notifications + If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public GitHub issue. ## Reporting Bugs/Feature Requests @@ -35,7 +36,7 @@ Contributions via pull requests are much appreciated. Before sending us a pull r To send us a pull request, please follow these steps: 1. Fork the repository. -2. Install dependencies: `npm install` +2. Install dependencies: `npm ci` 3. Prepare utilities like commit hooks: `npm run init-environment` 4. Create a new branch to focus on the specific change you are contributing e.g. `git checkout -b improv/logger-debug-sampling` 5. Run all tests, and code baseline checks: `npm run test` @@ -54,8 +55,9 @@ You might find useful to run both the documentation website and the API referenc * **Docs website**: You can build and start a local docs website by running these two commands. - - `npm run docs-buildDockerImage` OR `docker build -t squidfunk/mkdocs-material ./docs/` - - `npm run docs-runLocalDocker` OR `docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material` + +* `npm run docs-buildDockerImage` OR `docker build -t squidfunk/mkdocs-material ./docs/` +* `npm run docs-runLocalDocker` OR `docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material` ### Conventions @@ -89,4 +91,4 @@ TODO See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution. -We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes. \ No newline at end of file +We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes. diff --git a/package.json b/package.json index 5ee2d76dd..876895300 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "docs-buildDockerImage": "docker build -t powertool-typescript/docs ./docs/", "docs-runLocalDocker": "docker run --rm -it -p 8000:8000 -v ${PWD}:/docs powertool-typescript/docs", "docs-generateApiDoc": "typedoc .", - "docs-runLocalApiDoc": "npx live-server api" + "docs-runLocalApiDoc": "npx live-server api", + "preinstall": "(cd packages/commons && npm ci); (cd packages/logger && npm ci); (cd packages/metrics && npm ci); (cd packages/tracing && npm ci);" }, "repository": { "type": "git", From 06452c364449246086d6d943fabd673bdf7e2129 Mon Sep 17 00:00:00 2001 From: Michael Brewer Date: Wed, 5 Jan 2022 14:08:04 -0800 Subject: [PATCH 2/5] fix(build): Update contributing.md and fix npm ci Changes: - Update CONTRIBUTING.md to use npm ci - Add a preinstall task to install all of the sub packages closes #415 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 876895300..f261a11a9 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "packages/*" ], "scripts": { + "preinstall": "(cd packages/commons && npm ci); (cd packages/logger && npm ci); (cd packages/metrics && npm ci); (cd packages/tracing && npm ci);", "init-environment": "husky install", "test": "npm run lerna-test", "commit": "commit", @@ -26,8 +27,7 @@ "docs-buildDockerImage": "docker build -t powertool-typescript/docs ./docs/", "docs-runLocalDocker": "docker run --rm -it -p 8000:8000 -v ${PWD}:/docs powertool-typescript/docs", "docs-generateApiDoc": "typedoc .", - "docs-runLocalApiDoc": "npx live-server api", - "preinstall": "(cd packages/commons && npm ci); (cd packages/logger && npm ci); (cd packages/metrics && npm ci); (cd packages/tracing && npm ci);" + "docs-runLocalApiDoc": "npx live-server api" }, "repository": { "type": "git", From e3b7f19f27b4071f88668ced7c2856b5ad0e1de0 Mon Sep 17 00:00:00 2001 From: Michael Brewer Date: Thu, 6 Jan 2022 04:01:42 -0800 Subject: [PATCH 3/5] chore: leave as npm install for now --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c13607c3d..04f0796e8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,7 +36,7 @@ Contributions via pull requests are much appreciated. Before sending us a pull r To send us a pull request, please follow these steps: 1. Fork the repository. -2. Install dependencies: `npm ci` +2. Install dependencies: `npm install` 3. Prepare utilities like commit hooks: `npm run init-environment` 4. Create a new branch to focus on the specific change you are contributing e.g. `git checkout -b improv/logger-debug-sampling` 5. Run all tests, and code baseline checks: `npm run test` From 9f7c8f9cac6f7a183ae4330bd544b5535fb68f7b Mon Sep 17 00:00:00 2001 From: Michael Brewer Date: Thu, 6 Jan 2022 21:09:04 -0800 Subject: [PATCH 4/5] fix(all): setup up project references --- package.json | 1 - packages/commons/tsconfig.json | 1 + packages/logger/tsconfig.json | 5 +++++ packages/metrics/tsconfig.json | 5 +++++ packages/tracing/tsconfig.json | 5 +++++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f261a11a9..5ee2d76dd 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "packages/*" ], "scripts": { - "preinstall": "(cd packages/commons && npm ci); (cd packages/logger && npm ci); (cd packages/metrics && npm ci); (cd packages/tracing && npm ci);", "init-environment": "husky install", "test": "npm run lerna-test", "commit": "commit", diff --git a/packages/commons/tsconfig.json b/packages/commons/tsconfig.json index cbd9922f3..460e4ec93 100644 --- a/packages/commons/tsconfig.json +++ b/packages/commons/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "composite": true, "experimentalDecorators": true, "noImplicitAny": true, "target": "ES2020", diff --git a/packages/logger/tsconfig.json b/packages/logger/tsconfig.json index 20da6e39a..8c88af047 100644 --- a/packages/logger/tsconfig.json +++ b/packages/logger/tsconfig.json @@ -26,5 +26,10 @@ "types": [ "jest", "node" + ], + "references": [ + { + "path": "../commons" + } ] } \ No newline at end of file diff --git a/packages/metrics/tsconfig.json b/packages/metrics/tsconfig.json index 582618277..de7412a5c 100644 --- a/packages/metrics/tsconfig.json +++ b/packages/metrics/tsconfig.json @@ -28,5 +28,10 @@ "types": [ "jest", "node" + ], + "references": [ + { + "path": "../commons" + } ] } \ No newline at end of file diff --git a/packages/tracing/tsconfig.json b/packages/tracing/tsconfig.json index 8b93f8c29..723ebdaf7 100644 --- a/packages/tracing/tsconfig.json +++ b/packages/tracing/tsconfig.json @@ -28,5 +28,10 @@ "types": [ "jest", "node" + ], + "references": [ + { + "path": "../commons" + } ] } \ No newline at end of file From e5557b5d78d21d8f726885f30b9bb2380c6c9423 Mon Sep 17 00:00:00 2001 From: Michael Brewer Date: Thu, 6 Jan 2022 21:10:40 -0800 Subject: [PATCH 5/5] docs: update to use npm ci --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 04f0796e8..c13607c3d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,7 +36,7 @@ Contributions via pull requests are much appreciated. Before sending us a pull r To send us a pull request, please follow these steps: 1. Fork the repository. -2. Install dependencies: `npm install` +2. Install dependencies: `npm ci` 3. Prepare utilities like commit hooks: `npm run init-environment` 4. Create a new branch to focus on the specific change you are contributing e.g. `git checkout -b improv/logger-debug-sampling` 5. Run all tests, and code baseline checks: `npm run test`