Skip to content

Commit ccd16ac

Browse files
committed
Merge branch 'main' into next
# Conflicts: # docs/Reference/Server.md # fastify.js # package.json
2 parents bc60c42 + f9f0c9f commit ccd16ac

Some content is hidden

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

59 files changed

+518
-172
lines changed

.github/workflows/benchmark-parser.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
- name: Install
3535
run: |
36-
npm install --only=production --ignore-scripts
36+
npm install --ignore-scripts
3737
3838
- name: Run benchmark
3939
id: benchmark-pr
@@ -52,7 +52,7 @@ jobs:
5252

5353
- name: Install
5454
run: |
55-
npm install --only=production --ignore-scripts
55+
npm install --ignore-scripts
5656
5757
- name: Run benchmark
5858
id: benchmark-main
@@ -64,7 +64,8 @@ jobs:
6464
echo 'EOF' >> $GITHUB_OUTPUT
6565
6666
output-benchmark:
67-
needs: [benchmark]
67+
needs:
68+
- benchmark
6869
runs-on: ubuntu-latest
6970
permissions:
7071
pull-requests: write

.github/workflows/benchmark.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
- name: Install
3535
run: |
36-
npm install --only=production --ignore-scripts
36+
npm install --ignore-scripts
3737
3838
- name: Run benchmark
3939
id: benchmark-pr
@@ -52,7 +52,7 @@ jobs:
5252

5353
- name: Install
5454
run: |
55-
npm install --only=production --ignore-scripts
55+
npm install --ignore-scripts
5656
5757
- name: Run benchmark
5858
id: benchmark-main
@@ -64,7 +64,8 @@ jobs:
6464
echo 'EOF' >> $GITHUB_OUTPUT
6565
6666
output-benchmark:
67-
needs: [benchmark]
67+
needs:
68+
- benchmark
6869
runs-on: ubuntu-latest
6970
permissions:
7071
pull-requests: write
@@ -96,13 +97,15 @@ jobs:
9697
- benchmark
9798
- output-benchmark
9899
runs-on: ubuntu-latest
100+
permissions:
101+
pull-requests: write
99102
steps:
100103
- name: Remove benchmark label
101104
uses: octokit/[email protected]
102105
id: remove-label
103106
with:
104107
route: DELETE /repos/{repo}/issues/{issue_number}/labels/{name}
105-
repo: ${{ github.event.pull_request.head.repo.full_name }}
108+
repo: ${{ github.repository }}
106109
issue_number: ${{ github.event.pull_request.number }}
107110
name: benchmark
108111
env:
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: ci Alternative Runtimes
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- next
8+
- 'v*'
9+
paths-ignore:
10+
- 'docs/**'
11+
- '*.md'
12+
pull_request:
13+
paths-ignore:
14+
- 'docs/**'
15+
- '*.md'
16+
17+
# This allows a subsequently queued workflow run to interrupt previous runs
18+
concurrency:
19+
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
20+
cancel-in-progress: true
21+
22+
jobs:
23+
test-unit:
24+
runs-on: ${{ matrix.os }}
25+
permissions:
26+
contents: read
27+
strategy:
28+
matrix:
29+
node-version: [18, 20]
30+
os: [macos-latest, ubuntu-latest, windows-latest]
31+
include:
32+
- runtime: nsolid
33+
node-version: 18
34+
nsolid-version: 5
35+
- runtime: nsolid
36+
node-version: 20
37+
nsolid-version: 5
38+
steps:
39+
- uses: actions/checkout@v4
40+
with:
41+
persist-credentials: false
42+
43+
- uses: nodesource/setup-nsolid@v1
44+
if: ${{ matrix.runtime == 'nsolid' }}
45+
with:
46+
node-version: ${{ matrix.node-version }}
47+
nsolid-version: ${{ matrix.nsolid-version }}
48+
49+
- name: Install
50+
run: |
51+
npm install --ignore-scripts
52+
53+
- name: Run tests
54+
run: |
55+
npm run unit
56+
57+
test-typescript:
58+
runs-on: 'ubuntu-latest'
59+
permissions:
60+
contents: read
61+
62+
steps:
63+
- uses: actions/checkout@v4
64+
with:
65+
persist-credentials: false
66+
67+
- uses: nodesource/setup-nsolid@v1
68+
with:
69+
node-version: 20
70+
nsolid-version: 5
71+
72+
- name: Install
73+
run: |
74+
npm install --ignore-scripts
75+
76+
- name: Run typescript tests
77+
run: |
78+
npm run test:typescript
79+
env:
80+
NODE_OPTIONS: no-network-family-autoselection
81+
82+
package:
83+
needs:
84+
- test-typescript
85+
- test-unit
86+
runs-on: ubuntu-latest
87+
permissions:
88+
contents: read
89+
steps:
90+
- uses: actions/checkout@v4
91+
with:
92+
persist-credentials: false
93+
- uses: nodesource/setup-nsolid@v1
94+
with:
95+
nsolid-version: 5
96+
- name: install fastify
97+
run: |
98+
npm install --ignore-scripts
99+
- name: install webpack stack
100+
run: |
101+
cd test/bundler/webpack && npm install
102+
- name: Test webpack bundle
103+
run: |
104+
cd test/bundler/webpack && npm run test
105+
- name: install esbuild stack
106+
run: |
107+
cd test/bundler/esbuild && npm install
108+
- name: Test esbuild bundle
109+
run: |
110+
cd test/bundler/esbuild && npm run test
111+
112+
automerge:
113+
if: >
114+
github.event_name == 'pull_request' &&
115+
github.event.pull_request.user.login == 'dependabot[bot]'
116+
needs:
117+
- test-typescript
118+
- test-unit
119+
- package
120+
runs-on: ubuntu-latest
121+
permissions:
122+
pull-requests: write
123+
contents: write
124+
steps:
125+
- uses: fastify/github-action-merge-dependabot@v3
126+
with:
127+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,15 @@ jobs:
8787
npm run lint
8888
8989
coverage-nix:
90-
needs: lint
90+
needs:
91+
- lint
9192
permissions:
9293
contents: read
9394
uses: ./.github/workflows/coverage-nix.yml
9495

