@leo-h/create-nodejs-app 1.0.30 → 1.0.32
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/package.json +14 -14
- package/templates/clean/package.json +12 -12
- package/templates/clean/pnpm-lock.yaml +222 -494
- package/templates/fastify/.env.example +1 -4
- package/templates/fastify/.lintstagedrc.json +2 -2
- package/templates/fastify/.prettierignore +0 -2
- package/templates/fastify/.swcrc +19 -0
- package/templates/fastify/gitignore +8 -111
- package/templates/fastify/package.json +28 -40
- package/templates/fastify/pnpm-lock.yaml +1704 -3725
- package/templates/fastify/src/core/create-controller-response-schema.ts +74 -0
- package/templates/fastify/src/core/schema.ts +17 -0
- package/templates/fastify/src/env.ts +49 -0
- package/templates/fastify/src/{infra/http → http}/app.ts +13 -19
- package/templates/fastify/src/http/controllers/hello.controller.spec.ts +74 -0
- package/templates/fastify/src/http/controllers/hello.controller.ts +48 -0
- package/templates/fastify/src/http/errors.ts +89 -0
- package/templates/fastify/src/http/plugins/error-handler.plugin.ts +29 -0
- package/templates/fastify/src/http/plugins/not-found-error-handler.plugin.ts +5 -0
- package/templates/fastify/src/http/plugins/routes.plugin.ts +53 -0
- package/templates/fastify/src/http/plugins/swagger-ui.plugin.ts +32 -0
- package/templates/fastify/src/infra/http-server.ts +16 -0
- package/templates/fastify/test/integration/create-test-request.ts +30 -0
- package/templates/fastify/vitest.config.integration.mts +3 -2
- package/templates/fastify/vitest.config.mts +13 -2
- package/templates/nest/package.json +19 -19
- package/templates/nest/pnpm-lock.yaml +369 -377
- package/templates/react-vite/package.json +20 -20
- package/templates/react-vite/pnpm-lock.yaml +458 -972
- package/templates/fastify/build.config.ts +0 -56
- package/templates/fastify/src/core/domain-error.ts +0 -17
- package/templates/fastify/src/infra/env.ts +0 -22
- package/templates/fastify/src/infra/http/@types/fastify.d.ts +0 -16
- package/templates/fastify/src/infra/http/controllers/hello/hello-multipart.controller.integration-spec.ts +0 -35
- package/templates/fastify/src/infra/http/controllers/hello/hello-multipart.controller.ts +0 -65
- package/templates/fastify/src/infra/http/controllers/hello/hello.controller.integration-spec.ts +0 -38
- package/templates/fastify/src/infra/http/controllers/hello/hello.controller.ts +0 -40
- package/templates/fastify/src/infra/http/errors/bad-request.error.ts +0 -11
- package/templates/fastify/src/infra/http/errors/internal-server.error.ts +0 -13
- package/templates/fastify/src/infra/http/errors/upload-validation.error.ts +0 -21
- package/templates/fastify/src/infra/http/errors/validation.error.ts +0 -13
- package/templates/fastify/src/infra/http/plugins/error-handler.plugin.ts +0 -31
- package/templates/fastify/src/infra/http/plugins/handle-swagger-multipart.plugin.ts +0 -96
- package/templates/fastify/src/infra/http/plugins/require-upload.plugin.ts +0 -197
- package/templates/fastify/src/infra/http/routes.ts +0 -8
- package/templates/fastify/src/infra/presenters/error.presenter.ts +0 -13
- package/templates/fastify/src/infra/server.ts +0 -12
- package/templates/fastify/test/integration/sample-upload.jpg +0 -0
- package/templates/fastify/test/integration/setup.ts +0 -10
- package/templates/fastify/src/{infra/http/@types/fastify-zod-type-provider.ts → @types/fastify.ts} +1 -1
@@ -1,6 +1,3 @@
|
|
1
|
-
# example: "development" ("development" | "test" | "production")
|
2
|
-
NODE_ENV=
|
3
|
-
|
4
1
|
# example: "app-name"
|
5
2
|
API_NAME=
|
6
3
|
|
@@ -8,4 +5,4 @@ API_NAME=
|
|
8
5
|
API_PORT=
|
9
6
|
|
10
7
|
# example: "https://my-client-app.com" (url - only constraint | regex - specific constraint | "*" - not constraint)
|
11
|
-
API_ACCESS_PERMISSION_CLIENT_SIDE=
|
8
|
+
API_ACCESS_PERMISSION_CLIENT_SIDE=
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://swc.rs/schema.json",
|
3
|
+
"module": {
|
4
|
+
"type": "commonjs",
|
5
|
+
"strictMode": true
|
6
|
+
},
|
7
|
+
"jsc": {
|
8
|
+
"target": "esnext",
|
9
|
+
"parser": {
|
10
|
+
"syntax": "typescript",
|
11
|
+
"dynamicImport": true
|
12
|
+
},
|
13
|
+
"baseUrl": ".",
|
14
|
+
"paths": {
|
15
|
+
"@/*": ["./src/*"]
|
16
|
+
}
|
17
|
+
},
|
18
|
+
"minify": true
|
19
|
+
}
|
@@ -2,131 +2,28 @@
|
|
2
2
|
logs
|
3
3
|
*.log
|
4
4
|
npm-debug.log*
|
5
|
-
yarn-debug.log*
|
6
|
-
yarn-error.log*
|
7
|
-
lerna-debug.log*
|
8
5
|
.pnpm-debug.log*
|
9
6
|
|
10
|
-
#
|
11
|
-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
12
|
-
|
13
|
-
# Runtime data
|
14
|
-
pids
|
15
|
-
*.pid
|
16
|
-
*.seed
|
17
|
-
*.pid.lock
|
18
|
-
|
19
|
-
# Directory for instrumented libs generated by jscoverage/JSCover
|
20
|
-
lib-cov
|
21
|
-
|
22
|
-
# Coverage directory used by tools like istanbul
|
7
|
+
# Coverage directory
|
23
8
|
coverage
|
24
|
-
*.lcov
|
25
|
-
|
26
|
-
# nyc test coverage
|
27
|
-
.nyc_output
|
28
|
-
|
29
|
-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
30
|
-
.grunt
|
31
|
-
|
32
|
-
# Bower dependency directory (https://bower.io/)
|
33
|
-
bower_components
|
34
|
-
|
35
|
-
# node-waf configuration
|
36
|
-
.lock-wscript
|
37
|
-
|
38
|
-
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
39
|
-
build/Release
|
40
9
|
|
41
10
|
# Dependency directories
|
42
11
|
node_modules/
|
43
|
-
jspm_packages/
|
44
|
-
|
45
|
-
# Snowpack dependency directory (https://snowpack.dev/)
|
46
|
-
web_modules/
|
47
12
|
|
48
13
|
# TypeScript cache
|
49
14
|
*.tsbuildinfo
|
50
15
|
|
51
|
-
#
|
16
|
+
# npm cache directory
|
52
17
|
.npm
|
53
18
|
|
54
|
-
#
|
19
|
+
# Eslint cache
|
55
20
|
.eslintcache
|
56
21
|
|
57
|
-
#
|
58
|
-
.stylelintcache
|
59
|
-
|
60
|
-
# Microbundle cache
|
61
|
-
.rpt2_cache/
|
62
|
-
.rts2_cache_cjs/
|
63
|
-
.rts2_cache_es/
|
64
|
-
.rts2_cache_umd/
|
65
|
-
|
66
|
-
# Optional REPL history
|
67
|
-
.node_repl_history
|
68
|
-
|
69
|
-
# Output of 'npm pack'
|
70
|
-
*.tgz
|
71
|
-
|
72
|
-
# Yarn Integrity file
|
73
|
-
.yarn-integrity
|
74
|
-
|
75
|
-
# parcel-bundler cache (https://parceljs.org/)
|
76
|
-
.cache
|
77
|
-
.parcel-cache
|
78
|
-
|
79
|
-
# Next.js build output
|
80
|
-
.next
|
81
|
-
out
|
82
|
-
|
83
|
-
# Nuxt.js build / generate output
|
84
|
-
.nuxt
|
22
|
+
# Build
|
85
23
|
dist
|
86
24
|
|
87
|
-
#
|
88
|
-
.
|
89
|
-
# Comment in the public line in if your project uses Gatsby and not Next.js
|
90
|
-
# https://nextjs.org/blog/next-9-1#public-directory-support
|
91
|
-
# public
|
92
|
-
|
93
|
-
# vuepress build output
|
94
|
-
.vuepress/dist
|
95
|
-
|
96
|
-
# vuepress v2.x temp and cache directory
|
97
|
-
.temp
|
98
|
-
.cache
|
99
|
-
|
100
|
-
# Docusaurus cache and generated files
|
101
|
-
.docusaurus
|
102
|
-
|
103
|
-
# Serverless directories
|
104
|
-
.serverless/
|
105
|
-
|
106
|
-
# FuseBox cache
|
107
|
-
.fusebox/
|
108
|
-
|
109
|
-
# DynamoDB Local files
|
110
|
-
.dynamodb/
|
111
|
-
|
112
|
-
# TernJS port file
|
113
|
-
.tern-port
|
114
|
-
|
115
|
-
# Stores VSCode versions used for testing VSCode extensions
|
116
|
-
.vscode-test
|
117
|
-
|
118
|
-
# yarn v2
|
119
|
-
.yarn/cache
|
120
|
-
.yarn/unplugged
|
121
|
-
.yarn/build-state.yml
|
122
|
-
.yarn/install-state.gz
|
123
|
-
.pnp.*
|
124
|
-
|
125
|
-
# dotenv environment variable files
|
126
|
-
.env
|
127
|
-
.env.development
|
128
|
-
.env.test
|
129
|
-
.env.production
|
25
|
+
# Environment variable files
|
26
|
+
.env*
|
130
27
|
|
131
|
-
#
|
132
|
-
.DS_Store
|
28
|
+
# Misc
|
29
|
+
.DS_Store
|
@@ -4,57 +4,45 @@
|
|
4
4
|
"private": true,
|
5
5
|
"scripts": {
|
6
6
|
"prepare": "husky",
|
7
|
-
"start": "node ./dist/infra/server.js",
|
8
|
-
"start:dev": "tsx watch ./src/infra/server.ts",
|
7
|
+
"start": "node ./dist/src/infra/http-server.js",
|
8
|
+
"start:dev": "tsx watch ./src/infra/http-server.ts",
|
9
9
|
"typecheck": "tsc --noEmit",
|
10
10
|
"lint": "eslint . --max-warnings 0 --cache",
|
11
11
|
"lint:fix": "pnpm lint --fix",
|
12
12
|
"format": "prettier . --write --cache",
|
13
|
-
"test:unit": "vitest run",
|
14
|
-
"test:unit:watch": "vitest",
|
15
|
-
"test:unit:coverage": "vitest run --coverage.enabled=true",
|
16
|
-
"test:integration": "vitest run --config ./vitest.config.integration.mts",
|
17
|
-
"test:integration:watch": "vitest --config ./vitest.config.integration.mts",
|
18
|
-
"test:integration:coverage": "vitest run --config ./vitest.config.integration.mts --coverage.enabled=true",
|
19
13
|
"prebuild": "rimraf ./dist",
|
20
|
-
"build": "
|
14
|
+
"build": "swc ./src ./package.json --copy-files --out-dir ./dist",
|
15
|
+
"test:integration": "vitest run --config ./vitest.config.integration.mts",
|
16
|
+
"test:integration:watch": "vitest --config ./vitest.config.integration.mts"
|
21
17
|
},
|
22
18
|
"dependencies": {
|
23
|
-
"@fastify/cookie": "
|
24
|
-
"@fastify/cors": "
|
25
|
-
"@fastify/swagger": "
|
26
|
-
"@fastify/swagger-ui": "
|
19
|
+
"@fastify/cookie": "11.0.2",
|
20
|
+
"@fastify/cors": "11.0.1",
|
21
|
+
"@fastify/swagger": "9.4.2",
|
22
|
+
"@fastify/swagger-ui": "5.2.2",
|
27
23
|
"dotenv": "16.4.7",
|
28
|
-
"fastify": "
|
29
|
-
"fastify-
|
30
|
-
"
|
31
|
-
"mime-types": "2.1.35",
|
32
|
-
"pretty-bytes": "5.6.0",
|
33
|
-
"zod": "3.24.1",
|
34
|
-
"zod-validation-error": "3.4.0"
|
24
|
+
"fastify": "5.2.2",
|
25
|
+
"fastify-type-provider-zod": "4.0.2",
|
26
|
+
"zod": "3.24.2"
|
35
27
|
},
|
36
28
|
"devDependencies": {
|
37
|
-
"@eslint/js": "9.
|
38
|
-
"@faker-js/faker": "9.
|
39
|
-
"@
|
40
|
-
"@types/node": "22.
|
41
|
-
"@
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"eslint-config-prettier": "9.1.0",
|
46
|
-
"globals": "15.14.0",
|
29
|
+
"@eslint/js": "9.24.0",
|
30
|
+
"@faker-js/faker": "9.6.0",
|
31
|
+
"@swc/cli": "0.6.0",
|
32
|
+
"@types/node": "22.14.0",
|
33
|
+
"@vitest/eslint-plugin": "1.1.40",
|
34
|
+
"eslint": "9.24.0",
|
35
|
+
"eslint-config-prettier": "10.1.1",
|
36
|
+
"globals": "16.0.0",
|
47
37
|
"husky": "9.1.7",
|
48
|
-
"lint-staged": "15.
|
49
|
-
"prettier": "3.
|
38
|
+
"lint-staged": "15.5.0",
|
39
|
+
"prettier": "3.5.3",
|
50
40
|
"rimraf": "6.0.1",
|
51
|
-
"
|
52
|
-
"
|
53
|
-
"
|
54
|
-
"typescript": "
|
55
|
-
"
|
56
|
-
"
|
57
|
-
"vite-tsconfig-paths": "4.3.2",
|
58
|
-
"vitest": "1.6.1"
|
41
|
+
"tsx": "4.19.3",
|
42
|
+
"type-fest": "4.39.1",
|
43
|
+
"typescript": "5.8.3",
|
44
|
+
"typescript-eslint": "8.29.1",
|
45
|
+
"vite-tsconfig-paths": "5.1.4",
|
46
|
+
"vitest": "3.1.1"
|
59
47
|
}
|
60
48
|
}
|