Merge pull request #33 from nestjs/update/version-5
chore: update to nest v5
This commit is contained in:
commit
b428240559
|
|
@ -389,3 +389,4 @@ Temporary Items
|
|||
# Local
|
||||
docker-compose.yml
|
||||
.env
|
||||
dist
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
<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>
|
||||
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-dc3d53.svg"/></a>
|
||||
<img src="https://img.shields.io/badge/👌-Production Ready-78c7ff.svg"/>
|
||||
<a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
|
||||
</p>
|
||||
<!--[](https://opencollective.com/nest#backer)
|
||||
|
|
@ -44,6 +43,10 @@ $ npm run start
|
|||
# watch mode
|
||||
$ npm run start:dev
|
||||
|
||||
# incremental rebuild (webpack)
|
||||
$ npm run webpack
|
||||
$ npm run start:hmr
|
||||
|
||||
# production mode
|
||||
npm run start:prod
|
||||
```
|
||||
|
|
@ -63,7 +66,7 @@ $ npm run test:cov
|
|||
|
||||
## Support
|
||||
|
||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://opencollective.com/nest).
|
||||
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
|
||||
|
||||
## Stay in touch
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
38
package.json
38
package.json
|
|
@ -4,24 +4,28 @@
|
|||
"description": "Nest TypeScript starter repository",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"format": "prettier --write \"**/*.ts\"",
|
||||
"format": "prettier --write \"src/**/*.ts\"",
|
||||
"start": "ts-node -r tsconfig-paths/register src/main.ts",
|
||||
"start:dev": "nodemon",
|
||||
"prestart:prod": "rimraf dist && tsc",
|
||||
"start:prod": "node dist/main.js",
|
||||
"start:hmr": "node dist/server",
|
||||
"lint": "tslint -p tsconfig.json -c tslint.json",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:cov": "jest --coverage",
|
||||
"test:e2e": "jest --config ./test/jest-e2e.json"
|
||||
"test:e2e": "jest --config ./test/jest-e2e.json",
|
||||
"webpack": "webpack --config webpack.config.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "^4.5.9",
|
||||
"@nestjs/core": "^4.5.10",
|
||||
"@nestjs/microservices": "^4.5.8",
|
||||
"@nestjs/testing": "^4.5.5",
|
||||
"@nestjs/websockets": "^4.5.8",
|
||||
"@nestjs/common": "^5.0.0",
|
||||
"@nestjs/core": "^5.0.0",
|
||||
"@nestjs/microservices": "^5.0.0",
|
||||
"@nestjs/testing": "^5.0.0",
|
||||
"@nestjs/websockets": "^5.0.0",
|
||||
"reflect-metadata": "^0.1.12",
|
||||
"rxjs": "^5.5.6",
|
||||
"typescript": "^2.6.2"
|
||||
"rxjs": "^6.0.0",
|
||||
"typescript": "^2.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^4.0.39",
|
||||
|
|
@ -34,12 +38,20 @@
|
|||
"rimraf": "^2.6.2",
|
||||
"supertest": "^3.0.0",
|
||||
"ts-jest": "^21.2.4",
|
||||
"ts-node": "^4.1.0",
|
||||
"tsconfig-paths": "^3.1.1",
|
||||
"tslint": "5.3.2"
|
||||
"ts-loader": "^4.1.0",
|
||||
"ts-node": "^6.0.0",
|
||||
"tsconfig-paths": "^3.3.1",
|
||||
"tslint": "5.3.2",
|
||||
"webpack": "^4.2.0",
|
||||
"webpack-cli": "^2.0.13",
|
||||
"webpack-node-externals": "^1.6.0"
|
||||
},
|
||||
"jest": {
|
||||
"moduleFileExtensions": ["js", "json", "ts"],
|
||||
"moduleFileExtensions": [
|
||||
"js",
|
||||
"json",
|
||||
"ts"
|
||||
],
|
||||
"rootDir": "src",
|
||||
"testRegex": ".spec.ts$",
|
||||
"transform": {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
|
||||
describe('AppController', () => {
|
||||
let app: TestingModule;
|
||||
|
|
@ -8,6 +9,7 @@ describe('AppController', () => {
|
|||
beforeAll(async () => {
|
||||
app = await Test.createTestingModule({
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
}).compile();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
import { Get, Controller } from '@nestjs/common';
|
||||
import { AppService } from './app.service';
|
||||
|
||||
@Controller()
|
||||
export class AppController {
|
||||
constructor(private readonly appService: AppService) {}
|
||||
|
||||
@Get()
|
||||
root(): string {
|
||||
return 'Hello World!';
|
||||
return this.appService.root();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
controllers: [AppController],
|
||||
components: [],
|
||||
providers: [AppService],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class AppService {
|
||||
root(): string {
|
||||
return 'Hello World!';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
import { NestFactory } from '@nestjs/core';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
declare const module: any;
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
await app.listen(3000);
|
||||
|
||||
if (module.hot) {
|
||||
module.hot.accept();
|
||||
module.hot.dispose(() => app.close());
|
||||
}
|
||||
}
|
||||
bootstrap();
|
||||
|
|
@ -15,7 +15,7 @@ describe('AppController (e2e)', () => {
|
|||
await app.init();
|
||||
});
|
||||
|
||||
it('/GET /', () => {
|
||||
it('/ (GET)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.get('/')
|
||||
.expect(200)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"declaration": false,
|
||||
"declaration": true,
|
||||
"noImplicitAny": false,
|
||||
"removeComments": true,
|
||||
"noLib": false,
|
||||
|
|
@ -10,7 +10,6 @@
|
|||
"experimentalDecorators": true,
|
||||
"target": "es6",
|
||||
"sourceMap": true,
|
||||
"allowJs": true,
|
||||
"outDir": "./dist",
|
||||
"baseUrl": "./src"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"extends": "tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": ["**/*.spec.ts", "**/*.d.ts"]
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
const webpack = require('webpack');
|
||||
const path = require('path');
|
||||
const nodeExternals = require('webpack-node-externals');
|
||||
|
||||
module.exports = {
|
||||
entry: ['webpack/hot/poll?1000', './src/main.hmr.ts'],
|
||||
watch: true,
|
||||
target: 'node',
|
||||
externals: [
|
||||
nodeExternals({
|
||||
whitelist: ['webpack/hot/poll?1000'],
|
||||
}),
|
||||
],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
mode: "development",
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
],
|
||||
output: {
|
||||
path: path.join(__dirname, 'dist'),
|
||||
filename: 'server.js',
|
||||
},
|
||||
};
|
||||
Loading…
Reference in New Issue