Skip to content

Commit

Permalink
Merge branch 'master' into contrib
Browse files Browse the repository at this point in the history
  • Loading branch information
wbhob authored Nov 25, 2017
2 parents 447b8ab + 832eb51 commit 82cb61a
Show file tree
Hide file tree
Showing 567 changed files with 9,469 additions and 303 deletions.
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!--
PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.
ISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.
-->

## I'm submitting a...
<!--
Please search GitHub for a similar issue or PR before submitting.
Check one of the following options with "x" -->
<pre><code>
[ ] Regression <!--(a behavior that used to work and stopped working in a new release)-->
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
</code></pre>

## Current behavior
<!-- Describe how the issue manifests. -->


## Expected behavior
<!-- Describe what the desired behavior would be. -->


## Minimal reproduction of the problem with instructions
<!-- Please share a repo, a gist, or step-by-step instructions. -->

## What is the motivation / use case for changing the behavior?
<!-- Describe the motivation or the concrete use case. -->


## Environment

<pre><code>
Nest version: X.Y.Z
<!-- Check whether this is still an issue in the most recent Nest version -->

For Tooling issues:
- Node version: XX <!-- run `node --version` -->
- Platform: <!-- Mac, Linux, Windows -->

Others:
<!-- Anything else relevant? Operating system version, IDE, package manager, ... -->
</code></pre>
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ npm-debug.log
/test
/coverage
/.nyc_output

# build
/lib
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ addons:
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
install:
- npm install
- gulp build
script:
- npm build
- npm test
after_success: npm run coverage
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# 4.4.0 @soon
- **core**: possibility to create the `NestApplicationContext` using `NestFactory.createApplicationContext()` (Nest application without HTTP server / microservice in the background)
- **core**: create custom params decorators feature (`createRouteParamDecorator()`)

## 4.3.3
- **common**: `ParseIntPipe` is now available out-of-the-box (`@nestjs/common`)
- **common**: package contains a set of useful HTTP exceptions now, such as `ForbiddenException`, `UnauthorizedException`, `BadRequestException` etc
- **core**: `HttpException` was moved to `@nestjs/common`. This one from `core` packages is now DEPRECATED and will be removed in the next MAJOR release

## 4.3.0
- **common**: `ValidationPipe` is now available out-of-the-box (`@nestjs/common`)
- **core**: `json` and `urlencoded` (`body-parser`) middlewares are applied by default now, bugfix #252
- **core** more informative error message (injector) #223
example: `[ExceptionHandler] Nest can't resolve dependencies of the UsersService (+, +, ?, +, +, +). Please verify whether [2] argument is available in the current context.`
- **core**: bugfix #240 - middlewares container state
- **core**: bugifx #257 - `@Next()` issue
- **testing**: testing module is now independent from `@nestjs/microservices`

## 4.2.2
- **websockets**: bugfix #242

Expand Down
3 changes: 2 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a>
<a href="https://travis-ci.org/nestjs/nest"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a>
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#3" alt="Coverage" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#4" alt="Coverage" /></a>
<a href="https://gitter.im/nestjs/nestjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/nestjs/nestjs.svg" alt="Gitter" /></a>
<a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
Expand Down Expand Up @@ -47,6 +47,7 @@
<li><strong>Guards</strong> - attach additional logic in a declarative manner (e.g. role-based access control)</li>
<li><strong>Interceptors</strong> - built on top of <a href="https://github.com/reactivex/rxjs" target="blank">RxJS</a></li>
<li>Testing utilities (both <strong>e2e & unit</strong> tests)</li>
<li><strong>More</strong>!</li>
</ul>

## Installation
Expand Down
10 changes: 5 additions & 5 deletions examples/01-cats-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"e2e:watch": "jest --watch --config=e2e/jest-e2e.json"
},
"dependencies": {
"@nestjs/common": "^4.0.1",
"@nestjs/core": "^4.0.1",
"@nestjs/microservices": "^4.0.1",
"@nestjs/testing": "^4.0.1",
"@nestjs/websockets": "^4.0.1",
"@nestjs/common": "^4.3.0",
"@nestjs/core": "^4.3.0",
"@nestjs/microservices": "^4.3.0",
"@nestjs/testing": "^4.3.0",
"@nestjs/websockets": "^4.3.0",
"class-transformer": "^0.1.7",
"class-validator": "^0.7.2",
"redis": "^2.7.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HttpException } from '@nestjs/core';
import { HttpException } from '@nestjs/common';
import { HttpStatus } from '@nestjs/common';

export class ForbiddenException extends HttpException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ExceptionFilter, Catch } from '@nestjs/common';
import { HttpException } from '@nestjs/core';
import { HttpException } from '@nestjs/common';

