mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
Add lerna package
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -7,6 +7,7 @@ node_modules/
|
|||||||
/.vscode
|
/.vscode
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
|
lerna-debug.log
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
/src/common/npm-debug.log
|
/src/common/npm-debug.log
|
||||||
/src/core/npm-debug.log
|
/src/core/npm-debug.log
|
||||||
@@ -22,4 +23,7 @@ npm-debug.log
|
|||||||
# tests
|
# tests
|
||||||
/test
|
/test
|
||||||
/coverage
|
/coverage
|
||||||
/.nyc_output
|
/.nyc_output
|
||||||
|
|
||||||
|
# build
|
||||||
|
/lib
|
||||||
@@ -2,6 +2,10 @@
|
|||||||
## 4.1.4
|
## 4.1.4
|
||||||
- **common**: remove deprecated `@ExceptionFilters()` decorator
|
- **common**: remove deprecated `@ExceptionFilters()` decorator
|
||||||
- **core**: update to latest **express* version (4.16.2)
|
- **core**: update to latest **express* version (4.16.2)
|
||||||
|
- **core**: bugfix #187
|
||||||
|
- **core**: bugfix #185
|
||||||
|
- **all**: packages codependency refactor
|
||||||
|
- **all**: add *lerna* package
|
||||||
|
|
||||||
## 4.1.3
|
## 4.1.3
|
||||||
- **core**: forward reference bugfixes & security updates
|
- **core**: forward reference bugfixes & security updates
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
const gulp = require('gulp');
|
const gulp = require('gulp');
|
||||||
const ts = require('gulp-typescript');
|
const ts = require('gulp-typescript');
|
||||||
|
const gulpSequence = require('gulp-sequence')
|
||||||
|
|
||||||
const packages = {
|
const packages = {
|
||||||
common: ts.createProject('src/common/tsconfig.json'),
|
common: ts.createProject('src/common/tsconfig.json'),
|
||||||
@@ -10,7 +11,8 @@ const packages = {
|
|||||||
};
|
};
|
||||||
const modules = Object.keys(packages);
|
const modules = Object.keys(packages);
|
||||||
const source = 'src';
|
const source = 'src';
|
||||||
const dist = 'node_modules/@nestjs'
|
const distId = process.argv.indexOf('--dist');
|
||||||
|
const dist = distId < 0 ? 'node_modules/@nestjs' : process.argv[distId + 1];
|
||||||
|
|
||||||
gulp.task('default', function () {
|
gulp.task('default', function () {
|
||||||
modules.forEach((module) => {
|
modules.forEach((module) => {
|
||||||
@@ -26,3 +28,8 @@ modules.forEach((module) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('build', function (cb) {
|
||||||
|
gulpSequence(modules, cb);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
7
lerna.json
Normal file
7
lerna.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"lerna": "2.4.0",
|
||||||
|
"packages": [
|
||||||
|
"lib/*"
|
||||||
|
],
|
||||||
|
"version": "4.1.7"
|
||||||
|
}
|
||||||
76
package.json
76
package.json
@@ -1,44 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "nestjs",
|
"name": "nestjs",
|
||||||
"version": "4.1.3",
|
"version": "4.1.7",
|
||||||
"description": "Modern, fast, powerful node.js web framework",
|
"description": "Modern, fast, powerful node.js web framework",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "nodemon -e ts --watch src index.js",
|
"start": "node index.js",
|
||||||
"build": "node index.js",
|
"start:live": "nodemon -e ts --watch src index.js",
|
||||||
"test": "nyc --require ts-node/register mocha src/**/*.spec.ts --reporter spec",
|
"test": "nyc --require ts-node/register mocha src/**/*.spec.ts --reporter spec",
|
||||||
"coverage": "nyc report --reporter=text-lcov | coveralls"
|
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
||||||
|
"build": "gulp build --dist lib",
|
||||||
|
"prepublish": "npm run build",
|
||||||
|
"publish": "./node_modules/.bin/lerna publish --skip-git"
|
||||||
},
|
},
|
||||||
"nyc": {
|
"engines": {
|
||||||
"include": [
|
"node": ">=6.9.11"
|
||||||
"src/**/*.ts"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"node_modules/",
|
|
||||||
"src/**/*.spec.ts",
|
|
||||||
"src/core/adapters/*.ts",
|
|
||||||
"src/websockets/adapters/*.ts",
|
|
||||||
"src/core/nest-application.ts",
|
|
||||||
"src/core/nest-factory.ts",
|
|
||||||
"src/core/nest-microservice.ts",
|
|
||||||
"src/common/services/logger.service.ts",
|
|
||||||
"src/core/errors/exceptions",
|
|
||||||
"src/microservices/exceptions/",
|
|
||||||
"src/microservices/microservices-module.ts",
|
|
||||||
"src/core/middlewares/middlewares-module.ts"
|
|
||||||
],
|
|
||||||
"extension": [
|
|
||||||
".ts"
|
|
||||||
],
|
|
||||||
"require": [
|
|
||||||
"ts-node/register"
|
|
||||||
],
|
|
||||||
"reporter": [
|
|
||||||
"text-summary",
|
|
||||||
"html"
|
|
||||||
],
|
|
||||||
"sourceMap": true,
|
|
||||||
"instrument": true
|
|
||||||
},
|
},
|
||||||
"author": "Kamil Mysliwiec",
|
"author": "Kamil Mysliwiec",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -80,11 +55,13 @@
|
|||||||
"core-js": "^2.4.1",
|
"core-js": "^2.4.1",
|
||||||
"coveralls": "^2.11.16",
|
"coveralls": "^2.11.16",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
|
"gulp-sequence": "^0.4.6",
|
||||||
"gulp-typescript": "^3.1.6",
|
"gulp-typescript": "^3.1.6",
|
||||||
"gulp-watch": "^4.3.11",
|
"gulp-watch": "^4.3.11",
|
||||||
"imports-loader": "^0.7.0",
|
"imports-loader": "^0.7.0",
|
||||||
"istanbul": "^0.4.5",
|
"istanbul": "^0.4.5",
|
||||||
"json-loader": "^0.5.4",
|
"json-loader": "^0.5.4",
|
||||||
|
"lerna": "^2.5.1",
|
||||||
"mocha": "^3.2.0",
|
"mocha": "^3.2.0",
|
||||||
"nodemon": "^1.11.0",
|
"nodemon": "^1.11.0",
|
||||||
"nyc": "^10.1.2",
|
"nyc": "^10.1.2",
|
||||||
@@ -96,5 +73,36 @@
|
|||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
"url": "https://opencollective.com/nest",
|
"url": "https://opencollective.com/nest",
|
||||||
"logo": "https://opencollective.com/opencollective/logo.txt"
|
"logo": "https://opencollective.com/opencollective/logo.txt"
|
||||||
|
},
|
||||||
|
"nyc": {
|
||||||
|
"include": [
|
||||||
|
"src/**/*.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"node_modules/",
|
||||||
|
"src/**/*.spec.ts",
|
||||||
|
"src/core/adapters/*.ts",
|
||||||
|
"src/websockets/adapters/*.ts",
|
||||||
|
"src/core/nest-application.ts",
|
||||||
|
"src/core/nest-factory.ts",
|
||||||
|
"src/common/services/logger.service.ts",
|
||||||
|
"src/core/errors/exceptions",
|
||||||
|
"src/microservices/exceptions/",
|
||||||
|
"src/microservices/microservices-module.ts",
|
||||||
|
"src/microservices/nest-microservice.ts",
|
||||||
|
"src/core/middlewares/middlewares-module.ts"
|
||||||
|
],
|
||||||
|
"extension": [
|
||||||
|
".ts"
|
||||||
|
],
|
||||||
|
"require": [
|
||||||
|
"ts-node/register"
|
||||||
|
],
|
||||||
|
"reporter": [
|
||||||
|
"text-summary",
|
||||||
|
"html"
|
||||||
|
],
|
||||||
|
"sourceMap": true,
|
||||||
|
"instrument": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@nestjs/common",
|
|
||||||
"version": "4.1.0",
|
|
||||||
"description": "Nest - modern, fast, powerful node.js web framework (@common)",
|
|
||||||
"author": "Kamil Mysliwiec",
|
|
||||||
"license": "MIT",
|
|
||||||
"scripts": {
|
|
||||||
"compile": "tsc -p tsconfig.json"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"cli-color": "1.1.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"reflect-metadata": "0.1.10"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -13,5 +13,5 @@ export const UnknownExportMessage = (name: string) =>
|
|||||||
export const INVALID_MIDDLEWARE_CONFIGURATION = `Invalid middleware configuration passed inside the module 'configure()' method.`;
|
export const INVALID_MIDDLEWARE_CONFIGURATION = `Invalid middleware configuration passed inside the module 'configure()' method.`;
|
||||||
export const UNKNOWN_REQUEST_MAPPING = `Request mapping properties not defined in the @RequestMapping() annotation!`;
|
export const UNKNOWN_REQUEST_MAPPING = `Request mapping properties not defined in the @RequestMapping() annotation!`;
|
||||||
export const UNHANDLED_RUNTIME_EXCEPTION = `Unhandled Runtime Exception.`;
|
export const UNHANDLED_RUNTIME_EXCEPTION = `Unhandled Runtime Exception.`;
|
||||||
export const INVALID_EXCEPTION_FILTER = `Invalid exception filters (@ExceptionFilters()).`;
|
export const INVALID_EXCEPTION_FILTER = `Invalid exception filters (@UseFilters()).`;
|
||||||
export const MICROSERVICES_PACKAGE_NOT_FOUND_EXCEPTION = `Unable to load @nestjs/microservices packages (please, make sure whether it's installed already).`
|
export const MICROSERVICES_PACKAGE_NOT_FOUND_EXCEPTION = `Unable to load @nestjs/microservices packages (please, make sure whether it's installed already).`
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@nestjs/core",
|
|
||||||
"version": "4.1.3",
|
|
||||||
"description": "Nest - modern, fast, powerful node.js web framework (@core)",
|
|
||||||
"author": "Kamil Mysliwiec",
|
|
||||||
"license": "MIT",
|
|
||||||
"scripts": {
|
|
||||||
"compile": "tsc -p tsconfig.json"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"express": "4.16.2",
|
|
||||||
"iterare": "0.0.8"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@nestjs/common": "^4.*",
|
|
||||||
"reflect-metadata": "0.1.10",
|
|
||||||
"rxjs": "^5.4.2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as sinon from 'sinon';
|
import * as sinon from 'sinon';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import { RouterExceptionFilters } from '../../router/router-exception-filters';
|
import { RouterExceptionFilters } from '../../router/router-exception-filters';
|
||||||
import { ExceptionFilters } from '../../../common/utils/decorators/exception-filters.decorator';
|
import { UseFilters } from '../../../common/utils/decorators/exception-filters.decorator';
|
||||||
import { Catch } from '../../../common/utils/decorators/catch.decorator';
|
import { Catch } from '../../../common/utils/decorators/catch.decorator';
|
||||||
import { UnknownModuleException } from '../../errors/exceptions/unknown-module.exception';
|
import { UnknownModuleException } from '../../errors/exceptions/unknown-module.exception';
|
||||||
import { ApplicationConfig } from '../../application-config';
|
import { ApplicationConfig } from '../../application-config';
|
||||||
@@ -32,7 +32,7 @@ describe('RouterExceptionFilters', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('when filters metadata is not empty', () => {
|
describe('when filters metadata is not empty', () => {
|
||||||
@ExceptionFilters(new ExceptionFilter())
|
@UseFilters(new ExceptionFilter())
|
||||||
class WithMetadata {}
|
class WithMetadata {}
|
||||||
|
|
||||||
it('should returns ExceptionHandler object with exception filters', () => {
|
it('should returns ExceptionHandler object with exception filters', () => {
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@nestjs/microservices",
|
|
||||||
"version": "4.1.0",
|
|
||||||
"description": "Nest - modern, fast, powerful node.js web framework (@microservices)",
|
|
||||||
"author": "Kamil Mysliwiec",
|
|
||||||
"license": "MIT",
|
|
||||||
"scripts": {
|
|
||||||
"compile": "tsc -p tsconfig.json"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"json-socket": "^0.2.1",
|
|
||||||
"iterare": "0.0.8",
|
|
||||||
"redis": "^2.7.1"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@nestjs/common": "~4.*",
|
|
||||||
"@nestjs/core": "~4.*",
|
|
||||||
"reflect-metadata": "0.1.10",
|
|
||||||
"rxjs": "^5.4.2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as sinon from 'sinon';
|
import * as sinon from 'sinon';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import { ExceptionFilters } from '../../../common/utils/decorators/exception-filters.decorator';
|
import { UseFilters } from '../../../common/utils/decorators/exception-filters.decorator';
|
||||||
import { Catch } from '../../../common/utils/decorators/catch.decorator';
|
import { Catch } from '../../../common/utils/decorators/catch.decorator';
|
||||||
import { ExceptionFiltersContext } from './../../context/exception-filters-context';
|
import { ExceptionFiltersContext } from './../../context/exception-filters-context';
|
||||||
import { ApplicationConfig } from './../../../core/application-config';
|
import { ApplicationConfig } from './../../../core/application-config';
|
||||||
@@ -31,7 +31,7 @@ describe('ExceptionFiltersContext', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('when filters metadata is not empty', () => {
|
describe('when filters metadata is not empty', () => {
|
||||||
@ExceptionFilters(new ExceptionFilter())
|
@UseFilters(new ExceptionFilter())
|
||||||
class WithMetadata {}
|
class WithMetadata {}
|
||||||
|
|
||||||
it('should returns ExceptionHandler object with exception filters', () => {
|
it('should returns ExceptionHandler object with exception filters', () => {
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@nestjs/testing",
|
|
||||||
"version": "4.1.0",
|
|
||||||
"description": "Nest - modern, fast, powerful node.js web framework (@testing)",
|
|
||||||
"author": "Kamil Mysliwiec",
|
|
||||||
"license": "MIT",
|
|
||||||
"scripts": {
|
|
||||||
"compile": "tsc -p tsconfig.json"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@nestjs/common": "~4.*",
|
|
||||||
"@nestjs/core": "~4.*",
|
|
||||||
"@nestjs/microservices": "~4.*"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,9 +6,9 @@ import { isFunction } from '@nestjs/common/utils/shared.utils';
|
|||||||
import { ModuleTokenFactory } from '@nestjs/core/injector/module-token-factory';
|
import { ModuleTokenFactory } from '@nestjs/core/injector/module-token-factory';
|
||||||
import { NestModuleMetatype } from '@nestjs/common/interfaces/modules/module-metatype.interface';
|
import { NestModuleMetatype } from '@nestjs/common/interfaces/modules/module-metatype.interface';
|
||||||
import { UnknownModuleException } from './errors/unknown-module.exception';
|
import { UnknownModuleException } from './errors/unknown-module.exception';
|
||||||
import { NestApplication, NestMicroservice } from '@nestjs/core';
|
import { NestApplication } from '@nestjs/core';
|
||||||
import { INestApplication, INestMicroservice } from '@nestjs/common';
|
import { INestApplication, INestMicroservice } from '@nestjs/common';
|
||||||
import { MicroserviceConfiguration } from '@nestjs/microservices';
|
import { MicroserviceConfiguration, NestMicroservice } from '@nestjs/microservices';
|
||||||
|
|
||||||
export class TestingModule {
|
export class TestingModule {
|
||||||
private readonly moduleTokenFactory = new ModuleTokenFactory();
|
private readonly moduleTokenFactory = new ModuleTokenFactory();
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@nestjs/websockets",
|
|
||||||
"version": "4.1.0",
|
|
||||||
"description": "Nest - modern, fast, powerful node.js web framework (@websockets)",
|
|
||||||
"author": "Kamil Mysliwiec",
|
|
||||||
"license": "MIT",
|
|
||||||
"scripts": {
|
|
||||||
"compile": "tsc -p tsconfig.json"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"iterare": "0.0.8",
|
|
||||||
"socket.io": "^2.0.3"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@nestjs/common": "~4.*",
|
|
||||||
"@nestjs/core": "~4.*",
|
|
||||||
"reflect-metadata": "0.1.10",
|
|
||||||
"rxjs": "^5.4.2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as sinon from 'sinon';
|
import * as sinon from 'sinon';
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import { ExceptionFilters } from '../../../common/utils/decorators/exception-filters.decorator';
|
import { UseFilters } from '../../../common/utils/decorators/exception-filters.decorator';
|
||||||
import { Catch } from '../../../common/utils/decorators/catch.decorator';
|
import { Catch } from '../../../common/utils/decorators/catch.decorator';
|
||||||
import { ExceptionFiltersContext } from './../../context/exception-filters-context';
|
import { ExceptionFiltersContext } from './../../context/exception-filters-context';
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ describe('ExceptionFiltersContext', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('when filters metadata is not empty', () => {
|
describe('when filters metadata is not empty', () => {
|
||||||
@ExceptionFilters(new ExceptionFilter())
|
@UseFilters(new ExceptionFilter())
|
||||||
class WithMetadata {}
|
class WithMetadata {}
|
||||||
|
|
||||||
it('should returns ExceptionHandler object with exception filters', () => {
|
it('should returns ExceptionHandler object with exception filters', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user