Prerequisites
🚀 Feature Proposal
Currently, we have to write type for AppOptions, while it is Fastify options. And why we can't improve by importing the Fastify options type? It should be easier to code if we can do it. For example, I don't know what is logger type looks like.
https://github.com/fastify/fastify-cli/blob/master/templates/app-ts/src/app.ts#L5
export type AppOptions = {
// Place your custom options for app below here.
logger: <???>
trustProxy: true,
maxParamLength: number,
connectionTimeout: number,
requestTimeout: number,
bodyLimit: number,
exposeHeadRoutes: boolean,
rewriteUrl: (req: FastifyRequest) => any, // I have to use <any> for this ...
ajv: {
customOptions: {
removeAdditional: boolean,
useDefaults: boolean,
coerceTypes: string
allErrors: boolean,
allowUnionTypes: boolean,
},
plugins: any[]
}
} & Partial<AutoloadPluginOptions>;
Motivation
Improve the plugin. Take advantage of Typescript type.
Example
export type AppOptions = FastifyOptions & Partial<AutoloadPluginOptions>;
Prerequisites
🚀 Feature Proposal
Currently, we have to write type for AppOptions, while it is Fastify options. And why we can't improve by importing the Fastify options type? It should be easier to code if we can do it. For example, I don't know what is logger type looks like.
https://github.com/fastify/fastify-cli/blob/master/templates/app-ts/src/app.ts#L5
Motivation
Improve the plugin. Take advantage of Typescript type.
Example