nestjs-console
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -7,2 +7,10 @@ # Changelog | ||
## [1.2.1] - 2020-01-03 | ||
### Fixed | ||
- Fix a type error during the bootstrap scan for decorators [#61](https://github.com/Pop-Code/nestjs-console/pull/61) | ||
- Remove implicit lodash dependency [#59](https://github.com/Pop-Code/nestjs-console/issues/59) | ||
- Update to support commander@^4 [#58](https://github.com/Pop-Code/nestjs-console/issues/58) | ||
## [1.2.0] - 2019-08-09 | ||
@@ -12,3 +20,3 @@ | ||
- Move commander as Peer Dependencies | ||
- Move commander as Peer Dependency | ||
- Update to support commander@^3.0.0 | ||
@@ -81,5 +89,6 @@ | ||
[unreleased]: https://github.com/Pop-Code/nestjs-console/compare/v1.2.0...HEAD | ||
[1.1.4]: https://github.com/Pop-Code/nestjs-console/compare/v1.0.3...v1.1.4 | ||
[1.0.3]: https://github.com/Pop-Code/nestjs-console/compare/v1.0.2...v1.0.3 | ||
[unreleased]: https://github.com/Pop-Code/nestjs-console/compare/v1.2.1...HEAD | ||
[1.2.1]: https://github.com/Pop-Code/nestjs-console/compare/v1.2.0...v1.2.1 | ||
[1.2.0]: https://github.com/Pop-Code/nestjs-console/compare/v1.1.4...v1.2.0 | ||
[1.1.4]: https://github.com/Pop-Code/nestjs-console/compare/v1.0.2...v1.1.4 | ||
[1.0.2]: https://github.com/Pop-Code/nestjs-console/compare/v1.0.1...v1.0.2 | ||
@@ -86,0 +95,0 @@ [1.0.1]: https://github.com/Pop-Code/nestjs-console/compare/v1.0.0...v1.0.1 |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -24,3 +25,3 @@ }); | ||
const appModule = app.get(module_1.ConsoleModule); | ||
appModule.scan(app, options.module); | ||
appModule.scan(app, [options.module]); | ||
return { | ||
@@ -27,0 +28,0 @@ app, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const lodash_1 = require("lodash"); | ||
const constants_1 = require("./constants"); | ||
class ConsoleScanner { | ||
getModules(modulesContainer, include) { | ||
getModules(modulesContainer, includes) { | ||
const allModules = [...modulesContainer.values()]; | ||
if (!include || lodash_1.isEmpty(include)) { | ||
if (!includes || !Array.isArray(includes)) { | ||
return allModules; | ||
} | ||
return allModules.filter(({ metatype }) => include.some(item => item === metatype)); | ||
return allModules.filter(({ metatype }) => includes.some(item => item === metatype)); | ||
} | ||
@@ -13,0 +12,0 @@ getInstanceMethods(instance) { |
{ | ||
"name": "nestjs-console", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "A NestJS module that provide a cli", | ||
@@ -20,3 +20,3 @@ "keywords": [ | ||
"@nestjs/core": "^6", | ||
"commander": "^3.0.0" | ||
"commander": "^3.0.0||^4.0.1" | ||
}, | ||
@@ -27,18 +27,17 @@ "dependencies": { | ||
"devDependencies": { | ||
"@nestjs/common": "6.5.3", | ||
"@nestjs/core": "6.5.3", | ||
"@nestjs/testing": "6.5.3", | ||
"@types/jest": "24.0.17", | ||
"@types/node": "^12.7.1", | ||
"@nestjs/common": "6.10.13", | ||
"@nestjs/core": "6.10.13", | ||
"@nestjs/testing": "6.10.13", | ||
"@types/jest": "24.0.25", | ||
"@types/node": "13.1.2", | ||
"@types/ora": "3.2.0", | ||
"codecov": "3.5.0", | ||
"commander": "3.0.0", | ||
"jest": "24.8.0", | ||
"commander": "4.0.1", | ||
"jest": "24.9.0", | ||
"reflect-metadata": "0.1.13", | ||
"rxjs": "6.5.2", | ||
"ts-jest": "24.0.2", | ||
"ts-node": "8.3.0", | ||
"tsconfig-paths": "3.8.0", | ||
"typedoc": "0.15.0", | ||
"typescript": "3.5.3" | ||
"rxjs": "6.5.4", | ||
"ts-jest": "24.2.0", | ||
"ts-node": "8.5.4", | ||
"tsconfig-paths": "3.9.0", | ||
"typedoc": "0.15.6", | ||
"typescript": "3.7.4" | ||
}, | ||
@@ -45,0 +44,0 @@ "scripts": { |
[![nestjs-console](https://raw.githubusercontent.com/Pop-Code/nestjs-console/master/resources/logo-frame.png)][npm] | ||
[![CircleCI](https://circleci.com/gh/Pop-Code/nestjs-console.svg?style=shield)][ci] | ||
[![Actions Status](https://github.com/Pop-Code/nestjs-console/workflows/Test/badge.svg?branch=master)](https://github.com/Pop-Code/nestjs-acl/actions) | ||
[![codecov](https://codecov.io/gh/Pop-Code/nestjs-console/branch/master/graph/badge.svg)][codecov] | ||
@@ -140,3 +140,3 @@ [![NPM Downloads](https://img.shields.io/npm/dm/nestjs-console.svg?style=flat)][npmchart] | ||
// See Ora npm package for details about spinner | ||
const spin = this.consoleService.createSpinner(); | ||
const spin = this.consoleService.constructor.createSpinner(); | ||
spin.start(`Listing files in directory ${directory}`); | ||
@@ -321,21 +321,2 @@ | ||
### Create a Custom ConsoleService | ||
You can create any number of custom ConsoleService and any nummber of entrypoints (BootstrapConsole). | ||
The Commander provider can be injected using the decorators `@InjectCommander()`. | ||
The decorator can be imported from nestjs-console `import { InjectCommander } from 'nestjs-console'; | ||
```ts | ||
import { Injectable } from '@nestjs/common'; | ||
import { InjectCommander, Command, ConsoleService } from 'nestjs-console'; | ||
@Injectable() | ||
export class CustomConsole extends ConsoleService { | ||
constructor(@InjectCommander() protected readonly cli: Command) { | ||
super(cli); | ||
// do something with the cli, instance of npm commander | ||
} | ||
} | ||
``` | ||
### [API DOCUMENTATION][doclink] | ||
@@ -347,3 +328,2 @@ | ||
[npmchart]: https://npmcharts.com/compare/nestjs-console?minimal=true | ||
[ci]: https://circleci.com/gh/Pop-Code/nestjs-console | ||
[codecov]: https://codecov.io/gh/Pop-Code/nestjs-console | ||
@@ -350,0 +330,0 @@ [doclink]: https://pop-code.github.io/nestjs-console |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40171
15
33
1
330