-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnestjs.yml
144 lines (114 loc) · 5.24 KB
/
nestjs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
description: "NestJS Rest Template"
generate:
service:
description: "Generate a service declaration"
structure:
src/$PARAM_PLURAL_NAME$/$PARAM_PLURAL_NAME$.service.ts:
content: |-
import { Injectable } from '@nestjs/common';
@Injectable()
export class $PASCAL_PLURAL_NAME$Service {}
src/$PARAM_PLURAL_NAME$/$PARAM_PLURAL_NAME$.service.spec.ts:
content: |-
import { Test, TestingModule } from '@nestjs/testing';
import { $PASCAL_PLURAL_NAME$Service } from './$PARAM_PLURAL_NAME$.service';
describe('$PASCAL_PLURAL_NAME$Service', () => {
let service: $PASCAL_PLURAL_NAME$Service;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [$PASCAL_PLURAL_NAME$Service],
}).compile();
service = module.get<$PASCAL_PLURAL_NAME$Service>($PASCAL_PLURAL_NAME$Service);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});
controller:
description: "Generate a controller declaration"
structure:
src/$PARAM_PLURAL_NAME$/$PARAM_PLURAL_NAME$.controller.ts:
content: |-
import { Controller } from '@nestjs/common';
@Controller('$PATH_PLURAL_NAME$')
export class $PASCAL_PLURAL_NAME$Controller {}
src/$PARAM_PLURAL_NAME$/$PARAM_PLURAL_NAME$.controller.spec.ts:
content: |-
import { Test, TestingModule } from '@nestjs/testing';
import { $PASCAL_PLURAL_NAME$Controller } from './$PARAM_PLURAL_NAME$.controller';
describe('$PASCAL_PLURAL_NAME$Controller', () => {
let controller: $PASCAL_PLURAL_NAME$Controller;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [$PASCAL_PLURAL_NAME$Controller],
}).compile();
controller = module.get<$PASCAL_PLURAL_NAME$Controller>($PASCAL_PLURAL_NAME$Controller);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});
resource:
src/$PARAM_PLURAL_NAME$/$PARAM_PLURAL_NAME$.service.ts:
content: |-
import { Injectable } from '@nestjs/common';
@Injectable()
export class $PASCAL_PLURAL_NAME$Service {}
src/$PARAM_PLURAL_NAME$/$PARAM_PLURAL_NAME$.service.spec.ts:
content: |-
import { Test, TestingModule } from '@nestjs/testing';
import { $PASCAL_PLURAL_NAME$Service } from './$PARAM_PLURAL_NAME$.service';
describe('$PASCAL_PLURAL_NAME$Service', () => {
let service: $PASCAL_PLURAL_NAME$Service;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [$PASCAL_PLURAL_NAME$Service],
}).compile();
service = module.get<$PASCAL_PLURAL_NAME$Service>($PASCAL_PLURAL_NAME$Service);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});
src/$PARAM_PLURAL_NAME$/$PARAM_PLURAL_NAME$.controller.ts:
content: |-
import { Controller } from '@nestjs/common';
@Controller('$PATH_PLURAL_NAME$')
export class $PASCAL_PLURAL_NAME$Controller {}
src/$PARAM_PLURAL_NAME$/$PARAM_PLURAL_NAME$.controller.spec.ts:
content: |-
import { Test, TestingModule } from '@nestjs/testing';
import { $PASCAL_PLURAL_NAME$Controller } from './$PARAM_PLURAL_NAME$.controller';
describe('$PASCAL_PLURAL_NAME$Controller', () => {
let controller: $PASCAL_PLURAL_NAME$Controller;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [$PASCAL_PLURAL_NAME$Controller],
}).compile();
controller = module.get<$PASCAL_PLURAL_NAME$Controller>($PASCAL_PLURAL_NAME$Controller);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});
src/$PARAM_PLURAL_NAME$/$PARAM_PLURAL_NAME$.module.ts:
content: |-
import { Module } from '@nestjs/common';
import { $PASCAL_PLURAL_NAME$Service } from './$PARAM_PLURAL_NAME$.service';
import { $PASCAL_PLURAL_NAME$Controller } from './$PARAM_PLURAL_NAME$.controller';
@Module({
controllers: [$PASCAL_PLURAL_NAME$Controller],
providers: [$PASCAL_PLURAL_NAME$Service]
})
export class $PASCAL_PLURAL_NAME$Module {}
src/$PARAM_PLURAL_NAME$/dto/create-$PARAM_SINGULAR_NAME$.dto.ts:
content: |-
export class Create$PASCAL_SINGULAR_NAME$Dto {}
src/$PARAM_PLURAL_NAME$/dto/update-$PARAM_SINGULAR_NAME$.dto.ts:
content: |-
import { PartialType } from '@nestjs/mapped-types';
import { CreateCatDto } from './create-$PARAM_SINGULAR_NAME$.dto';
export class Update$PASCAL_SINGULAR_NAME$Dto extends PartialType(Create$PASCAL_SINGULAR_NAME$Dto) {}
src/$PARAM_PLURAL_NAME$/entities/$PARAM_SINGULAR_NAME$.entity.ts:
content: |-
export class $PASCAL_SINGULAR_NAME$ {}