From 642fcbdfd1cf097dc5bd073df08de052dbeea9ef Mon Sep 17 00:00:00 2001 From: John Denver Date: Sat, 24 Sep 2022 20:15:28 +0800 Subject: [PATCH 1/2] feat: remove custom registration decorators and reduce base dependencies --- package-lock.json | 51 ++++++++++++++++++++++++++++++----------------- package.json | 3 ++- src/decorator.ts | 2 +- src/index.ts | 3 ++- src/module.ts | 10 +++++----- src/provider.ts | 8 ++++---- src/struct.ts | 2 +- 7 files changed, 48 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0409327..4f0b7e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,9 @@ "version": "8.1.4", "license": "MIT", "dependencies": { + "@nestjs/common": "^8.4.7", "@nestjs/swagger": "5.2.1", - "@vodyani/core": "^8.7.1", + "@vodyani/core": "^8.8.0", "@vodyani/utils": "^8.5.2" }, "devDependencies": { @@ -1353,6 +1354,7 @@ "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-8.4.7.tgz", "integrity": "sha512-XB9uexHqzr2xkPo6QSiQWJJttyYYLmvQ5My64cFvWFi7Wk2NIus0/xUNInwX3kmFWB6pF1ab5Y2ZBvWdPwGBhw==", "hasInstallScript": true, + "peer": true, "dependencies": { "@nuxtjs/opencollective": "0.3.2", "fast-safe-stringify": "2.1.1", @@ -1518,6 +1520,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", "integrity": "sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA==", + "peer": true, "dependencies": { "chalk": "^4.1.0", "consola": "^2.15.0", @@ -2019,12 +2022,11 @@ } }, "node_modules/@vodyani/core": { - "version": "8.7.1", - "resolved": "https://registry.npmjs.org/@vodyani/core/-/core-8.7.1.tgz", - "integrity": "sha512-zHQxkaywxzZW22/04SEl7Av4M1L35+ypVKA9vvW/2tCtVdyhnUqjWA1jE7n26TEfuCRUv8jFAF9Yr5kX2m7yJA==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@vodyani/core/-/core-8.8.0.tgz", + "integrity": "sha512-335IUYeBruwr3ceqFO/xABJ1Roo3Bn4dCzrPsAlewBQeK4MX5RJRLt7txOmQxx6wxxJtOYEqptV0BegCDlskAg==", "dependencies": { - "@nestjs/common": "8.4.7", - "@nestjs/core": "8.4.7" + "@nestjs/common": "8.4.7" } }, "node_modules/@vodyani/eslint-config": { @@ -2788,7 +2790,8 @@ "node_modules/consola": { "version": "2.15.3", "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", - "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==" + "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", + "peer": true }, "node_modules/content-disposition": { "version": "0.5.4", @@ -6273,6 +6276,7 @@ "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "peer": true, "dependencies": { "whatwg-url": "^5.0.0" }, @@ -6291,17 +6295,20 @@ "node_modules/node-fetch/node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", + "peer": true }, "node_modules/node-fetch/node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", + "peer": true }, "node_modules/node-fetch/node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "peer": true, "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -6375,6 +6382,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "peer": true, "engines": { "node": ">= 6" } @@ -9456,6 +9464,7 @@ "version": "8.4.7", "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-8.4.7.tgz", "integrity": "sha512-XB9uexHqzr2xkPo6QSiQWJJttyYYLmvQ5My64cFvWFi7Wk2NIus0/xUNInwX3kmFWB6pF1ab5Y2ZBvWdPwGBhw==", + "peer": true, "requires": { "@nuxtjs/opencollective": "0.3.2", "fast-safe-stringify": "2.1.1", @@ -9535,6 +9544,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", "integrity": "sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA==", + "peer": true, "requires": { "chalk": "^4.1.0", "consola": "^2.15.0", @@ -9937,12 +9947,11 @@ } }, "@vodyani/core": { - "version": "8.7.1", - "resolved": "https://registry.npmjs.org/@vodyani/core/-/core-8.7.1.tgz", - "integrity": "sha512-zHQxkaywxzZW22/04SEl7Av4M1L35+ypVKA9vvW/2tCtVdyhnUqjWA1jE7n26TEfuCRUv8jFAF9Yr5kX2m7yJA==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/@vodyani/core/-/core-8.8.0.tgz", + "integrity": "sha512-335IUYeBruwr3ceqFO/xABJ1Roo3Bn4dCzrPsAlewBQeK4MX5RJRLt7txOmQxx6wxxJtOYEqptV0BegCDlskAg==", "requires": { - "@nestjs/common": "8.4.7", - "@nestjs/core": "8.4.7" + "@nestjs/common": "8.4.7" } }, "@vodyani/eslint-config": { @@ -10549,7 +10558,8 @@ "consola": { "version": "2.15.3", "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", - "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==" + "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", + "peer": true }, "content-disposition": { "version": "0.5.4", @@ -13173,6 +13183,7 @@ "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "peer": true, "requires": { "whatwg-url": "^5.0.0" }, @@ -13180,17 +13191,20 @@ "tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", + "peer": true }, "webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", + "peer": true }, "whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "peer": true, "requires": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -13253,7 +13267,8 @@ "object-hash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", - "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==" + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "peer": true }, "object-inspect": { "version": "1.12.2", diff --git a/package.json b/package.json index 4a7fa4b..8f47fa7 100644 --- a/package.json +++ b/package.json @@ -63,8 +63,9 @@ ] }, "dependencies": { + "@nestjs/common": "^8.4.7", "@nestjs/swagger": "5.2.1", - "@vodyani/core": "^8.7.1", + "@vodyani/core": "^8.8.0", "@vodyani/utils": "^8.5.2" }, "peerDependencies": { diff --git a/src/decorator.ts b/src/decorator.ts index 6f378b7..71789a5 100644 --- a/src/decorator.ts +++ b/src/decorator.ts @@ -1,4 +1,4 @@ -import { Type, applyDecorators } from '@vodyani/core'; +import { Type, applyDecorators } from '@nestjs/common'; import { ApiBody, ApiConsumes, ApiOkResponse, getSchemaPath } from '@nestjs/swagger'; import { ExtraModelStore } from './struct'; diff --git a/src/index.ts b/src/index.ts index 8aa4435..2329b3c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,7 @@ export * from '@nestjs/swagger'; +export { SwaggerModule } from './module'; + export * from './decorator'; -export * from './module'; export * from './provider'; export * from './struct'; diff --git a/src/module.ts b/src/module.ts index 488e79d..52b875e 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1,10 +1,10 @@ -import { Infrastructure } from '@vodyani/core'; +import { Module } from '@nestjs/common'; import { SwaggerProvider } from './provider'; -@Infrastructure({ - provider: [SwaggerProvider], - export: [SwaggerProvider], +@Module({ + providers: [SwaggerProvider], + exports: [SwaggerProvider], }) -export class SwaggerInfrastructure {} +export class SwaggerModule {} diff --git a/src/provider.ts b/src/provider.ts index 70957dc..9bcfb10 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -1,5 +1,5 @@ -import { Injectable, INestApplication } from '@vodyani/core'; -import { SwaggerDocumentOptions, SwaggerModule, OpenAPIObject, DocumentBuilder } from '@nestjs/swagger'; +import { Injectable, INestApplication } from '@nestjs/common'; +import { SwaggerDocumentOptions, SwaggerModule as Swagger, OpenAPIObject, DocumentBuilder } from '@nestjs/swagger'; import { ExtraModelStore } from './struct'; @@ -15,12 +15,12 @@ export class SwaggerProvider { config: Omit, options?: SwaggerDocumentOptions, ) { - const document = SwaggerModule.createDocument( + const document = Swagger.createDocument( application, config, { extraModels: ExtraModelStore.get(), ...options }, ); - SwaggerModule.setup(path, application, document); + Swagger.setup(path, application, document); } } diff --git a/src/struct.ts b/src/struct.ts index 226b363..720ef39 100644 --- a/src/struct.ts +++ b/src/struct.ts @@ -1,4 +1,4 @@ -import { Type } from '@vodyani/core'; +import { Type } from '@nestjs/common'; export class ExtraModelStore { private static readonly store: Map = new Map(); From 8ca158be5238164d907692da5cc0ef82c31bd652 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sat, 24 Sep 2022 12:21:52 +0000 Subject: [PATCH 2/2] =?UTF-8?q?chore(=F0=9F=A4=96):=208.2.0-beta.1=20[skip?= =?UTF-8?q?=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # [8.2.0-beta.1](https://github.com/vodyani/swagger/compare/v8.1.4...v8.2.0-beta.1) (2022-09-24) ### Features * remove custom registration decorators and reduce base dependencies ([642fcbd](https://github.com/vodyani/swagger/commit/642fcbdfd1cf097dc5bd073df08de052dbeea9ef)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec57c02..b493c5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [8.2.0-beta.1](https://github.com/vodyani/swagger/compare/v8.1.4...v8.2.0-beta.1) (2022-09-24) + + +### Features + +* remove custom registration decorators and reduce base dependencies ([642fcbd](https://github.com/vodyani/swagger/commit/642fcbdfd1cf097dc5bd073df08de052dbeea9ef)) + ## [8.1.4](https://github.com/vodyani/swagger/compare/v8.1.3...v8.1.4) (2022-09-07) diff --git a/package-lock.json b/package-lock.json index 4f0b7e1..47e35c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@vodyani/swagger", - "version": "8.1.4", + "version": "8.2.0-beta.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@vodyani/swagger", - "version": "8.1.4", + "version": "8.2.0-beta.1", "license": "MIT", "dependencies": { "@nestjs/common": "^8.4.7", diff --git a/package.json b/package.json index 8f47fa7..292616c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@vodyani/swagger", "license": "MIT", - "version": "8.1.4", + "version": "8.2.0-beta.1", "author": "ChoGathK", "description": "swagger", "homepage": "https://github.com/vodyani/swagger#readme",