Skip to content

Commit 62fb352

Browse files
Merge branch 'johnbiundo-biundo/samples'
2 parents 50c8d66 + 37b7024 commit 62fb352

99 files changed

Lines changed: 130278 additions & 405 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sample/01-cats-app/package.json

Lines changed: 51 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,62 @@
44
"description": "Nest TypeScript starter repository",
55
"license": "MIT",
66
"scripts": {
7-
"build": "tsc -p tsconfig.build.json",
8-
"start": "ts-node src/main.ts",
9-
"prestart:prod": "npm run build",
10-
"start:prod": "node dist/main.js",
11-
"test": "jest --config=jest.json",
12-
"test:watch": "jest --watch --config=jest.json",
13-
"test:coverage": "jest --config=jest.json --coverage --coverageDirectory=coverage",
14-
"e2e": "jest --config=e2e/jest-e2e.json --forceExit",
15-
"e2e:watch": "jest --watch --config=e2e/jest-e2e.json"
7+
"prebuild": "rimraf dist",
8+
"build": "nest build",
9+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
10+
"start": "nest start",
11+
"start:dev": "nest start --watch",
12+
"start:debug": "nest start --debug --watch",
13+
"start:prod": "node dist/main",
14+
"lint": "tslint -p tsconfig.json -c tslint.json",
15+
"test": "jest",
16+
"test:watch": "jest --watch",
17+
"test:cov": "jest --coverage",
18+
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
19+
"test:e2e": "jest --config ./test/jest-e2e.json"
1620
},
1721
"dependencies": {
18-
"@nestjs/common": "6.8.2",
19-
"@nestjs/core": "6.8.2",
20-
"@nestjs/platform-express": "6.8.2",
21-
"@nestjs/testing": "6.8.2",
22-
"@nestjs/websockets": "6.8.2",
22+
"@nestjs/common": "^6.8.0",
23+
"@nestjs/core": "^6.8.0",
24+
"@nestjs/platform-express": "^6.8.0",
25+
"reflect-metadata": "^0.1.13",
2326
"class-transformer": "0.2.3",
2427
"class-validator": "0.10.1",
25-
"reflect-metadata": "0.1.13",
26-
"rxjs": "6.5.3",
27-
"typescript": "3.6.4"
28+
"rimraf": "^3.0.0",
29+
"rxjs": "^6.5.3"
2830
},
2931
"devDependencies": {
30-
"@types/jest": "24.0.18",
31-
"@types/node": "10.14.21",
32-
"jest": "24.9.0",
33-
"supertest": "4.0.2",
34-
"ts-jest": "24.1.0",
35-
"ts-node": "8.4.1",
36-
"tslint": "5.20.0"
32+
"@nestjs/cli": "^6.10.1",
33+
"@nestjs/schematics": "^6.7.0",
34+
"@nestjs/testing": "^6.8.0",
35+
"@types/express": "^4.17.1",
36+
"@types/node": "^12.7.8",
37+
"@types/supertest": "^2.0.8",
38+
"jest": "^24.9.0",
39+
"prettier": "^1.18.2",
40+
"supertest": "^4.0.2",
41+
"ts-jest": "^24.1.0",
42+
"ts-loader": "^6.2.0",
43+
"ts-node": "^8.4.1",
44+
"tsconfig-paths": "^3.9.0",
45+
"tslint": "^5.20.0",
46+
"typescript": "^3.6.3"
47+
},
48+
"jest": {
49+
"moduleFileExtensions": [
50+
"js",
51+
"json",
52+
"ts"
53+
],
54+
"rootDir": "src",
55+
"testRegex": ".spec.ts$",
56+
"transform": {
57+
"^.+\\.(t|j)s$": "ts-jest"
58+
},
59+
"collectCoverageFrom": [
60+
"**/*.(t|j)s"
61+
],
62+
"coverageDirectory": "../coverage",
63+
"testEnvironment": "node"
3764
}
3865
}

