Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ function cli (args) {

template.devDependencies.c8 = cliPkg.devDependencies.c8
template.scripts.test = 'npm run build:ts && tsc -p test/tsconfig.json && FASTIFY_AUTOLOAD_TYPESCRIPT=1 node --test --experimental-test-coverage --loader ts-node/esm test/**/*.ts'
template.scripts.dev = 'fastify start -l info src/app.ts'
}
} else {
template = { ...javascriptTemplate }
Expand Down
2 changes: 1 addition & 1 deletion should-skip-test-suites.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const nodeMajorVersion = process.versions.node.split('.').map(x => parseInt(x, 10))[0]
const shouldRunSuites = nodeMajorVersion >= 20
const shouldRunSuites = nodeMajorVersion >= 22
if (!shouldRunSuites) {
console.info(`Skipped templates test suites on node ${nodeMajorVersion}`)
process.exit(0)
Expand Down
4 changes: 2 additions & 2 deletions templates/app-ts-esm/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as path from 'node:path'
import AutoLoad, { AutoloadPluginOptions } from '@fastify/autoload'
import { FastifyPluginAsync } from 'fastify'
import AutoLoad, { type AutoloadPluginOptions } from '@fastify/autoload'
import { type FastifyPluginAsync } from 'fastify'
import { fileURLToPath } from 'node:url'

const __filename = fileURLToPath(import.meta.url)
Expand Down
2 changes: 1 addition & 1 deletion templates/app-ts-esm/src/plugins/sensible.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fp from 'fastify-plugin'
import sensible, { FastifySensibleOptions } from '@fastify/sensible'
import sensible, { type FastifySensibleOptions } from '@fastify/sensible'

/**
* This plugins adds some utilities to handle http errors
Expand Down
2 changes: 1 addition & 1 deletion templates/app-ts-esm/src/routes/example/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FastifyPluginAsync } from 'fastify'
import { type FastifyPluginAsync } from 'fastify'

const example: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
fastify.get('/', async function (request, reply) {
Expand Down
2 changes: 1 addition & 1 deletion templates/app-ts-esm/src/routes/root.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FastifyPluginAsync } from 'fastify'
import { type FastifyPluginAsync } from 'fastify'

const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
fastify.get('/', async function (request, reply) {
Expand Down
15 changes: 8 additions & 7 deletions templates/app-ts-esm/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"extends": "fastify-tsconfig",
"compilerOptions": {
"outDir": "dist",
"sourceMap": true,
"moduleResolution": "NodeNext",
"module": "NodeNext",
"target": "ES2022",
"esModuleInterop": true
"sourceMap": true,
"target": "esnext",
"module": "nodenext",
"allowImportingTsExtensions": true,
"rewriteRelativeImportExtensions": true,
"verbatimModuleSyntax": true,
"erasableSyntaxOnly": true
},
"include": ["src/**/*.ts"]
}
}
2 changes: 1 addition & 1 deletion templates/app-ts/src/routes/example/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FastifyPluginAsync } from 'fastify'
import { type FastifyPluginAsync } from 'fastify'

const example: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
fastify.get('/', async function (request, reply) {
Expand Down
2 changes: 1 addition & 1 deletion templates/app-ts/src/routes/root.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FastifyPluginAsync } from 'fastify'
import { type FastifyPluginAsync } from 'fastify'

const root: FastifyPluginAsync = async (fastify, opts): Promise<void> => {
fastify.get('/', async function (request, reply) {
Expand Down
2 changes: 1 addition & 1 deletion templates/plugin/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
contents: read
strategy:
matrix:
node-version: [20, 22, 24]
node-version: [22, 24]
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
Expand Down