Skip to content

Commit

Permalink
Add lerna package
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Nov 2, 2017
1 parent 2a18249 commit c7ff78f
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 136 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ node_modules/
/.vscode

# misc
lerna-debug.log
npm-debug.log
/src/common/npm-debug.log
/src/core/npm-debug.log
Expand All @@ -22,4 +23,7 @@ npm-debug.log
# tests
/test
/coverage
/.nyc_output
/.nyc_output

# build
/lib
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
## 4.1.4
- **common**: remove deprecated `@ExceptionFilters()` decorator
- **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
- **core**: forward reference bugfixes & security updates
Expand Down
9 changes: 8 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const gulp = require('gulp');
const ts = require('gulp-typescript');
const gulpSequence = require('gulp-sequence')

const packages = {
common: ts.createProject('src/common/tsconfig.json'),
Expand All @@ -10,7 +11,8 @@ const packages = {
};
const modules = Object.keys(packages);
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 () {
modules.forEach((module) => {
Expand All @@ -26,3 +28,8 @@ modules.forEach((module) => {
});
});

gulp.task('build', function (cb) {
gulpSequence(modules, cb);
});


7 changes: 7 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"lerna": "2.4.0",
"packages": [
"lib/*"
],
"version": "4.1.7"
}
76 changes: 42 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,19 @@
{
"name": "nestjs",
"version": "4.1.3",
"version": "4.1.7",
"description": "Modern, fast, powerful node.js web framework",
"main": "index.js",
"scripts": {
"start": "nodemon -e ts --watch src index.js",
"build": "node index.js",
"start": "node index.js",
"start:live": "nodemon -e ts --watch src index.js",
"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": {
"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/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
"engines": {
"node": ">=6.9.11"
},
"author": "Kamil Mysliwiec",
"license": "MIT",
Expand Down Expand Up @@ -80,11 +55,13 @@
"core-js": "^2.4.1",
"coveralls": "^2.11.16",
"gulp": "^3.9.1",
"gulp-sequence": "^0.4.6",
"gulp-typescript": "^3.1.6",
"gulp-watch": "^4.3.11",
"imports-loader": "^0.7.0",
"istanbul": "^0.4.5",
"json-loader": "^0.5.4",
"lerna": "^2.5.1",
"mocha": "^3.2.0",
"nodemon": "^1.11.0",
"nyc": "^10.1.2",
Expand All @@ -96,5 +73,36 @@
"type": "opencollective",
"url": "https://opencollective.com/nest",
"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
}
}
16 changes: 0 additions & 16 deletions src/common/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/core/errors/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 UNKNOWN_REQUEST_MAPPING = `Request mapping properties not defined in the @RequestMapping() annotation!`;
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).`
19 changes: 0 additions & 19 deletions src/core/package.json

This file was deleted.

4 changes: 2 additions & 2 deletions src/core/test/router/router-exception-filters.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as sinon from 'sinon';
import { expect } from 'chai';
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 { UnknownModuleException } from '../../errors/exceptions/unknown-module.exception';
import { ApplicationConfig } from '../../application-config';
Expand Down Expand Up @@ -32,7 +32,7 @@ describe('RouterExceptionFilters', () => {
});
});
describe('when filters metadata is not empty', () => {
@ExceptionFilters(new ExceptionFilter())
@UseFilters(new ExceptionFilter())
class WithMetadata {}

it('should returns ExceptionHandler object with exception filters', () => {
Expand Down
21 changes: 0 additions & 21 deletions src/microservices/package.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as sinon from 'sinon';
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 { ExceptionFiltersContext } from './../../context/exception-filters-context';
import { ApplicationConfig } from './../../../core/application-config';
Expand Down Expand Up @@ -31,7 +31,7 @@ describe('ExceptionFiltersContext', () => {
});
});
describe('when filters metadata is not empty', () => {
@ExceptionFilters(new ExceptionFilter())
@UseFilters(new ExceptionFilter())
class WithMetadata {}

it('should returns ExceptionHandler object with exception filters', () => {
Expand Down
15 changes: 0 additions & 15 deletions src/testing/package.json

This file was deleted.

4 changes: 2 additions & 2 deletions src/testing/testing-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { isFunction } from '@nestjs/common/utils/shared.utils';
import { ModuleTokenFactory } from '@nestjs/core/injector/module-token-factory';
import { NestModuleMetatype } from '@nestjs/common/interfaces/modules/module-metatype.interface';
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 { MicroserviceConfiguration } from '@nestjs/microservices';
import { MicroserviceConfiguration, NestMicroservice } from '@nestjs/microservices';

export class TestingModule {
private readonly moduleTokenFactory = new ModuleTokenFactory();
Expand Down
20 changes: 0 additions & 20 deletions src/websockets/package.json

This file was deleted.

4 changes: 2 additions & 2 deletions src/websockets/test/context/exception-filters.context.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as sinon from 'sinon';
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 { ExceptionFiltersContext } from './../../context/exception-filters-context';

Expand Down Expand Up @@ -30,7 +30,7 @@ describe('ExceptionFiltersContext', () => {
});
});
describe('when filters metadata is not empty', () => {
@ExceptionFilters(new ExceptionFilter())
@UseFilters(new ExceptionFilter())
class WithMetadata {}

it('should returns ExceptionHandler object with exception filters', () => {
Expand Down

0 comments on commit c7ff78f

Please sign in to comment.