9596
coverage-win:
96-
needs: lint
97+
needs:
98+
- lint
9799
permissions:
98100
contents: read
99101
uses: ./.github/workflows/coverage-win.yml

.github/workflows/citgm.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,20 @@ jobs:
8585
node-version: ${{ matrix.node-version }}
8686

8787
remove-label:
88-
if: always()
89-
needs:
88+
if: ${{ github.event.label.name == 'citgm-core-plugins' }}
89+
needs:
9090
- core-plugins
9191
continue-on-error: true
9292
runs-on: ubuntu-latest
93+
permissions:
94+
pull-requests: write
9395
steps:
9496
- name: Remove citgm-core-plugins label
9597
uses: octokit/[email protected]
9698
id: remove-label
9799
with:
98100
route: DELETE /repos/{repo}/issues/{issue_number}/labels/{name}
99-
repo: ${{ github.event.pull_request.head.repo.full_name }}
101+
repo: ${{ github.repository }}
100102
issue_number: ${{ github.event.pull_request.number }}
101103
name: citgm-core-plugins
102104
env:
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: integration Alternative Runtimes
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- next
9+
- 'v*'
10+
paths-ignore:
11+
- 'docs/**'
12+
- '*.md'
13+
pull_request:
14+
paths-ignore:
15+
- 'docs/**'
16+
- '*.md'
17+
18+
jobs:
19+
install-production:
20+
runs-on: ${{ matrix.os }}
21+
permissions:
22+
contents: read
23+
24+
strategy:
25+
matrix:
26+
os: [ubuntu-latest]
27+
runtime: [nsolid]
28+
node-version: [18, 20]
29+
pnpm-version: [8]
30+
include:
31+
- nsolid-version: 5
32+
node-version: 18
33+
runtime: nsolid
34+
- nsolid-version: 5
35+
node-version: 20
36+
runtime: nsolid
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
persist-credentials: false
41+
42+
- uses: nodesource/setup-nsolid@v1
43+
if: ${{ matrix.runtime == 'nsolid' }}
44+
with:
45+
node-version: ${{ matrix.node-version }}
46+
nsolid-version: ${{ matrix.nsolid-version }}
47+
48+
- name: Install Pnpm
49+
uses: pnpm/action-setup@v3
50+
with:
51+
version: ${{ matrix.pnpm-version }}
52+
53+
- name: Install Production
54+
run: |
55+
pnpm install --prod
56+
57+
- name: Run server
58+
run: |
59+
node integration/server.js &
60+
61+
- name: Test
62+
if: ${{ success() }}
63+
run: |
64+
bash integration/test.sh

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
node-version: ${{ matrix.node-version }}
4444

