Skip to content

Commit 8769a9d

Browse files
committed
Merge branch 'master' into fix-global-prefix-middleware
2 parents 16106e0 + 7f00840 commit 8769a9d

File tree

262 files changed

+109180
-78148
lines changed

Some content is hidden

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

262 files changed

+109180
-78148
lines changed

.circleci/config.yml

+104-58
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,31 @@
1-
version: 2
1+
version: 2.1
2+
3+
parameters:
4+
check-legacy-node-version:
5+
type: boolean
6+
default: false
7+
legacy-node-version:
8+
type: string
9+
default: '14.21.3'
10+
maintenance-node-version:
11+
type: string
12+
default: '16.20'
13+
active-node-version:
14+
type: string
15+
default: '18.17'
16+
current-node-version:
17+
type: string
18+
default: '20.5'
219

320
aliases:
421
- &restore-cache
522
restore_cache:
623
key: dependency-cache-{{ checksum "package.json" }}
24+
- &save-cache
25+
save_cache:
26+
key: dependency-cache-{{ checksum "package.json" }}
27+
paths:
28+
- ./node_modules
729
- &install-deps
830
run:
931
name: Install dependencies
@@ -17,70 +39,89 @@ aliases:
1739
name: Test
1840
command: npm run test
1941

20-
unit-tests-template: &unit-tests-template
21-
working_directory: ~/nest
22-
steps:
23-
- checkout
24-
- *restore-cache
25-
- *install-deps
26-
- *build-packages
27-
- *run-unit-tests
28-
2942
jobs:
3043
build:
3144
working_directory: ~/nest
3245
docker:
33-
- image: cimg/node:16.20
46+
- image: cimg/node:<< pipeline.parameters.maintenance-node-version >>
3447
steps:
3548
- checkout
3649
- run:
3750
name: Update NPM version
38-
command: 'sudo npm install -g npm@^8'
39-
- restore_cache:
40-
key: dependency-cache-{{ checksum "package.json" }}
41-
- run:
42-
name: Install dependencies
43-
command: npm ci --legacy-peer-deps
44-
- save_cache:
45-
key: dependency-cache-{{ checksum "package.json" }}
46-
paths:
47-
- ./node_modules
48-
- run:
49-
name: Build
50-
command: npm run build
51-
52-
test_node_16:
53-
working_directory: ~/nest
54-
docker:
55-
- image: cimg/node:16.20
56-
steps:
57-
- checkout
51+
command: 'sudo npm install -g npm@^9'
5852
- *restore-cache
5953
- *install-deps
54+
- *save-cache
6055
- *build-packages
61-
- run:
62-
name: Test (coverage)
63-
command: npm run test:cov
64-
- run:
65-
name: Collect coverage
66-
command: npm run coverage
67-
- store_artifacts:
68-
path: coverage
69-
70-
test_node_18:
71-
<<: *unit-tests-template
72-
docker:
73-
- image: cimg/node:18.16
7456

75-
test_node_19:
76-
<<: *unit-tests-template
57+
test:
58+
parameters:
59+
node-version:
60+
type: string
61+
working_directory: ~/nest
7762
docker:
78-
- image: cimg/node:19.9
63+
- image: cimg/node:<< parameters.node-version >>
64+
steps:
65+
- when:
66+
condition:
67+
and:
68+
- equal:
69+
[
70+
'<< parameters.node-version >>',
71+
'<< pipeline.parameters.legacy-node-version >>',
72+
]
73+
- not: << pipeline.parameters.check-legacy-node-version >>
74+
steps:
75+
- run:
76+
name: Skip
77+
command: |
78+
echo Skipping
79+
- when:
80+
condition:
81+
or:
82+
- not:
83+
equal:
84+
[
85+
'<< parameters.node-version >>',
86+
'<< pipeline.parameters.legacy-node-version >>',
87+
]
88+
- << pipeline.parameters.check-legacy-node-version >>
89+
steps:
90+
- checkout
91+
- *restore-cache
92+
- *install-deps
93+
- *build-packages
94+
- when:
95+
condition:
96+
equal:
97+
[
98+
'<< parameters.node-version >>',
99+
'<< pipeline.parameters.maintenance-node-version >>',
100+
]
101+
steps:
102+
- run:
103+
name: Test (coverage)
104+
command: npm run test:cov
105+
- run:
106+
name: Collect coverage
107+
command: npm run coverage
108+
- store_artifacts:
109+
path: coverage
110+
- when:
111+
condition:
112+
not:
113+
equal:
114+
[
115+
'<< parameters.node-version >>',
116+
'<< pipeline.parameters.maintenance-node-version >>',
117+
]
118+
steps:
119+
- *run-unit-tests
79120