sample/01-cats-app/src/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import { CatsModule } from './cats/cats.module';
44
@Module({
55
imports: [CatsModule],
66
})
7-
export class ApplicationModule {}
7+
export class AppModule {}

sample/01-cats-app/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { ValidationPipe } from '@nestjs/common';
22
import { NestFactory } from '@nestjs/core';
3-
import { ApplicationModule } from './app.module';
3+
import { AppModule } from './app.module';
44

55
async function bootstrap() {
6-
const app = await NestFactory.create(ApplicationModule);
6+
const app = await NestFactory.create(AppModule);
77
app.useGlobalPipes(new ValidationPipe());
88
await app.listen(3000);
99
}

sample/02-gateways/package.json

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,51 @@
44
"description": "Nest TypeScript starter repository",
55
"license": "MIT",
66
"scripts": {
7-
"build": "tsc -p tsconfig.build.json",
8-
"start": "ts-node src/main.ts",
9-
"prestart:prod": "npm run build",
10-
"start:prod": "node dist/main.js"
7+
"prebuild": "rimraf dist",
8+
"build": "nest build",
9+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
10+
"start": "nest start",
11+
"start:dev": "nest start --watch",
12+
"start:debug": "nest start --debug --watch",
13+
"start:prod": "node dist/main",
14+
"lint": "tslint -p tsconfig.json -c tslint.json",
15+
"test": "jest",
16+
"test:watch": "jest --watch",
17+
"test:cov": "jest --coverage",
18+
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
19+
"test:e2e": "jest --config ./test/jest-e2e.json"
1120
},
1221
"dependencies": {
1322
"@nestjs/common": "6.8.2",
1423
"@nestjs/core": "6.8.2",
1524
"@nestjs/platform-express": "6.8.2",
1625
"@nestjs/platform-socket.io": "6.8.2",
17-
"@nestjs/testing": "6.8.2",
1826
"@nestjs/websockets": "6.8.2",
1927
"class-transformer": "0.2.3",
2028
"class-validator": "0.10.1",
2129
"reflect-metadata": "0.1.13",
30+
"rimraf": "^3.0.0",
2231
"rxjs": "6.5.3",
23-
"socket.io-redis": "5.2.0",
24-
"typescript": "3.6.4"
32+
"socket.io-redis": "5.2.0"
2533
},
2634
"devDependencies": {
27-
"@types/node": "7.10.7",
28-
"@types/socket.io": "2.1.4",
35+
"@types/socket.io": "2.1.3",
2936
"@types/socket.io-redis": "1.0.25",
3037
"@types/ws": "6.0.3",
31-
"ts-node": "8.4.1",
32-
"tslint": "5.20.0"
38+
"@nestjs/cli": "^6.9.1",
39+
"@nestjs/schematics": "^6.7.0",
40+
"@nestjs/testing": "^6.8.0",
41+
"@types/express": "^4.17.1",
42+
"@types/node": "^12.7.8",
43+
"@types/supertest": "^2.0.8",
44+
"jest": "^24.9.0",
45+
"prettier": "^1.18.2",
46+
"supertest": "^4.0.2",
47+
"ts-jest": "^24.1.0",
48+
"ts-loader": "^6.2.0",
49+
"ts-node": "^8.4.1",
50+
"tsconfig-paths": "^3.9.0",
51+
"tslint": "^5.20.0",
52+
"typescript": "^3.6.3"
3353
}
3454
}

sample/02-gateways/src/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import { EventsModule } from './events/events.module';
44
@Module({
55
imports: [EventsModule],
66
})
7-
export class ApplicationModule {}
7+
export class AppModule {}

sample/02-gateways/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { NestFactory } from '@nestjs/core';
2-
import { ApplicationModule } from './app.module';
2+
import { AppModule } from './app.module';
33

44
async function bootstrap() {
5-
const app = await NestFactory.create(ApplicationModule);
5+
const app = await NestFactory.create(AppModule);
66
await app.listen(3000);
77
}
88
bootstrap();

0 commit comments

Comments
 (0)