Skip to content

Commit

Permalink
fix: Forward fastify-sensible definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed May 7, 2024
1 parent 37c9dba commit a5a7d58
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
File renamed without changes.
20 changes: 13 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import { AutoloadPluginOptions, fastifyAutoload } from '@fastify/autoload'
import sensible from '@fastify/sensible'
import { fastifyAutoload, type AutoloadPluginOptions } from '@fastify/autoload'
import sensible, { type HttpErrors } from '@fastify/sensible'
import underPressurePlugin, {
UnderPressureOptions
type UnderPressureOptions
} from '@fastify/under-pressure'
import Fastify, { FastifyHttpsOptions, FastifyInstance } from 'fastify'
import Fastify, {
type FastifyHttpsOptions,
type FastifyInstance
} from 'fastify'
import https from 'node:https'
import { fastifyMicroEnv, type FastifyMicroEnv } from './environment'
import gracefulShutdown, { GracefulShutdownOptions } from './graceful-shutdown'
import { fastifyMicroEnv, type FastifyMicroEnv } from './env'
import gracefulShutdown, {
type GracefulShutdownOptions
} from './graceful-shutdown'
import { getLoggerOptions, makeReqIdGenerator } from './logger'
import sentry, { SentryOptions } from './sentry'
import sentry, { type SentryOptions } from './sentry'

declare module 'fastify' {
interface FastifyInstance {
name?: string
env: FastifyMicroEnv
httpErrors: HttpErrors
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import crypto from 'node:crypto'
import pino from 'pino'
import * as redactEnv from 'redact-env'
import SonicBoom from 'sonic-boom'
import { FastifyMicroEnv } from './environment'
import type { FastifyMicroEnv } from './env'
import type { Options } from './index'
import { randomID } from './randomID'

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'node:fs/promises'
import path from 'node:path'
import { createServer, startServer } from '../../dist'
import { createServer, startServer } from '../../src'

async function main() {
const server = createServer({
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"verbatimModuleSyntax": true,
"noEmit": true,
"esModuleInterop": true,
"module": "ESNext",
Expand Down
2 changes: 1 addition & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from 'tsup'
export default defineConfig({
entry: {
index: 'src/index.ts',
env: 'src/environment.ts'
env: 'src/env.ts'
},
format: ['esm'],
dts: true,
Expand Down

0 comments on commit a5a7d58

Please sign in to comment.