create-nest-minimum 0.0.42 → 0.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +59 -59
- package/index.cjs +3 -3
- package/package.json +7 -7
- package/template/README.md +60 -60
- package/template/_gitignore +17 -17
- package/template/nest-cli.json +24 -24
- package/template/package.json +38 -38
- package/template/src/app.controller.spec.ts +23 -23
- package/template/src/app.controller.ts +13 -13
- package/template/src/app.module.ts +11 -11
- package/template/src/app.service.ts +9 -9
- package/template/src/express.ts +12 -12
- package/template/src/fastify.ts +16 -16
- package/template/test/app.e2e-spec.ts +26 -26
- package/template/tsconfig.build.json +9 -9
- package/template/tsconfig.json +23 -23
- package/template/vitest-globals.d.ts +19 -19
- package/template/vitest.config.base.mts +25 -25
- package/template/vitest.config.e2e.mts +12 -12
- package/template/vitest.config.mts +15 -15
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 离殇
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 离殇
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-
<p align="center">
|
|
6
|
-
<a href="https://www.npmjs.com/package/create-nest-minimum" target="_blank"><img src="https://img.shields.io/npm/v/create-nest-minimum.svg" alt="NPM Version" /></a>
|
|
7
|
-
<a href="https://www.npmjs.com/package/create-nest-minimum" target="_blank"><img src="https://img.shields.io/npm/l/create-nest-minimum.svg" alt="Package License" /></a>
|
|
8
|
-
<a href="https://www.npmjs.com/package/create-nest-minimum" target="_blank"><img src="https://img.shields.io/npm/dm/create-nest-minimum.svg" alt="NPM Downloads" /></a>
|
|
9
|
-
</p>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# Create Nest Minimum Application
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## Why
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
`nest new project-name` is so complete, we may need a simple and lightweight application.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## Scaffolding Your Nest Project
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
> **Compatibility Note:**
|
|
25
|
-
> Nest requires [Node.js](https://nodejs.org/en/) version 20+.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
With NPM:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npm create nest-minimum@latest
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
With Yarn:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
yarn create nest-minimum
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
With PNPM:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
pnpm create nest-minimum
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Then follow the prompts!
|
|
47
|
-
|
|
48
|
-
You can also directly specify the project name and the target directory handled method you want to use via additional command line options. run:
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
# npm 7+, extra double-dash is needed:
|
|
52
|
-
npm create nest-minimum@latest my-nest-app -- --overwrite
|
|
53
|
-
|
|
54
|
-
# yarn
|
|
55
|
-
yarn create nest-minimum my-nest-app --overwrite
|
|
56
|
-
|
|
57
|
-
# pnpm
|
|
58
|
-
pnpm create nest-minimum my-nest-app --overwrite
|
|
59
|
-
```
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/create-nest-minimum" target="_blank"><img src="https://img.shields.io/npm/v/create-nest-minimum.svg" alt="NPM Version" /></a>
|
|
7
|
+
<a href="https://www.npmjs.com/package/create-nest-minimum" target="_blank"><img src="https://img.shields.io/npm/l/create-nest-minimum.svg" alt="Package License" /></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/create-nest-minimum" target="_blank"><img src="https://img.shields.io/npm/dm/create-nest-minimum.svg" alt="NPM Downloads" /></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# Create Nest Minimum Application
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Why
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
`nest new project-name` is so complete, we may need a simple and lightweight application.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## Scaffolding Your Nest Project
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
> **Compatibility Note:**
|
|
25
|
+
> Nest requires [Node.js](https://nodejs.org/en/) version 20+.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
With NPM:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm create nest-minimum@latest
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
With Yarn:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
yarn create nest-minimum
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
With PNPM:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pnpm create nest-minimum
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Then follow the prompts!
|
|
47
|
+
|
|
48
|
+
You can also directly specify the project name and the target directory handled method you want to use via additional command line options. run:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# npm 7+, extra double-dash is needed:
|
|
52
|
+
npm create nest-minimum@latest my-nest-app -- --overwrite
|
|
53
|
+
|
|
54
|
+
# yarn
|
|
55
|
+
yarn create nest-minimum my-nest-app --overwrite
|
|
56
|
+
|
|
57
|
+
# pnpm
|
|
58
|
+
pnpm create nest-minimum my-nest-app --overwrite
|
|
59
|
+
```
|
package/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
require('./dist/index.mjs')
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
require('./dist/index.mjs')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nest-minimum",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"description": "A create nest minimum app cli tool.",
|
|
5
5
|
"author": "YanluPei",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"@peiyanlu/cli-tools": "^0.0.1"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@release-it/conventional-changelog": "^10.0.
|
|
20
|
+
"@release-it/conventional-changelog": "^10.0.4",
|
|
21
21
|
"release-it-pnpm": "^4.6.6",
|
|
22
|
-
"@types/node": "^24.10.
|
|
23
|
-
"release-it": "^19.
|
|
22
|
+
"@types/node": "^24.10.4",
|
|
23
|
+
"release-it": "^19.2.2",
|
|
24
24
|
"typescript": "^5.9.3",
|
|
25
|
-
"vitest": "^4.0.
|
|
26
|
-
"tsdown": "^0.18.
|
|
27
|
-
"@vitest/coverage-v8": "^4.0.
|
|
25
|
+
"vitest": "^4.0.16",
|
|
26
|
+
"tsdown": "^0.18.4",
|
|
27
|
+
"@vitest/coverage-v8": "^4.0.16"
|
|
28
28
|
},
|
|
29
29
|
"private": false,
|
|
30
30
|
"engines": {
|
package/template/README.md
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
# $PACKAGE_NAME
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
$DESCRIPTION
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Project setup
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
$ $INSTALL
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Compile and run the project
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
# development
|
|
17
|
-
$ $RUN start
|
|
18
|
-
|
|
19
|
-
# watch mode
|
|
20
|
-
$ $RUN start:dev
|
|
21
|
-
|
|
22
|
-
# debug mode
|
|
23
|
-
$ $RUN start:debug
|
|
24
|
-
|
|
25
|
-
# production mode
|
|
26
|
-
$ $RUN start:prod
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
$START
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
## Run tests
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
# unit tests
|
|
36
|
-
$ $RUN test
|
|
37
|
-
|
|
38
|
-
# e2e tests
|
|
39
|
-
$ $RUN test:e2e
|
|
40
|
-
|
|
41
|
-
# test coverage
|
|
42
|
-
$ $RUN test:cov
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
$END
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
## Resources
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Check out a few resources that may come in handy when working with NestJS:
|
|
52
|
-
|
|
53
|
-
- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
|
|
54
|
-
- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
|
|
55
|
-
- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
|
|
56
|
-
- Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks.
|
|
57
|
-
- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
|
|
58
|
-
- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
|
|
59
|
-
- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
|
|
60
|
-
- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).
|
|
1
|
+
# $PACKAGE_NAME
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
$DESCRIPTION
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## Project setup
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
$ $INSTALL
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Compile and run the project
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# development
|
|
17
|
+
$ $RUN start
|
|
18
|
+
|
|
19
|
+
# watch mode
|
|
20
|
+
$ $RUN start:dev
|
|
21
|
+
|
|
22
|
+
# debug mode
|
|
23
|
+
$ $RUN start:debug
|
|
24
|
+
|
|
25
|
+
# production mode
|
|
26
|
+
$ $RUN start:prod
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
$START
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## Run tests
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# unit tests
|
|
36
|
+
$ $RUN test
|
|
37
|
+
|
|
38
|
+
# e2e tests
|
|
39
|
+
$ $RUN test:e2e
|
|
40
|
+
|
|
41
|
+
# test coverage
|
|
42
|
+
$ $RUN test:cov
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
$END
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## Resources
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
Check out a few resources that may come in handy when working with NestJS:
|
|
52
|
+
|
|
53
|
+
- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
|
|
54
|
+
- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
|
|
55
|
+
- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
|
|
56
|
+
- Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks.
|
|
57
|
+
- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
|
|
58
|
+
- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
|
|
59
|
+
- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
|
|
60
|
+
- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).
|
package/template/_gitignore
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
# Logs
|
|
2
|
-
logs
|
|
3
|
-
*.log
|
|
4
|
-
npm-debug.log*
|
|
5
|
-
yarn-debug.log*
|
|
6
|
-
yarn-error.log*
|
|
7
|
-
pnpm-debug.log*
|
|
8
|
-
lerna-debug.log*
|
|
9
|
-
|
|
10
|
-
/node_modules
|
|
11
|
-
/dist
|
|
12
|
-
|
|
13
|
-
# Editor directories and files
|
|
14
|
-
.vscode/*
|
|
15
|
-
!.vscode/extensions.json
|
|
16
|
-
.idea
|
|
17
|
-
.DS_Store
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
pnpm-debug.log*
|
|
8
|
+
lerna-debug.log*
|
|
9
|
+
|
|
10
|
+
/node_modules
|
|
11
|
+
/dist
|
|
12
|
+
|
|
13
|
+
# Editor directories and files
|
|
14
|
+
.vscode/*
|
|
15
|
+
!.vscode/extensions.json
|
|
16
|
+
.idea
|
|
17
|
+
.DS_Store
|
package/template/nest-cli.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/nest-cli",
|
|
3
|
-
"collection": "@nestjs/schematics",
|
|
4
|
-
"sourceRoot": "src",
|
|
5
|
-
"generateOptions": {
|
|
6
|
-
"spec": false
|
|
7
|
-
},
|
|
8
|
-
"compilerOptions": {
|
|
9
|
-
"deleteOutDir": true,
|
|
10
|
-
"assets": [
|
|
11
|
-
{
|
|
12
|
-
"include": "static",
|
|
13
|
-
"outDir": "dist",
|
|
14
|
-
"watchAssets": true
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"include": "config/.env",
|
|
18
|
-
"outDir": "dist",
|
|
19
|
-
"watchAssets": true
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"tsConfigPath": "./tsconfig.build.json"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/nest-cli",
|
|
3
|
+
"collection": "@nestjs/schematics",
|
|
4
|
+
"sourceRoot": "src",
|
|
5
|
+
"generateOptions": {
|
|
6
|
+
"spec": false
|
|
7
|
+
},
|
|
8
|
+
"compilerOptions": {
|
|
9
|
+
"deleteOutDir": true,
|
|
10
|
+
"assets": [
|
|
11
|
+
{
|
|
12
|
+
"include": "static",
|
|
13
|
+
"outDir": "dist",
|
|
14
|
+
"watchAssets": true
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"include": "config/.env",
|
|
18
|
+
"outDir": "dist",
|
|
19
|
+
"watchAssets": true
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"tsConfigPath": "./tsconfig.build.json"
|
|
23
|
+
}
|
|
24
|
+
}
|
package/template/package.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "nest-minimum-app-template",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "A nest minimum app template.",
|
|
5
|
-
"private": true,
|
|
6
|
-
"main": "dist/main.js",
|
|
7
|
-
"type": "commonjs",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"build": "nest build",
|
|
10
|
-
"start": "nest start",
|
|
11
|
-
"start:dev": "nest start --watch",
|
|
12
|
-
"start:debug": "nest start --debug --watch",
|
|
13
|
-
"start:prod": "node dist/main.js"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@nestjs/common": "^11.1.
|
|
17
|
-
"@nestjs/core": "^11.1.
|
|
18
|
-
"@nestjs/platform-express": "^11.1.
|
|
19
|
-
"@nestjs/platform-fastify": "^11.1.
|
|
20
|
-
"reflect-metadata": "^0.2.2"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@nestjs/cli": "^11.0.14",
|
|
24
|
-
"@nestjs/testing": "^11.1.
|
|
25
|
-
"@swc/cli": "^0.7.9",
|
|
26
|
-
"@swc/core": "^1.15.
|
|
27
|
-
"@types/node": "^24.10.
|
|
28
|
-
"@types/supertest": "^6.0.3",
|
|
29
|
-
"@vitest/coverage-v8": "^4.0.
|
|
30
|
-
"supertest": "^7.1.4",
|
|
31
|
-
"typescript": "^5.9.3",
|
|
32
|
-
"unplugin-swc": "^1.5.9",
|
|
33
|
-
"vitest": "^4.0.
|
|
34
|
-
},
|
|
35
|
-
"engines": {
|
|
36
|
-
"node": ">=20.19.6"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "nest-minimum-app-template",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A nest minimum app template.",
|
|
5
|
+
"private": true,
|
|
6
|
+
"main": "dist/main.js",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "nest build",
|
|
10
|
+
"start": "nest start",
|
|
11
|
+
"start:dev": "nest start --watch",
|
|
12
|
+
"start:debug": "nest start --debug --watch",
|
|
13
|
+
"start:prod": "node dist/main.js"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@nestjs/common": "^11.1.11",
|
|
17
|
+
"@nestjs/core": "^11.1.11",
|
|
18
|
+
"@nestjs/platform-express": "^11.1.11",
|
|
19
|
+
"@nestjs/platform-fastify": "^11.1.11",
|
|
20
|
+
"reflect-metadata": "^0.2.2"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@nestjs/cli": "^11.0.14",
|
|
24
|
+
"@nestjs/testing": "^11.1.11",
|
|
25
|
+
"@swc/cli": "^0.7.9",
|
|
26
|
+
"@swc/core": "^1.15.8",
|
|
27
|
+
"@types/node": "^24.10.4",
|
|
28
|
+
"@types/supertest": "^6.0.3",
|
|
29
|
+
"@vitest/coverage-v8": "^4.0.16",
|
|
30
|
+
"supertest": "^7.1.4",
|
|
31
|
+
"typescript": "^5.9.3",
|
|
32
|
+
"unplugin-swc": "^1.5.9",
|
|
33
|
+
"vitest": "^4.0.16"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=20.19.6"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Test, TestingModule } from '@nestjs/testing'
|
|
2
|
-
import { AppController } from './app.controller'
|
|
3
|
-
import { AppService } from './app.service'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
describe('AppController', () => {
|
|
7
|
-
let appController: AppController
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
const app: TestingModule = await Test.createTestingModule({
|
|
11
|
-
controllers: [ AppController ],
|
|
12
|
-
providers: [ AppService ],
|
|
13
|
-
}).compile()
|
|
14
|
-
|
|
15
|
-
appController = app.get<AppController>(AppController)
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
describe('root', () => {
|
|
19
|
-
it('should return "Hello World!"', () => {
|
|
20
|
-
expect(appController.getHello()).toBe('Hello World!')
|
|
21
|
-
})
|
|
22
|
-
})
|
|
23
|
-
})
|
|
1
|
+
import { Test, TestingModule } from '@nestjs/testing'
|
|
2
|
+
import { AppController } from './app.controller'
|
|
3
|
+
import { AppService } from './app.service'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
describe('AppController', () => {
|
|
7
|
+
let appController: AppController
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
const app: TestingModule = await Test.createTestingModule({
|
|
11
|
+
controllers: [ AppController ],
|
|
12
|
+
providers: [ AppService ],
|
|
13
|
+
}).compile()
|
|
14
|
+
|
|
15
|
+
appController = app.get<AppController>(AppController)
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
describe('root', () => {
|
|
19
|
+
it('should return "Hello World!"', () => {
|
|
20
|
+
expect(appController.getHello()).toBe('Hello World!')
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
})
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Controller, Get } from '@nestjs/common'
|
|
2
|
-
import { AppService } from './app.service'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
@Controller()
|
|
6
|
-
export class AppController {
|
|
7
|
-
constructor(private readonly appService: AppService) {}
|
|
8
|
-
|
|
9
|
-
@Get()
|
|
10
|
-
getHello() {
|
|
11
|
-
return this.appService.getHello()
|
|
12
|
-
}
|
|
13
|
-
}
|
|
1
|
+
import { Controller, Get } from '@nestjs/common'
|
|
2
|
+
import { AppService } from './app.service'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@Controller()
|
|
6
|
+
export class AppController {
|
|
7
|
+
constructor(private readonly appService: AppService) {}
|
|
8
|
+
|
|
9
|
+
@Get()
|
|
10
|
+
getHello() {
|
|
11
|
+
return this.appService.getHello()
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Module } from '@nestjs/common'
|
|
2
|
-
import { AppController } from './app.controller'
|
|
3
|
-
import { AppService } from './app.service'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@Module({
|
|
7
|
-
imports: [],
|
|
8
|
-
controllers: [ AppController ],
|
|
9
|
-
providers: [ AppService ],
|
|
10
|
-
})
|
|
11
|
-
export class AppModule {}
|
|
1
|
+
import { Module } from '@nestjs/common'
|
|
2
|
+
import { AppController } from './app.controller'
|
|
3
|
+
import { AppService } from './app.service'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@Module({
|
|
7
|
+
imports: [],
|
|
8
|
+
controllers: [ AppController ],
|
|
9
|
+
providers: [ AppService ],
|
|
10
|
+
})
|
|
11
|
+
export class AppModule {}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
@Injectable()
|
|
5
|
-
export class AppService {
|
|
6
|
-
getHello() {
|
|
7
|
-
return 'Hello World!'
|
|
8
|
-
}
|
|
9
|
-
}
|
|
1
|
+
import { Injectable } from '@nestjs/common'
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@Injectable()
|
|
5
|
+
export class AppService {
|
|
6
|
+
getHello() {
|
|
7
|
+
return 'Hello World!'
|
|
8
|
+
}
|
|
9
|
+
}
|
package/template/src/express.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { NestFactory } from '@nestjs/core'
|
|
2
|
-
import { AppModule } from './app.module'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const bootstrap = async (port: number | string) => {
|
|
6
|
-
const app = await NestFactory.create(AppModule)
|
|
7
|
-
await app.listen(port)
|
|
8
|
-
|
|
9
|
-
console.log(`\nApplication is running on: ${ await app.getUrl() }`)
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
bootstrap(process.env.PORT ?? 3000).catch(console.error)
|
|
1
|
+
import { NestFactory } from '@nestjs/core'
|
|
2
|
+
import { AppModule } from './app.module'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const bootstrap = async (port: number | string) => {
|
|
6
|
+
const app = await NestFactory.create(AppModule)
|
|
7
|
+
await app.listen(port)
|
|
8
|
+
|
|
9
|
+
console.log(`\nApplication is running on: ${ await app.getUrl() }`)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
bootstrap(process.env.PORT ?? 3000).catch(console.error)
|
package/template/src/fastify.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { NestFactory } from '@nestjs/core'
|
|
2
|
-
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify'
|
|
3
|
-
import { AppModule } from './app.module'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const bootstrap = async (port: number | string) => {
|
|
7
|
-
const app = await NestFactory.create<NestFastifyApplication>(
|
|
8
|
-
AppModule,
|
|
9
|
-
new FastifyAdapter(),
|
|
10
|
-
)
|
|
11
|
-
await app.listen(port)
|
|
12
|
-
|
|
13
|
-
console.log(`\nApplication is running on: ${ await app.getUrl() }`)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
bootstrap(process.env.PORT ?? 3000).catch(console.error)
|
|
1
|
+
import { NestFactory } from '@nestjs/core'
|
|
2
|
+
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify'
|
|
3
|
+
import { AppModule } from './app.module'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const bootstrap = async (port: number | string) => {
|
|
7
|
+
const app = await NestFactory.create<NestFastifyApplication>(
|
|
8
|
+
AppModule,
|
|
9
|
+
new FastifyAdapter(),
|
|
10
|
+
)
|
|
11
|
+
await app.listen(port)
|
|
12
|
+
|
|
13
|
+
console.log(`\nApplication is running on: ${ await app.getUrl() }`)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
bootstrap(process.env.PORT ?? 3000).catch(console.error)
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { INestApplication } from '@nestjs/common'
|
|
2
|
-
import { Test, TestingModule } from '@nestjs/testing'
|
|
3
|
-
import request from 'supertest'
|
|
4
|
-
import { App } from 'supertest/types'
|
|
5
|
-
import { AppModule } from '../src/app.module'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
describe('AppController (e2e)', () => {
|
|
9
|
-
let app: INestApplication<App>
|
|
10
|
-
|
|
11
|
-
beforeEach(async () => {
|
|
12
|
-
const moduleFixture: TestingModule = await Test.createTestingModule({
|
|
13
|
-
imports: [ AppModule ],
|
|
14
|
-
}).compile()
|
|
15
|
-
|
|
16
|
-
app = moduleFixture.createNestApplication()
|
|
17
|
-
await app.init()
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
it('/ (GET)', () => {
|
|
21
|
-
return request(app.getHttpServer())
|
|
22
|
-
.get('/')
|
|
23
|
-
.expect(200)
|
|
24
|
-
.expect('Hello World!')
|
|
25
|
-
})
|
|
26
|
-
})
|
|
1
|
+
import { INestApplication } from '@nestjs/common'
|
|
2
|
+
import { Test, TestingModule } from '@nestjs/testing'
|
|
3
|
+
import request from 'supertest'
|
|
4
|
+
import { App } from 'supertest/types'
|
|
5
|
+
import { AppModule } from '../src/app.module'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
describe('AppController (e2e)', () => {
|
|
9
|
+
let app: INestApplication<App>
|
|
10
|
+
|
|
11
|
+
beforeEach(async () => {
|
|
12
|
+
const moduleFixture: TestingModule = await Test.createTestingModule({
|
|
13
|
+
imports: [ AppModule ],
|
|
14
|
+
}).compile()
|
|
15
|
+
|
|
16
|
+
app = moduleFixture.createNestApplication()
|
|
17
|
+
await app.init()
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it('/ (GET)', () => {
|
|
21
|
+
return request(app.getHttpServer())
|
|
22
|
+
.get('/')
|
|
23
|
+
.expect(200)
|
|
24
|
+
.expect('Hello World!')
|
|
25
|
+
})
|
|
26
|
+
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"exclude": [
|
|
4
|
-
"node_modules",
|
|
5
|
-
"test",
|
|
6
|
-
"dist",
|
|
7
|
-
"**/*spec.ts"
|
|
8
|
-
]
|
|
9
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"exclude": [
|
|
4
|
+
"node_modules",
|
|
5
|
+
"test",
|
|
6
|
+
"dist",
|
|
7
|
+
"**/*spec.ts"
|
|
8
|
+
]
|
|
9
|
+
}
|
package/template/tsconfig.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "CommonJS",
|
|
4
|
-
"declaration": true,
|
|
5
|
-
"removeComments": true,
|
|
6
|
-
"emitDecoratorMetadata": true,
|
|
7
|
-
"experimentalDecorators": true,
|
|
8
|
-
"allowSyntheticDefaultImports": true,
|
|
9
|
-
"target": "ESNext",
|
|
10
|
-
"sourceMap": false,
|
|
11
|
-
"outDir": "./dist",
|
|
12
|
-
"baseUrl": "./",
|
|
13
|
-
"incremental": true,
|
|
14
|
-
"skipLibCheck": true,
|
|
15
|
-
"strictNullChecks": true,
|
|
16
|
-
"forceConsistentCasingInFileNames": true,
|
|
17
|
-
"noImplicitAny": false,
|
|
18
|
-
"strictBindCallApply": false,
|
|
19
|
-
"noFallthroughCasesInSwitch": false,
|
|
20
|
-
"moduleResolution": "node",
|
|
21
|
-
"esModuleInterop": true
|
|
22
|
-
}
|
|
23
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "CommonJS",
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"removeComments": true,
|
|
6
|
+
"emitDecoratorMetadata": true,
|
|
7
|
+
"experimentalDecorators": true,
|
|
8
|
+
"allowSyntheticDefaultImports": true,
|
|
9
|
+
"target": "ESNext",
|
|
10
|
+
"sourceMap": false,
|
|
11
|
+
"outDir": "./dist",
|
|
12
|
+
"baseUrl": "./",
|
|
13
|
+
"incremental": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"strictNullChecks": true,
|
|
16
|
+
"forceConsistentCasingInFileNames": true,
|
|
17
|
+
"noImplicitAny": false,
|
|
18
|
+
"strictBindCallApply": false,
|
|
19
|
+
"noFallthroughCasesInSwitch": false,
|
|
20
|
+
"moduleResolution": "node",
|
|
21
|
+
"esModuleInterop": true
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
const suite: typeof import('vitest')['suite']
|
|
3
|
-
const test: typeof import('vitest')['test']
|
|
4
|
-
const describe: typeof import('vitest')['describe']
|
|
5
|
-
const it: typeof import('vitest')['it']
|
|
6
|
-
const expectTypeOf: typeof import('vitest')['expectTypeOf']
|
|
7
|
-
const assertType: typeof import('vitest')['assertType']
|
|
8
|
-
const expect: typeof import('vitest')['expect']
|
|
9
|
-
const assert: typeof import('vitest')['assert']
|
|
10
|
-
const vitest: typeof import('vitest')['vitest']
|
|
11
|
-
const vi: typeof import('vitest')['vitest']
|
|
12
|
-
const beforeAll: typeof import('vitest')['beforeAll']
|
|
13
|
-
const afterAll: typeof import('vitest')['afterAll']
|
|
14
|
-
const beforeEach: typeof import('vitest')['beforeEach']
|
|
15
|
-
const afterEach: typeof import('vitest')['afterEach']
|
|
16
|
-
const onTestFailed: typeof import('vitest')['onTestFailed']
|
|
17
|
-
const onTestFinished: typeof import('vitest')['onTestFinished']
|
|
18
|
-
}
|
|
19
|
-
export {}
|
|
1
|
+
declare global {
|
|
2
|
+
const suite: typeof import('vitest')['suite']
|
|
3
|
+
const test: typeof import('vitest')['test']
|
|
4
|
+
const describe: typeof import('vitest')['describe']
|
|
5
|
+
const it: typeof import('vitest')['it']
|
|
6
|
+
const expectTypeOf: typeof import('vitest')['expectTypeOf']
|
|
7
|
+
const assertType: typeof import('vitest')['assertType']
|
|
8
|
+
const expect: typeof import('vitest')['expect']
|
|
9
|
+
const assert: typeof import('vitest')['assert']
|
|
10
|
+
const vitest: typeof import('vitest')['vitest']
|
|
11
|
+
const vi: typeof import('vitest')['vitest']
|
|
12
|
+
const beforeAll: typeof import('vitest')['beforeAll']
|
|
13
|
+
const afterAll: typeof import('vitest')['afterAll']
|
|
14
|
+
const beforeEach: typeof import('vitest')['beforeEach']
|
|
15
|
+
const afterEach: typeof import('vitest')['afterEach']
|
|
16
|
+
const onTestFailed: typeof import('vitest')['onTestFailed']
|
|
17
|
+
const onTestFinished: typeof import('vitest')['onTestFinished']
|
|
18
|
+
}
|
|
19
|
+
export {}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import swc from 'unplugin-swc'
|
|
2
|
-
import { defineConfig } from 'vitest/config'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
test: {
|
|
7
|
-
globals: true,
|
|
8
|
-
root: './',
|
|
9
|
-
alias: {
|
|
10
|
-
'@src': './src',
|
|
11
|
-
'@test': './test',
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
resolve: {
|
|
15
|
-
alias: {
|
|
16
|
-
'@src': './src',
|
|
17
|
-
'@test': './test',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
plugins: [
|
|
21
|
-
swc.vite({
|
|
22
|
-
module: { type: 'es6' },
|
|
23
|
-
}),
|
|
24
|
-
],
|
|
25
|
-
})
|
|
1
|
+
import swc from 'unplugin-swc'
|
|
2
|
+
import { defineConfig } from 'vitest/config'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
test: {
|
|
7
|
+
globals: true,
|
|
8
|
+
root: './',
|
|
9
|
+
alias: {
|
|
10
|
+
'@src': './src',
|
|
11
|
+
'@test': './test',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
resolve: {
|
|
15
|
+
alias: {
|
|
16
|
+
'@src': './src',
|
|
17
|
+
'@test': './test',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
plugins: [
|
|
21
|
+
swc.vite({
|
|
22
|
+
module: { type: 'es6' },
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
})
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineConfig, mergeConfig } from 'vitest/config'
|
|
2
|
-
import baseConfig from './vitest.config.base.mjs'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default mergeConfig(
|
|
6
|
-
baseConfig,
|
|
7
|
-
defineConfig({
|
|
8
|
-
test: {
|
|
9
|
-
include: [ '**/*.e2e-{test,spec}.{ts,mts}' ],
|
|
10
|
-
},
|
|
11
|
-
}),
|
|
12
|
-
)
|
|
1
|
+
import { defineConfig, mergeConfig } from 'vitest/config'
|
|
2
|
+
import baseConfig from './vitest.config.base.mjs'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default mergeConfig(
|
|
6
|
+
baseConfig,
|
|
7
|
+
defineConfig({
|
|
8
|
+
test: {
|
|
9
|
+
include: [ '**/*.e2e-{test,spec}.{ts,mts}' ],
|
|
10
|
+
},
|
|
11
|
+
}),
|
|
12
|
+
)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineConfig, mergeConfig } from 'vitest/config'
|
|
2
|
-
import baseConfig from './vitest.config.base.mjs'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default mergeConfig(
|
|
6
|
-
baseConfig,
|
|
7
|
-
defineConfig({
|
|
8
|
-
test: {
|
|
9
|
-
include: [ '**/test/**/*.{test,spec}.{ts,mts}' ],
|
|
10
|
-
coverage: {
|
|
11
|
-
provider: 'v8',
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
}),
|
|
15
|
-
)
|
|
1
|
+
import { defineConfig, mergeConfig } from 'vitest/config'
|
|
2
|
+
import baseConfig from './vitest.config.base.mjs'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default mergeConfig(
|
|
6
|
+
baseConfig,
|
|
7
|
+
defineConfig({
|
|
8
|
+
test: {
|
|
9
|
+
include: [ '**/test/**/*.{test,spec}.{ts,mts}' ],
|
|
10
|
+
coverage: {
|
|
11
|
+
provider: 'v8',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
}),
|
|
15
|
+
)
|