4545
- name: Install Pnpm
46-
uses: pnpm/action-setup@v2
46+
uses: pnpm/action-setup@v3
4747
with:
4848
version: ${{ matrix.pnpm-version }}
4949

.github/workflows/links-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: lycheeverse/lychee-action@c053181aa0c3d17606addfe97a9075a32723548a
2323
with:
2424
fail: true
25-
# As external links behaviour is not predictable, we check only internal links
25+
# As external links behavior is not predictable, we check only internal links
2626
# to ensure consistency.
2727
# See: https://github.com/lycheeverse/lychee-action/issues/17#issuecomment-1162586751
2828
args: --offline --verbose --no-progress './**/*.md'

.github/workflows/md-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: npm install --ignore-scripts
3838

3939
- name: Add Matcher
40-
uses: xt0rted/markdownlint-problem-matcher@98d94724052d20ca2e06c091f202e4c66c3c59fb
40+
uses: xt0rted/markdownlint-problem-matcher@1a5fabfb577370cfdf5af944d418e4be3ea06f27
4141

4242
- name: Run Linter
4343
run: ./node_modules/.bin/markdownlint-cli2

.github/workflows/package-manager-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
node-version: ${{ matrix.node-version }}
3636

3737
- name: Install with pnpm
38-
uses: pnpm/action-setup@v2
38+
uses: pnpm/action-setup@v3
3939
with:
4040
version: ${{ matrix.pnpm-version }}
4141

.taprc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ node-arg: --allow-natives-syntax
88

99
files:
1010
- 'test/**/*.test.js'
11+
- 'test/**/*.test.mjs'

SPONSORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ _Be the first!_
1313

1414
## Tier 3
1515

16-
_Be the first!_
16+
- [Mercedes-Benz Group](https://github.com/mercedes-benz)
1717

1818
## Tier 2
1919

docs/Guides/Database.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,14 @@ development. Migrations provide a repeatable and testable way to modify a
237237
database's schema and prevent data loss.
238238

239239
As stated at the beginning of the guide, Fastify is database agnostic and any
240-
NodeJS database migration tool can be used with it. We will give an example of
240+
Node.js database migration tool can be used with it. We will give an example of
241241
using [Postgrator](https://www.npmjs.com/package/postgrator) which has support
242242
for Postgres, MySQL, SQL Server and SQLite. For MongoDB migrations, please check
243243
[migrate-mongo](https://www.npmjs.com/package/migrate-mongo).
244244

245245
#### [Postgrator](https://www.npmjs.com/package/postgrator)
246246

247-
Postgrator is NodeJS SQL migration tool that uses a directory of SQL scripts to
247+
Postgrator is Node.js SQL migration tool that uses a directory of SQL scripts to
248248
alter the database schema. Each file an migrations folder need to follow the
249249
pattern: ` [version].[action].[optional-description].sql`.
250250

@@ -287,6 +287,8 @@ async function migrate() {
287287
});
288288

289289
try {
290+
await client.connect();
291+
290292
const postgrator = new Postgrator({
291293
migrationPattern: path.join(__dirname, '/migrations/*'),
292294
driver: 'pg',

docs/Guides/Delay-Accepting-Requests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ That will be achieved by wrapping into a custom plugin two main features:
4949

5050
1. the mechanism for authenticating with the provider
5151
[decorating](../Reference/Decorators.md) the `fastify` object with the
52-
authentication key (`magicKey` from here onwards)
52+
authentication key (`magicKey` from here onward)
5353
1. the mechanism for denying requests that would, otherwise, fail
5454

5555
### Hands-on

0 commit comments

Comments
 (0)