From f8436ae9c730278db5f97345cf487ea5209a8d5c Mon Sep 17 00:00:00 2001 From: Luciano Mammino Date: Wed, 23 May 2018 21:47:05 +0100 Subject: [PATCH] Renamed cors package to http-cors (#181) --- README.md | 2 +- lerna.json | 2 +- package-lock.json | 2 +- package.json | 2 +- packages/cache/package.json | 2 +- packages/core/package.json | 2 +- packages/do-not-wait-for-empty-event-loop/package.json | 2 +- packages/http-content-negotiation/package.json | 2 +- packages/{cors => http-cors}/README.md | 8 ++++---- packages/{cors => http-cors}/__tests__/index.js | 0 packages/{cors => http-cors}/index.d.ts | 0 packages/{cors => http-cors}/index.js | 0 packages/{cors => http-cors}/package.json | 4 ++-- packages/{cors => http-cors}/tsconfig.json | 0 packages/http-error-handler/package.json | 2 +- packages/http-event-normalizer/package.json | 2 +- packages/http-header-normalizer/package.json | 2 +- packages/http-json-body-parser/package.json | 2 +- packages/http-partial-response/package.json | 2 +- packages/http-urlencode-body-parser/package.json | 2 +- packages/s3-key-normalizer/package.json | 2 +- packages/ssm/package.json | 2 +- packages/validator/package.json | 2 +- packages/warmup/package.json | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) rename packages/{cors => http-cors}/README.md (89%) rename packages/{cors => http-cors}/__tests__/index.js (100%) rename packages/{cors => http-cors}/index.d.ts (100%) rename packages/{cors => http-cors}/index.js (100%) rename packages/{cors => http-cors}/package.json (94%) rename packages/{cors => http-cors}/tsconfig.json (100%) diff --git a/README.md b/README.md index 676d85ecb..5c74b6d40 100644 --- a/README.md +++ b/README.md @@ -486,9 +486,9 @@ on how to write a middleware. Currently available middlewares: - [`cache`](/packages/cache): A simple but flexible caching layer - - [`cors`](/packages/cors): Sets CORS headers on response - [`do-not-wait-for-empty-event-loop`](/packages/do-not-wait-for-empty-event-loop): Sets callbackWaitsForEmptyEventLoop property to false - [`http-content-negotiation`](/packages/http-content-negotiation): Parses `Accept-*` headers and provides utilities for content negotiation (charset, encoding, language and media type) for HTTP requests + - [`http-cors`](/packages/http-cors): Sets HTTP CORS headers on response - [`http-error-handler`](/packages/http-error-handler): Creates a proper HTTP response for errors that are created with the [http-errors](https://www.npmjs.com/package/http-errors) module and represents proper HTTP errors. - [`http-event-normalizer`](/packages/http-event-normalizer): Normalizes HTTP events by adding an empty object for `queryStringParameters` and `pathParameters` if they are missing. - [`http-header-normalizer`](/packages/http-header-normalizer): Normalizes HTTP header names to their canonical format diff --git a/lerna.json b/lerna.json index d84685e44..2576fb834 100644 --- a/lerna.json +++ b/lerna.json @@ -3,5 +3,5 @@ "packages": [ "packages/*" ], - "version": "1.0.0-alpha.5" + "version": "1.0.0-alpha.6" } diff --git a/package-lock.json b/package-lock.json index ff736a1a7..44e6b5335 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "middy-monorepo", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 386f47a4e..71aadf7c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "middy-monorepo", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "🛵 The stylish Node.js middleware engine for AWS Lambda", "engines": { "node": ">=6.10" diff --git a/packages/cache/package.json b/packages/cache/package.json index b17513c60..c3db74829 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@middy/cache", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "Cache middleware for the middy framework", "engines": { "node": ">=6.10" diff --git a/packages/core/package.json b/packages/core/package.json index dfb74e355..6bd4c3b12 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@middy/core", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "🛵 The stylish Node.js middleware engine for AWS Lambda (core package)", "engines": { "node": ">=6.10" diff --git a/packages/do-not-wait-for-empty-event-loop/package.json b/packages/do-not-wait-for-empty-event-loop/package.json index 59bcfd4fd..17f968e20 100644 --- a/packages/do-not-wait-for-empty-event-loop/package.json +++ b/packages/do-not-wait-for-empty-event-loop/package.json @@ -1,6 +1,6 @@ { "name": "@middy/do-not-wait-for-empty-event-loop", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "Middleware for the middy framework that allows to easily disable the wait for empty event loop in a Lambda function", "engines": { "node": ">=6.10" diff --git a/packages/http-content-negotiation/package.json b/packages/http-content-negotiation/package.json index 986620b1b..a755bcaee 100644 --- a/packages/http-content-negotiation/package.json +++ b/packages/http-content-negotiation/package.json @@ -1,6 +1,6 @@ { "name": "@middy/http-content-negotiation", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "Http content negotiation middleware for the middy framework", "engines": { "node": ">=6.10" diff --git a/packages/cors/README.md b/packages/http-cors/README.md similarity index 89% rename from packages/cors/README.md rename to packages/http-cors/README.md index fa33ea2c4..7f79d94c3 100644 --- a/packages/cors/README.md +++ b/packages/http-cors/README.md @@ -28,7 +28,7 @@

-This middleware sets CORS headers (`Access-Control-Allow-Origin`, `Access-Control-Allow-Headers`, `Access-Control-Allow-Credentials`), necessary for making cross-origin requests, to the response object. +This middleware sets HTTP CORS headers (`Access-Control-Allow-Origin`, `Access-Control-Allow-Headers`, `Access-Control-Allow-Credentials`), necessary for making cross-origin requests, to the response object. Sets headers in `after` and `onError` phases. @@ -38,7 +38,7 @@ Sets headers in `after` and `onError` phases. To install this middleware you can use NPM: ```bash -npm install --save @middy/cors +npm install --save @middy/http-cors ``` @@ -52,8 +52,8 @@ npm install --save @middy/cors ## Sample usage ```javascript -const middy = require('middy') -const { cors } = require('middy/middlewares') +const middy = require('@middy/core') +const { cors } = require('@middy/http-cors') const handler = middy((event, context, cb) => { cb(null, {}) diff --git a/packages/cors/__tests__/index.js b/packages/http-cors/__tests__/index.js similarity index 100% rename from packages/cors/__tests__/index.js rename to packages/http-cors/__tests__/index.js diff --git a/packages/cors/index.d.ts b/packages/http-cors/index.d.ts similarity index 100% rename from packages/cors/index.d.ts rename to packages/http-cors/index.d.ts diff --git a/packages/cors/index.js b/packages/http-cors/index.js similarity index 100% rename from packages/cors/index.js rename to packages/http-cors/index.js diff --git a/packages/cors/package.json b/packages/http-cors/package.json similarity index 94% rename from packages/cors/package.json rename to packages/http-cors/package.json index 6992a3838..be6224df6 100644 --- a/packages/cors/package.json +++ b/packages/http-cors/package.json @@ -1,6 +1,6 @@ { - "name": "@middy/cors", - "version": "1.0.0-alpha.5", + "name": "@middy/http-cors", + "version": "1.0.0-alpha.6", "description": "CORS (Cross-Origin Resource Sharing) middleware for the middy framework", "engines": { "node": ">=6.10" diff --git a/packages/cors/tsconfig.json b/packages/http-cors/tsconfig.json similarity index 100% rename from packages/cors/tsconfig.json rename to packages/http-cors/tsconfig.json diff --git a/packages/http-error-handler/package.json b/packages/http-error-handler/package.json index ceb58a0ba..69e5a5d1c 100644 --- a/packages/http-error-handler/package.json +++ b/packages/http-error-handler/package.json @@ -1,6 +1,6 @@ { "name": "@middy/http-error-handler", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "Http error handler middleware for the middy framework", "engines": { "node": ">=6.10" diff --git a/packages/http-event-normalizer/package.json b/packages/http-event-normalizer/package.json index 22b98edc5..3c2c42bdb 100644 --- a/packages/http-event-normalizer/package.json +++ b/packages/http-event-normalizer/package.json @@ -1,6 +1,6 @@ { "name": "@middy/http-event-normalizer", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "Http event normalizer middleware for the middy framework", "engines": { "node": ">=6.10" diff --git a/packages/http-header-normalizer/package.json b/packages/http-header-normalizer/package.json index 2356ded20..563e32592 100644 --- a/packages/http-header-normalizer/package.json +++ b/packages/http-header-normalizer/package.json @@ -1,6 +1,6 @@ { "name": "@middy/http-header-normalizer", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "Http header normalizer middleware for the middy framework", "engines": { "node": ">=6.10" diff --git a/packages/http-json-body-parser/package.json b/packages/http-json-body-parser/package.json index 7c03e472a..ca75645e3 100644 --- a/packages/http-json-body-parser/package.json +++ b/packages/http-json-body-parser/package.json @@ -1,6 +1,6 @@ { "name": "@middy/http-json-body-parser", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "Http JSON body parser middleware for the middy framework", "engines": { "node": ">=6.10" diff --git a/packages/http-partial-response/package.json b/packages/http-partial-response/package.json index 86265cfb5..683f1a862 100644 --- a/packages/http-partial-response/package.json +++ b/packages/http-partial-response/package.json @@ -1,6 +1,6 @@ { "name": "@middy/http-partial-response", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "Http partial response middleware for the middy framework", "engines": { "node": ">=6.10" diff --git a/packages/http-urlencode-body-parser/package.json b/packages/http-urlencode-body-parser/package.json index 9c9c97583..bb47f51a0 100644 --- a/packages/http-urlencode-body-parser/package.json +++ b/packages/http-urlencode-body-parser/package.json @@ -1,6 +1,6 @@ { "name": "@middy/http-urlencode-body-parser", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "Urlencode body parser middleware for the middy framework", "engines": { "node": ">=6.10" diff --git a/packages/s3-key-normalizer/package.json b/packages/s3-key-normalizer/package.json index a2cb37ae3..f2fae291a 100644 --- a/packages/s3-key-normalizer/package.json +++ b/packages/s3-key-normalizer/package.json @@ -1,6 +1,6 @@ { "name": "@middy/s3-key-normalizer", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "S3 key normalizer middleware for the middy framework", "engines": { "node": ">=6.10" diff --git a/packages/ssm/package.json b/packages/ssm/package.json index ff9826e29..b2edac13d 100644 --- a/packages/ssm/package.json +++ b/packages/ssm/package.json @@ -1,6 +1,6 @@ { "name": "@middy/ssm", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "SSM (EC2 Systems Manager) parameters middleware for the middy framework", "engines": { "node": ">=6.10" diff --git a/packages/validator/package.json b/packages/validator/package.json index 1c5345dd2..1eec4a2e0 100644 --- a/packages/validator/package.json +++ b/packages/validator/package.json @@ -1,6 +1,6 @@ { "name": "@middy/validator", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "Validator middleware for the middy framework", "engines": { "node": ">=6.10" diff --git a/packages/warmup/package.json b/packages/warmup/package.json index 5a5498aeb..ff3ec1406 100644 --- a/packages/warmup/package.json +++ b/packages/warmup/package.json @@ -1,6 +1,6 @@ { "name": "@middy/warmup", - "version": "1.0.0-alpha.5", + "version": "1.0.0-alpha.6", "description": "Warmup (cold start mitigation) middleware for the middy framework", "engines": { "node": ">=6.10"