80121
lint:
81122
working_directory: ~/nest
82123
docker:
83-
- image: circleci/node:16
124+
- image: cimg/node:<< pipeline.parameters.maintenance-node-version >>
84125
steps:
85126
- checkout
86127
- *restore-cache
@@ -105,9 +146,9 @@ jobs:
105146
- run:
106147
name: Upgrade Node.js
107148
command: |
108-
nvm install v16
149+
nvm install << pipeline.parameters.maintenance-node-version >>
109150
node -v
110-
nvm alias default v16
151+
nvm alias default << pipeline.parameters.maintenance-node-version >>
111152
- run:
112153
name: Install Docker Compose
113154
command: |
@@ -130,7 +171,7 @@ jobs:
130171
codechecks_benchmarks:
131172
working_directory: ~/nest
132173
docker:
133-
- image: cimg/node:16.20
174+
- image: cimg/node:<< pipeline.parameters.maintenance-node-version >>
134175
steps:
135176
- checkout
136177
- *restore-cache
@@ -146,9 +187,9 @@ jobs:
146187
samples:
147188
working_directory: ~/nest
148189
docker:
149-
- image: cimg/node:16.20
190+
- image: cimg/node:<< pipeline.parameters.maintenance-node-version >>
150191
environment:
151-
- DISABLE_OPENCOLLECTIVE: true
192+
DISABLE_OPENCOLLECTIVE: 'true'
152193
steps:
153194
- checkout
154195
- *restore-cache
@@ -158,16 +199,21 @@ jobs:
158199
command: npm run build:samples
159200

160201
workflows:
161-
version: 2
162202
build-and-test:
163203
jobs:
164204
- build
165-
- test_node_16:
166-
requires:
167-
- build
168-
- test_node_18:
205+
- test:
169206
requires:
170207
- build
208+
matrix:
209+
parameters:
210+
node-version:
211+
[
212+
'<< pipeline.parameters.legacy-node-version >>',
213+
'<< pipeline.parameters.maintenance-node-version >>',
214+
'<< pipeline.parameters.active-node-version >>',
215+
'<< pipeline.parameters.current-node-version >>',
216+
]
171217
- lint:
172218
requires:
173219
- build

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module.exports = {
2323
'@typescript-eslint/explicit-module-boundary-types': 'off',
2424
'@typescript-eslint/no-unused-vars': 'off',
2525
'@typescript-eslint/ban-types': 'off',
26+
'@typescript-eslint/no-array-constructor': 'off',
2627
},
2728
},
2829
{

.github/ISSUE_TEMPLATE/Bug_report.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,17 @@ body:
3838
required: true
3939
attributes:
4040
label: "Minimum reproduction code"
41-
description: "An URL to some Git repository/[StackBlitz](https://stackblitz.com/fork/github/nestjs/typescript-starter)/[CodeSandbox](https://codesandbox.io/s/github/nestjs/typescript-starter/tree/master) project that reproduces your issue. [Wtf is a minimum reproduction?](https://jmcdo29.github.io/wtf-is-a-minimum-reproduction)"
41+
description: |
42+
An URL to some Git repository/[StackBlitz](https://stackblitz.com/fork/github/nestjs/typescript-starter)/[CodeSandbox](https://codesandbox.io/s/github/nestjs/typescript-starter/tree/master) project that reproduces your issue. [What is a minimum reproduction?](https://jmcdo29.github.io/wtf-is-a-minimum-reproduction)
43+
:warning: **NOTE:** We can close this issue if we don't manage to reproduce your potential bug. [Here](https://antfu.me/posts/why-reproductions-are-required) is why.
4244
placeholder: "https://github.com/..."
4345

4446
- type: textarea
4547
attributes:
4648
label: "Steps to reproduce"
4749
description: |
4850
How the issue manifests?
49-
You could leave this blank if you alread write this in your reproduction code
51+
You could leave this blank if you already write this in your reproduction code
5052
placeholder: |
5153
1. `npm ci`
5254
2. `npm start:dev`

.github/workflows/codeql-analysis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- name: Checkout repository
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525
with:
2626
# We must fetch at least the immediate parents so that if this is
2727
# a pull request then we can checkout the head.
@@ -34,7 +34,7 @@ jobs:
3434

3535
# Initializes the CodeQL tools for scanning.
3636
- name: Initialize CodeQL
37-
uses: github/codeql-action/init@v2
37+
uses: github/codeql-action/init@v3
3838
with:
3939
queries: +security-extended
4040
# Override language selection by uncommenting this and choosing your languages
@@ -44,7 +44,7 @@ jobs:
4444
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
4545
# If this step fails, then you should remove it and run the build manually (see below)
4646
- name: Autobuild
47-
uses: github/codeql-action/autobuild@v2
47+
uses: github/codeql-action/autobuild@v3
4848

4949
# ℹ️ Command-line programs to run using the OS shell.
5050
# 📚 https://git.io/JvXDl
@@ -58,4 +58,4 @@ jobs:
5858
# make release
5959

6060
- name: Perform CodeQL Analysis
61-
uses: github/codeql-action/analyze@v2
61+
uses: github/codeql-action/analyze@v3

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ node_modules/
66
/.awcache
77
/.vscode
88
/.devcontainer
9+
/.classpath
10+
/.project
11+
/.settings
912
*.code-workspace
1013

1114
# Vim

.husky/commit-msg

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx --no-install commitlint --edit $1

.husky/pre-commit

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx lint-staged

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ You will need [Node.js](https://nodejs.org) version >= 10.13.0 (except for v13).
164164
1. After cloning the repo, run:
165165
166166
```bash
167-
$ npm ci # (or yarn install)
167+
$ npm ci --legacy-peer-deps # (or yarn install)
168168
```
169169
170170
2. In order to prepare your environment run `prepare.sh` shell script:

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(The MIT License)
22

3-
Copyright (c) 2017-2023 Kamil Mysliwiec <https://kamilmysliwiec.com>
3+
Copyright (c) 2017-2024 Kamil Mysliwiec <https://kamilmysliwiec.com>
44

55
Permission is hereby granted, free of charge, to any person obtaining
66
a copy of this software and associated documentation files (the

0 commit comments

Comments
 (0)