@Catch(HttpException)
export class HttpExceptionFilter implements ExceptionFilter {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Interceptor, NestInterceptor, ExecutionContext, HttpStatus } from '@nestjs/common';
import { HttpException } from '@nestjs/core';
import { HttpException } from '@nestjs/common';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import 'rxjs/add/observable/throw';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HttpException } from '@nestjs/core';
import { HttpException } from '@nestjs/common';
import { PipeTransform, Pipe, ArgumentMetadata, HttpStatus } from '@nestjs/common';

@Pipe()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HttpException } from '@nestjs/core';
import { HttpException } from '@nestjs/common';
import { PipeTransform, Pipe, ArgumentMetadata, HttpStatus } from '@nestjs/common';
import { validate } from 'class-validator';
import { plainToClass } from 'class-transformer';
Expand Down
10 changes: 5 additions & 5 deletions examples/02-gateways/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"start:prod": "node dist/server.js"
},
"dependencies": {
"@nestjs/common": "^4.0.1",
"@nestjs/core": "^4.0.1",
"@nestjs/microservices": "^4.0.1",
"@nestjs/testing": "^4.0.1",
"@nestjs/websockets": "^4.0.1",
"@nestjs/common": "^4.3.0",
"@nestjs/core": "^4.3.0",
"@nestjs/microservices": "^4.3.0",
"@nestjs/testing": "^4.3.0",
"@nestjs/websockets": "^4.3.0",
"class-transformer": "^0.1.7",
"class-validator": "^0.7.2",
"redis": "^2.7.1",
Expand Down
10 changes: 5 additions & 5 deletions examples/03-microservices/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"start:prod": "node dist/server.js"
},
"dependencies": {
"@nestjs/common": "^4.0.1",
"@nestjs/core": "^4.0.1",
"@nestjs/microservices": "^4.0.1",
"@nestjs/testing": "^4.0.1",
"@nestjs/websockets": "^4.0.1",
"@nestjs/common": "^4.3.0",
"@nestjs/core": "^4.3.0",
"@nestjs/microservices": "^4.3.0",
"@nestjs/testing": "^4.3.0",
"@nestjs/websockets": "^4.3.0",
"amqplib": "^0.5.1",
"class-transformer": "^0.1.7",
"class-validator": "^0.7.2",
Expand Down
10 changes: 5 additions & 5 deletions examples/04-injector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"start:prod": "node dist/server.js"
},
"dependencies": {
"@nestjs/common": "^4.0.1",
"@nestjs/core": "^4.0.1",
"@nestjs/microservices": "^4.0.1",
"@nestjs/testing": "^4.0.1",
"@nestjs/websockets": "^4.0.1",
"@nestjs/common": "^4.3.0",
"@nestjs/core": "^4.3.0",
"@nestjs/microservices": "^4.3.0",
"@nestjs/testing": "^4.3.0",
"@nestjs/websockets": "^4.3.0",
"redis": "^2.7.1",
"reflect-metadata": "^0.1.10",
"rxjs": "^5.4.3",
Expand Down
10 changes: 5 additions & 5 deletions examples/05-sql-typeorm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"start:prod": "node dist/server.js"
},
"dependencies": {
"@nestjs/common": "^4.0.1",
"@nestjs/core": "^4.0.1",
"@nestjs/microservices": "^4.0.1",
"@nestjs/testing": "^4.0.1",
"@nestjs/websockets": "^4.0.1",
"@nestjs/common": "^4.3.0",
"@nestjs/core": "^4.3.0",
"@nestjs/microservices": "^4.3.0",
"@nestjs/testing": "^4.3.0",
"@nestjs/websockets": "^4.3.0",
"mysql": "^2.14.1",
"redis": "^2.7.1",
"reflect-metadata": "^0.1.10",
Expand Down
10 changes: 5 additions & 5 deletions examples/06-mongoose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"start:prod": "node dist/server.js"
},
"dependencies": {
"@nestjs/common": "^4.0.1",
"@nestjs/core": "^4.0.1",
"@nestjs/microservices": "^4.0.1",
"@nestjs/testing": "^4.0.1",
"@nestjs/websockets": "^4.0.1",
"@nestjs/common": "^4.3.0",
"@nestjs/core": "^4.3.0",
"@nestjs/microservices": "^4.3.0",
"@nestjs/testing": "^4.3.0",
"@nestjs/websockets": "^4.3.0",
"mongoose": "^4.11.13",
"redis": "^2.7.1",
"reflect-metadata": "^0.1.10",
Expand Down
10 changes: 5 additions & 5 deletions examples/07-sequelize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"start:prod": "node dist/server.js"
},
"dependencies": {
"@nestjs/common": "^4.0.1",
"@nestjs/core": "^4.0.1",
"@nestjs/microservices": "^4.0.1",
"@nestjs/testing": "^4.0.1",
"@nestjs/websockets": "^4.0.1",
"@nestjs/common": "^4.3.0",
"@nestjs/core": "^4.3.0",
"@nestjs/microservices": "^4.3.0",
"@nestjs/testing": "^4.3.0",
"@nestjs/websockets": "^4.3.0",
"mysql2": "^1.4.2",
"redis": "^2.7.1",
"reflect-metadata": "^0.1.10",
Expand Down
10 changes: 5 additions & 5 deletions examples/08-passport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"start:prod": "node dist/server.js"
},
"dependencies": {
"@nestjs/common": "^4.0.1",
"@nestjs/core": "^4.0.1",
"@nestjs/microservices": "^4.0.1",
"@nestjs/testing": "^4.0.1",
"@nestjs/websockets": "^4.0.1",
"@nestjs/common": "^4.3.0",
"@nestjs/core": "^4.3.0",
"@nestjs/microservices": "^4.3.0",
"@nestjs/testing": "^4.3.0",
"@nestjs/websockets": "^4.3.0",
"@types/passport-jwt": "^2.0.24",
"jsonwebtoken": "^8.0.1",
"passport": "^0.4.0",
Expand Down
10 changes: 5 additions & 5 deletions examples/09-babel-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"start": "node index.js"
},
"dependencies": {
"@nestjs/common": "^4.0.1",
"@nestjs/core": "^4.0.1",
"@nestjs/microservices": "^4.0.1",
"@nestjs/testing": "^4.0.1",
"@nestjs/websockets": "^4.0.1",
"@nestjs/common": "^4.3.0",
"@nestjs/core": "^4.3.0",
"@nestjs/microservices": "^4.3.0",
"@nestjs/testing": "^4.3.0",
"@nestjs/websockets": "^4.3.0",
"babel-core": "^6.26.0",
"babel-polyfill": "^6.26.0",
"body-parser": "^1.17.2",
Expand Down
62 changes: 43 additions & 19 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,59 @@
const gulp = require('gulp');
const ts = require('gulp-typescript');
const gulpSequence = require('gulp-sequence')
const gulpSequence = require('gulp-sequence');

const packages = {
common: ts.createProject('src/common/tsconfig.json'),
core: ts.createProject('src/core/tsconfig.json'),
microservices: ts.createProject('src/microservices/tsconfig.json'),
websockets: ts.createProject('src/websockets/tsconfig.json'),
testing: ts.createProject('src/testing/tsconfig.json')
common: ts.createProject('src/common/tsconfig.json'),
core: ts.createProject('src/core/tsconfig.json'),
microservices: ts.createProject('src/microservices/tsconfig.json'),
websockets: ts.createProject('src/websockets/tsconfig.json'),
testing: ts.createProject('src/testing/tsconfig.json'),
};
const modules = Object.keys(packages);
const source = 'src';
const distId = process.argv.indexOf('--dist');
const dist = distId < 0 ? 'node_modules/@nestjs' : process.argv[distId + 1];

gulp.task('default', function () {
modules.forEach((module) => {
gulp.watch([`${source}/${module}/**/*.ts`, `${source}/${module}/*.ts`], [module]);
});
gulp.task('default', function() {
modules.forEach(module => {
gulp.watch(
[`${source}/${module}/**/*.ts`, `${source}/${module}/*.ts`],
[module]
);
});
});

modules.forEach((module) => {
gulp.task(module, () => {
return packages[module].src()
.pipe(packages[module]())
.pipe(gulp.dest(`${dist}/${module}`));
});
modules.forEach(module => {
gulp.task(module, () => {
return packages[module]
.src()
.pipe(packages[module]())
.pipe(gulp.dest(`${dist}/${module}`));
});
});

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


gulp.task('move', function() {
gulp.src(['node_modules/@nestjs/**/*']).pipe(
gulp.dest('examples/01-cats-app/node_modules/@nestjs')
).pipe(
gulp.dest('examples/02-gateways/node_modules/@nestjs')
).pipe(
gulp.dest('examples/03-microservices/node_modules/@nestjs')
).pipe(
gulp.dest('examples/04-injector/node_modules/@nestjs')
).pipe(
gulp.dest('examples/05-sql-typeorm/node_modules/@nestjs')
).pipe(
gulp.dest('examples/06-mongoose/node_modules/@nestjs')
).pipe(
gulp.dest('examples/07-sequelize/node_modules/@nestjs')
).pipe(
gulp.dest('examples/08-passport/node_modules/@nestjs')
).pipe(
gulp.dest('examples/09-babel-example/node_modules/@nestjs')
);
});
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"packages": [
"lib/*"
],
"version": "4.2.2"
"version": "4.4.1"
}
22 changes: 22 additions & 0 deletions lib/common/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(The MIT License)

Copyright (c) 2017 Kamil Myśliwiec <http://kamilmysliwiec.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 82cb61a

Please sign in to comment.