From a840e5eb3e80b273732bc12ac872eb8674de4ea8 Mon Sep 17 00:00:00 2001 From: Commit User Date: Fri, 20 Sep 2024 17:34:02 +0200 Subject: [PATCH] feat(lint): upgrade eslint and rules --- .eslintignore | 11 - .eslintrc.js | 49 - .prettierrc.js | 28 + .prettierrc.json | 20 - docs/api/fastify-metrics._default.md | 2 +- ...y-metrics.idefaultmetricsconfig.enabled.md | 2 +- .../fastify-metrics.idefaultmetricsconfig.md | 40 +- .../fastify-metrics.ifastifymetrics.client.md | 2 +- ...s.ifastifymetrics.initmetricsinregistry.md | 4 +- docs/api/fastify-metrics.ifastifymetrics.md | 60 +- ...ify-metrics.ihistogramoverrides.buckets.md | 2 +- ...astify-metrics.ihistogramoverrides.help.md | 2 +- .../fastify-metrics.ihistogramoverrides.md | 72 +- ...astify-metrics.ihistogramoverrides.name.md | 2 +- ...etricspluginoptions.clearregisteroninit.md | 2 +- ...cs.imetricspluginoptions.defaultmetrics.md | 2 +- ...-metrics.imetricspluginoptions.endpoint.md | 2 +- .../fastify-metrics.imetricspluginoptions.md | 118 ++- ...tify-metrics.imetricspluginoptions.name.md | 2 +- ...etrics.imetricspluginoptions.promclient.md | 2 +- ...rics.imetricspluginoptions.routemetrics.md | 2 +- ...etricsroutecontextconfig.disablemetrics.md | 2 +- ...tify-metrics.imetricsroutecontextconfig.md | 54 +- ...rics.imetricsroutecontextconfig.statsid.md | 2 +- ...ics.iroutelabelsoverrides.getroutelabel.md | 2 +- .../fastify-metrics.iroutelabelsoverrides.md | 86 +- ...fy-metrics.iroutelabelsoverrides.method.md | 2 +- ...ify-metrics.iroutelabelsoverrides.route.md | 2 +- ...fy-metrics.iroutelabelsoverrides.status.md | 2 +- ...etrics.iroutemetricsconfig.customlabels.md | 2 +- ...ify-metrics.iroutemetricsconfig.enabled.md | 2 +- ...cs.iroutemetricsconfig.groupstatuscodes.md | 2 +- ...s.iroutemetricsconfig.invalidroutegroup.md | 2 +- .../fastify-metrics.iroutemetricsconfig.md | 150 ++- ...ics.iroutemetricsconfig.methodblacklist.md | 2 +- ...y-metrics.iroutemetricsconfig.overrides.md | 2 +- ...routemetricsconfig.registeredroutesonly.md | 2 +- ...rics.iroutemetricsconfig.routeblacklist.md | 2 +- ...etrics.iroutemetricsoverrides.histogram.md | 2 +- ...y-metrics.iroutemetricsoverrides.labels.md | 2 +- .../fastify-metrics.iroutemetricsoverrides.md | 70 +- ...-metrics.iroutemetricsoverrides.summary.md | 2 +- .../fastify-metrics.isummaryoverrides.help.md | 2 +- docs/api/fastify-metrics.isummaryoverrides.md | 72 +- .../fastify-metrics.isummaryoverrides.name.md | 2 +- ...y-metrics.isummaryoverrides.percentiles.md | 2 +- docs/api/fastify-metrics.md | 124 ++- docs/api/index.md | 22 +- eslint.config.mjs | 196 ++-- etc/fastify-metrics.api.md | 91 +- examples/example.ts | 2 +- package.json | 15 +- pnpm-lock.yaml | 960 ++++-------------- src/__tests__/clear-register.spec.ts | 12 +- src/__tests__/default-metrics.spec.ts | 16 +- src/__tests__/edge-cases.spec.ts | 20 +- src/__tests__/endpoint-object.spec.ts | 8 +- src/__tests__/exports.spec.ts | 8 +- src/__tests__/inject-prom-client.spec.ts | 2 +- src/__tests__/route-metrics.spec.ts | 100 +- src/fastify-metrics.ts | 166 +-- src/index.ts | 6 +- src/types.ts | 5 +- tsconfig.json | 31 +- tsdoc.json | 21 + 65 files changed, 1402 insertions(+), 1301 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.js create mode 100644 .prettierrc.js delete mode 100644 .prettierrc.json create mode 100644 tsdoc.json diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 9eb04c1..0000000 --- a/.eslintignore +++ /dev/null @@ -1,11 +0,0 @@ -logs/ -coverage/ -node_modules/ -.idea/ -.vscode/ -static/ -**/*.xxx.* -dist/ -examples/**/* -.eslintrc.js -jest.config.js diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index b4d5ec4..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,49 +0,0 @@ -module.exports = { - root: true, - plugins: [ - 'prettier', - '@typescript-eslint/eslint-plugin', - 'eslint-plugin-tsdoc', - ], - extends: [ - 'eslint:recommended', - 'google', - 'prettier', - 'plugin:@typescript-eslint/recommended', - 'plugin:@typescript-eslint/eslint-recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:@typescript-eslint/recommended-requiring-type-checking', - ], - parser: '@typescript-eslint/parser', - parserOptions: { - project: 'tsconfig.json', - sourceType: 'module', - ecmaVersion: 2020, - }, - env: { - es6: true, - node: true, - jest: false, - }, - - rules: { - 'new-cap': ['error', { capIsNewExceptions: ['ObjectId', 'Fastify'] }], - 'require-jsdoc': 'off', - 'valid-jsdoc': 'off', - 'tsdoc/syntax': 'error', - 'prettier/prettier': 'error', - '@typescript-eslint/require-await': 'off', - '@typescript-eslint/no-unsafe-member-access': 'off', - '@typescript-eslint/no-unsafe-call': 'off', - }, - overrides: [ - { - files: ['**/__tests__/**/*', '**/__mocks__/**/*'], - env: { - jest: true, - }, - plugins: ['jest'], - ...require('eslint-plugin-jest').configs.recommended, - }, - ], -}; diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..1127ce7 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,28 @@ +module.exports = { + $schema: 'http://json.schemastore.org/prettierrc', + trailingComma: 'all', + useTabs: false, + tabWidth: 2, + semi: true, + singleQuote: true, + quoteProps: 'consistent', + arrowParens: 'always', + bracketSpacing: true, + endOfLine: 'lf', + printWidth: 80, + plugins: [ + require.resolve('prettier-plugin-packagejson'), + require.resolve('prettier-plugin-jsdoc'), + require.resolve('prettier-plugin-sort-json'), + require.resolve('@ianvs/prettier-plugin-sort-imports'), + require.resolve('prettier-plugin-sh'), + ], + importOrder: [ + '', // Node.js built-in modules + '', // Imports not matched by other special words or groups. + '^[.]', // relative imports + ], + importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'], + importOrderTypeScriptVersion: '5.6.2', + jsonRecursiveSort: true, +}; diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 3a13f34..0000000 --- a/.prettierrc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/prettierrc", - "arrowParens": "always", - "bracketSpacing": true, - "endOfLine": "lf", - "plugins": [ - "./node_modules/prettier-plugin-organize-imports", - "./node_modules/prettier-plugin-packagejson", - "./node_modules/prettier-plugin-sort-json", - "./node_modules/prettier-plugin-jsdoc" - ], - "printWidth": 80, - "quoteProps": "consistent", - "semi": true, - "singleQuote": true, - "tabWidth": 2, - "trailingComma": "es5", - "tsdoc": true, - "useTabs": false -} diff --git a/docs/api/fastify-metrics._default.md b/docs/api/fastify-metrics._default.md index 77fbbaf..ccd2d69 100644 --- a/docs/api/fastify-metrics._default.md +++ b/docs/api/fastify-metrics._default.md @@ -6,7 +6,7 @@ Metric plugin -Signature: +**Signature:** ```typescript _default: import('fastify').FastifyPluginCallback< diff --git a/docs/api/fastify-metrics.idefaultmetricsconfig.enabled.md b/docs/api/fastify-metrics.idefaultmetricsconfig.enabled.md index a38661c..cc641ee 100644 --- a/docs/api/fastify-metrics.idefaultmetricsconfig.enabled.md +++ b/docs/api/fastify-metrics.idefaultmetricsconfig.enabled.md @@ -6,7 +6,7 @@ Enables collection of default prom-client metrics (e.g. node.js vitals like cpu, memory, etc.) -Signature: +**Signature:** ```typescript enabled: boolean; diff --git a/docs/api/fastify-metrics.idefaultmetricsconfig.md b/docs/api/fastify-metrics.idefaultmetricsconfig.md index e84d09c..a9dfd44 100644 --- a/docs/api/fastify-metrics.idefaultmetricsconfig.md +++ b/docs/api/fastify-metrics.idefaultmetricsconfig.md @@ -6,13 +6,13 @@ Default prom-client metrics config -Signature: +**Signature:** ```typescript export interface IDefaultMetricsConfig extends DefaultMetricsCollectorConfiguration<'text/plain; version=0.0.4; charset=utf-8'> ``` -Extends: DefaultMetricsCollectorConfiguration<'text/plain; version=0.0.4; charset=utf-8'> +**Extends:** DefaultMetricsCollectorConfiguration<'text/plain; version=0.0.4; charset=utf-8'> ## Remarks @@ -20,6 +20,36 @@ Extends the [prom-client](https://github.com/siimon/prom-client#default-metrics) ## Properties -| Property | Modifiers | Type | Description | -| ------------------------------------------------------------- | --------- | ------- | ---------------------------------------------------------------------------------------------- | -| [enabled](./fastify-metrics.idefaultmetricsconfig.enabled.md) | | boolean | Enables collection of default prom-client metrics (e.g. node.js vitals like cpu, memory, etc.) | + + +
+ +Property + + + +Modifiers + + + +Type + + + +Description + +
+ +[enabled](./fastify-metrics.idefaultmetricsconfig.enabled.md) + + + + + +boolean + + + +Enables collection of default prom-client metrics (e.g. node.js vitals like cpu, memory, etc.) + +
diff --git a/docs/api/fastify-metrics.ifastifymetrics.client.md b/docs/api/fastify-metrics.ifastifymetrics.client.md index ec3255e..53af08b 100644 --- a/docs/api/fastify-metrics.ifastifymetrics.client.md +++ b/docs/api/fastify-metrics.ifastifymetrics.client.md @@ -6,7 +6,7 @@ Prom-client instance -Signature: +**Signature:** ```typescript client: typeof client; diff --git a/docs/api/fastify-metrics.ifastifymetrics.initmetricsinregistry.md b/docs/api/fastify-metrics.ifastifymetrics.initmetricsinregistry.md index 7ec9ddc..89ceddd 100644 --- a/docs/api/fastify-metrics.ifastifymetrics.initmetricsinregistry.md +++ b/docs/api/fastify-metrics.ifastifymetrics.initmetricsinregistry.md @@ -6,12 +6,12 @@ Initialize metrics in registries. Useful if you call `registry.clear()` to register metrics in regisitries once again -Signature: +**Signature:** ```typescript initMetricsInRegistry(): void; ``` -Returns: +**Returns:** void diff --git a/docs/api/fastify-metrics.ifastifymetrics.md b/docs/api/fastify-metrics.ifastifymetrics.md index afa0f73..aa26952 100644 --- a/docs/api/fastify-metrics.ifastifymetrics.md +++ b/docs/api/fastify-metrics.ifastifymetrics.md @@ -6,7 +6,7 @@ Plugin decorator -Signature: +**Signature:** ```typescript export interface IFastifyMetrics @@ -14,12 +14,58 @@ export interface IFastifyMetrics ## Properties -| Property | Modifiers | Type | Description | -| ----------------------------------------------------- | --------- | ------------- | -------------------- | -| [client](./fastify-metrics.ifastifymetrics.client.md) | | typeof client | Prom-client instance | + + +
+ +Property + + + +Modifiers + + + +Type + + + +Description + +
+ +[client](./fastify-metrics.ifastifymetrics.client.md) + + + + + +typeof client + + + +Prom-client instance + +
## Methods -| Method | Description | -| ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| [initMetricsInRegistry()](./fastify-metrics.ifastifymetrics.initmetricsinregistry.md) | Initialize metrics in registries. Useful if you call registry.clear() to register metrics in regisitries once again | + + +
+ +Method + + + +Description + +
+ +[initMetricsInRegistry()](./fastify-metrics.ifastifymetrics.initmetricsinregistry.md) + + + +Initialize metrics in registries. Useful if you call `registry.clear()` to register metrics in regisitries once again + +
diff --git a/docs/api/fastify-metrics.ihistogramoverrides.buckets.md b/docs/api/fastify-metrics.ihistogramoverrides.buckets.md index fcb3061..74a36b0 100644 --- a/docs/api/fastify-metrics.ihistogramoverrides.buckets.md +++ b/docs/api/fastify-metrics.ihistogramoverrides.buckets.md @@ -6,7 +6,7 @@ Request duration buckets override -Signature: +**Signature:** ```typescript buckets?: number[]; diff --git a/docs/api/fastify-metrics.ihistogramoverrides.help.md b/docs/api/fastify-metrics.ihistogramoverrides.help.md index 3140131..a9a5177 100644 --- a/docs/api/fastify-metrics.ihistogramoverrides.help.md +++ b/docs/api/fastify-metrics.ihistogramoverrides.help.md @@ -6,7 +6,7 @@ Request duration histogram help override -Signature: +**Signature:** ```typescript help?: string; diff --git a/docs/api/fastify-metrics.ihistogramoverrides.md b/docs/api/fastify-metrics.ihistogramoverrides.md index e5e62cc..dbd4c67 100644 --- a/docs/api/fastify-metrics.ihistogramoverrides.md +++ b/docs/api/fastify-metrics.ihistogramoverrides.md @@ -6,18 +6,76 @@ Request time histofram config overrides -Signature: +**Signature:** ```typescript export interface IHistogramOverrides extends Partial> ``` -Extends: Partial<HistogramConfiguration<string>> +**Extends:** Partial<HistogramConfiguration<string>> ## Properties -| Property | Modifiers | Type | Description | -| ------------------------------------------------------------ | --------- | ---------- | ---------------------------------------------------------- | -| [buckets?](./fastify-metrics.ihistogramoverrides.buckets.md) | | number\[\] | (Optional) Request duration buckets override | -| [help?](./fastify-metrics.ihistogramoverrides.help.md) | | string | (Optional) Request duration histogram help override | -| [name?](./fastify-metrics.ihistogramoverrides.name.md) | | string | (Optional) Request duration histogram name override | + + + + +
+ +Property + + + +Modifiers + + + +Type + + + +Description + +
+ +[buckets?](./fastify-metrics.ihistogramoverrides.buckets.md) + + + + + +number\[\] + + + +_(Optional)_ Request duration buckets override + +
+ +[help?](./fastify-metrics.ihistogramoverrides.help.md) + + + + + +string + + + +_(Optional)_ Request duration histogram help override + +
+ +[name?](./fastify-metrics.ihistogramoverrides.name.md) + + + + + +string + + + +_(Optional)_ Request duration histogram name override + +
diff --git a/docs/api/fastify-metrics.ihistogramoverrides.name.md b/docs/api/fastify-metrics.ihistogramoverrides.name.md index bcf2a15..85eed0e 100644 --- a/docs/api/fastify-metrics.ihistogramoverrides.name.md +++ b/docs/api/fastify-metrics.ihistogramoverrides.name.md @@ -6,7 +6,7 @@ Request duration histogram name override -Signature: +**Signature:** ```typescript name?: string; diff --git a/docs/api/fastify-metrics.imetricspluginoptions.clearregisteroninit.md b/docs/api/fastify-metrics.imetricspluginoptions.clearregisteroninit.md index d0a1799..f52aeaf 100644 --- a/docs/api/fastify-metrics.imetricspluginoptions.clearregisteroninit.md +++ b/docs/api/fastify-metrics.imetricspluginoptions.clearregisteroninit.md @@ -6,7 +6,7 @@ Clears the prom-client global registry before adding metrics. Default to `false` -Signature: +**Signature:** ```typescript clearRegisterOnInit: boolean; diff --git a/docs/api/fastify-metrics.imetricspluginoptions.defaultmetrics.md b/docs/api/fastify-metrics.imetricspluginoptions.defaultmetrics.md index 9ac6dc0..574b102 100644 --- a/docs/api/fastify-metrics.imetricspluginoptions.defaultmetrics.md +++ b/docs/api/fastify-metrics.imetricspluginoptions.defaultmetrics.md @@ -6,7 +6,7 @@ Default prom-client metrics config. Collect prometheus recommended and node.js specific metrics like event loop lag. -Signature: +**Signature:** ```typescript defaultMetrics: IDefaultMetricsConfig; diff --git a/docs/api/fastify-metrics.imetricspluginoptions.endpoint.md b/docs/api/fastify-metrics.imetricspluginoptions.endpoint.md index a9f5720..ff22265 100644 --- a/docs/api/fastify-metrics.imetricspluginoptions.endpoint.md +++ b/docs/api/fastify-metrics.imetricspluginoptions.endpoint.md @@ -6,7 +6,7 @@ Endpoint to expose metrics in prometheus format. `null` - disables metrics exposure -Signature: +**Signature:** ```typescript endpoint: string | null | RouteOptions; diff --git a/docs/api/fastify-metrics.imetricspluginoptions.md b/docs/api/fastify-metrics.imetricspluginoptions.md index 7d42b6d..2e3ea2c 100644 --- a/docs/api/fastify-metrics.imetricspluginoptions.md +++ b/docs/api/fastify-metrics.imetricspluginoptions.md @@ -6,7 +6,7 @@ Metrics plugin config -Signature: +**Signature:** ```typescript export interface IMetricsPluginOptions @@ -14,11 +14,111 @@ export interface IMetricsPluginOptions ## Properties -| Property | Modifiers | Type | Description | -| ------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| [clearRegisterOnInit](./fastify-metrics.imetricspluginoptions.clearregisteroninit.md) | | boolean | Clears the prom-client global registry before adding metrics. Default to false | -| [defaultMetrics](./fastify-metrics.imetricspluginoptions.defaultmetrics.md) | | [IDefaultMetricsConfig](./fastify-metrics.idefaultmetricsconfig.md) | Default prom-client metrics config. Collect prometheus recommended and node.js specific metrics like event loop lag. | -| [endpoint](./fastify-metrics.imetricspluginoptions.endpoint.md) | | string \| null \| RouteOptions | Endpoint to expose metrics in prometheus format. null - disables metrics exposure | -| [name](./fastify-metrics.imetricspluginoptions.name.md) | | string | Plugin name that will be registered in fastify instance. | -| [promClient](./fastify-metrics.imetricspluginoptions.promclient.md) | | typeof client \| null | PromClient instance to override default internal promClient | -| [routeMetrics](./fastify-metrics.imetricspluginoptions.routemetrics.md) | | [IRouteMetricsConfig](./fastify-metrics.iroutemetricsconfig.md) | Per route metrics config. Collect response time metric on requests | + + + + + + + +
+ +Property + + + +Modifiers + + + +Type + + + +Description + +
+ +[clearRegisterOnInit](./fastify-metrics.imetricspluginoptions.clearregisteroninit.md) + + + + + +boolean + + + +Clears the prom-client global registry before adding metrics. Default to `false` + +
+ +[defaultMetrics](./fastify-metrics.imetricspluginoptions.defaultmetrics.md) + + + + + +[IDefaultMetricsConfig](./fastify-metrics.idefaultmetricsconfig.md) + + + +Default prom-client metrics config. Collect prometheus recommended and node.js specific metrics like event loop lag. + +
+ +[endpoint](./fastify-metrics.imetricspluginoptions.endpoint.md) + + + + + +string \| null \| RouteOptions + + + +Endpoint to expose metrics in prometheus format. `null` - disables metrics exposure + +
+ +[name](./fastify-metrics.imetricspluginoptions.name.md) + + + + + +string + + + +Plugin name that will be registered in fastify instance. + +
+ +[promClient](./fastify-metrics.imetricspluginoptions.promclient.md) + + + + + +typeof client \| null + + + +PromClient instance to override default internal promClient + +
+ +[routeMetrics](./fastify-metrics.imetricspluginoptions.routemetrics.md) + + + + + +[IRouteMetricsConfig](./fastify-metrics.iroutemetricsconfig.md) + + + +Per route metrics config. Collect response time metric on requests + +
diff --git a/docs/api/fastify-metrics.imetricspluginoptions.name.md b/docs/api/fastify-metrics.imetricspluginoptions.name.md index 45dd472..b6e2655 100644 --- a/docs/api/fastify-metrics.imetricspluginoptions.name.md +++ b/docs/api/fastify-metrics.imetricspluginoptions.name.md @@ -6,7 +6,7 @@ Plugin name that will be registered in fastify instance. -Signature: +**Signature:** ```typescript name: string; diff --git a/docs/api/fastify-metrics.imetricspluginoptions.promclient.md b/docs/api/fastify-metrics.imetricspluginoptions.promclient.md index e23bb02..8557e76 100644 --- a/docs/api/fastify-metrics.imetricspluginoptions.promclient.md +++ b/docs/api/fastify-metrics.imetricspluginoptions.promclient.md @@ -6,7 +6,7 @@ PromClient instance to override default internal promClient -Signature: +**Signature:** ```typescript promClient: typeof client | null; diff --git a/docs/api/fastify-metrics.imetricspluginoptions.routemetrics.md b/docs/api/fastify-metrics.imetricspluginoptions.routemetrics.md index 7872fd7..e72b47d 100644 --- a/docs/api/fastify-metrics.imetricspluginoptions.routemetrics.md +++ b/docs/api/fastify-metrics.imetricspluginoptions.routemetrics.md @@ -6,7 +6,7 @@ Per route metrics config. Collect response time metric on requests -Signature: +**Signature:** ```typescript routeMetrics: IRouteMetricsConfig; diff --git a/docs/api/fastify-metrics.imetricsroutecontextconfig.disablemetrics.md b/docs/api/fastify-metrics.imetricsroutecontextconfig.disablemetrics.md index 1648462..df3987e 100644 --- a/docs/api/fastify-metrics.imetricsroutecontextconfig.disablemetrics.md +++ b/docs/api/fastify-metrics.imetricsroutecontextconfig.disablemetrics.md @@ -6,7 +6,7 @@ Disables metric collection on this route -Signature: +**Signature:** ```typescript disableMetrics?: boolean; diff --git a/docs/api/fastify-metrics.imetricsroutecontextconfig.md b/docs/api/fastify-metrics.imetricsroutecontextconfig.md index fb5d8c2..cb07292 100644 --- a/docs/api/fastify-metrics.imetricsroutecontextconfig.md +++ b/docs/api/fastify-metrics.imetricsroutecontextconfig.md @@ -6,7 +6,7 @@ Route config for metrics -Signature: +**Signature:** ```typescript export interface IMetricsRouteContextConfig @@ -14,7 +14,51 @@ export interface IMetricsRouteContextConfig ## Properties -| Property | Modifiers | Type | Description | -| --------------------------------------------------------------------------------- | --------- | ------- | ---------------------------------------------------------- | -| [disableMetrics?](./fastify-metrics.imetricsroutecontextconfig.disablemetrics.md) | | boolean | (Optional) Disables metric collection on this route | -| [statsId?](./fastify-metrics.imetricsroutecontextconfig.statsid.md) | | string | (Optional) Override route definition | + + + +
+ +Property + + + +Modifiers + + + +Type + + + +Description + +
+ +[disableMetrics?](./fastify-metrics.imetricsroutecontextconfig.disablemetrics.md) + + + + + +boolean + + + +_(Optional)_ Disables metric collection on this route + +
+ +[statsId?](./fastify-metrics.imetricsroutecontextconfig.statsid.md) + + + + + +string + + + +_(Optional)_ Override route definition + +
diff --git a/docs/api/fastify-metrics.imetricsroutecontextconfig.statsid.md b/docs/api/fastify-metrics.imetricsroutecontextconfig.statsid.md index c6aa487..c0d9283 100644 --- a/docs/api/fastify-metrics.imetricsroutecontextconfig.statsid.md +++ b/docs/api/fastify-metrics.imetricsroutecontextconfig.statsid.md @@ -6,7 +6,7 @@ Override route definition -Signature: +**Signature:** ```typescript statsId?: string; diff --git a/docs/api/fastify-metrics.iroutelabelsoverrides.getroutelabel.md b/docs/api/fastify-metrics.iroutelabelsoverrides.getroutelabel.md index 01b3508..0e69189 100644 --- a/docs/api/fastify-metrics.iroutelabelsoverrides.getroutelabel.md +++ b/docs/api/fastify-metrics.iroutelabelsoverrides.getroutelabel.md @@ -6,7 +6,7 @@ Function that will return route value for metrics label. By default will use: `request.routeConfig.statsId ?? request.routerPath` -Signature: +**Signature:** ```typescript getRouteLabel?: (request: FastifyRequest) => string; diff --git a/docs/api/fastify-metrics.iroutelabelsoverrides.md b/docs/api/fastify-metrics.iroutelabelsoverrides.md index 5f3676b..9410ecb 100644 --- a/docs/api/fastify-metrics.iroutelabelsoverrides.md +++ b/docs/api/fastify-metrics.iroutelabelsoverrides.md @@ -6,7 +6,7 @@ Label Overrides -Signature: +**Signature:** ```typescript export interface IRouteLabelsOverrides @@ -14,9 +14,81 @@ export interface IRouteLabelsOverrides ## Properties -| Property | Modifiers | Type | Description | -| -------------------------------------------------------------------------- | --------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [getRouteLabel?](./fastify-metrics.iroutelabelsoverrides.getroutelabel.md) | | (request: FastifyRequest) => string | (Optional) Function that will return route value for metrics label. By default will use: request.routeConfig.statsId ?? request.routerPath | -| [method?](./fastify-metrics.iroutelabelsoverrides.method.md) | | string | (Optional) Method name | -| [route?](./fastify-metrics.iroutelabelsoverrides.route.md) | | string | (Optional) Route name | -| [status?](./fastify-metrics.iroutelabelsoverrides.status.md) | | string | (Optional) Status code | + + + + + +
+ +Property + + + +Modifiers + + + +Type + + + +Description + +
+ +[getRouteLabel?](./fastify-metrics.iroutelabelsoverrides.getroutelabel.md) + + + + + +(request: FastifyRequest) => string + + + +_(Optional)_ Function that will return route value for metrics label. By default will use: `request.routeConfig.statsId ?? request.routerPath` + +
+ +[method?](./fastify-metrics.iroutelabelsoverrides.method.md) + + + + + +string + + + +_(Optional)_ Method name + +
+ +[route?](./fastify-metrics.iroutelabelsoverrides.route.md) + + + + + +string + + + +_(Optional)_ Route name + +
+ +[status?](./fastify-metrics.iroutelabelsoverrides.status.md) + + + + + +string + + + +_(Optional)_ Status code + +
diff --git a/docs/api/fastify-metrics.iroutelabelsoverrides.method.md b/docs/api/fastify-metrics.iroutelabelsoverrides.method.md index efe6245..506c021 100644 --- a/docs/api/fastify-metrics.iroutelabelsoverrides.method.md +++ b/docs/api/fastify-metrics.iroutelabelsoverrides.method.md @@ -6,7 +6,7 @@ Method name -Signature: +**Signature:** ```typescript method?: string; diff --git a/docs/api/fastify-metrics.iroutelabelsoverrides.route.md b/docs/api/fastify-metrics.iroutelabelsoverrides.route.md index 68028d9..dd177cb 100644 --- a/docs/api/fastify-metrics.iroutelabelsoverrides.route.md +++ b/docs/api/fastify-metrics.iroutelabelsoverrides.route.md @@ -6,7 +6,7 @@ Route name -Signature: +**Signature:** ```typescript route?: string; diff --git a/docs/api/fastify-metrics.iroutelabelsoverrides.status.md b/docs/api/fastify-metrics.iroutelabelsoverrides.status.md index c767339..e7ba217 100644 --- a/docs/api/fastify-metrics.iroutelabelsoverrides.status.md +++ b/docs/api/fastify-metrics.iroutelabelsoverrides.status.md @@ -6,7 +6,7 @@ Status code -Signature: +**Signature:** ```typescript status?: string; diff --git a/docs/api/fastify-metrics.iroutemetricsconfig.customlabels.md b/docs/api/fastify-metrics.iroutemetricsconfig.customlabels.md index b139669..d4a63b7 100644 --- a/docs/api/fastify-metrics.iroutemetricsconfig.customlabels.md +++ b/docs/api/fastify-metrics.iroutemetricsconfig.customlabels.md @@ -6,7 +6,7 @@ Custom labels to add to metrics -Signature: +**Signature:** ```typescript customLabels?: Record string)>; diff --git a/docs/api/fastify-metrics.iroutemetricsconfig.enabled.md b/docs/api/fastify-metrics.iroutemetricsconfig.enabled.md index 2d103e2..89d06ec 100644 --- a/docs/api/fastify-metrics.iroutemetricsconfig.enabled.md +++ b/docs/api/fastify-metrics.iroutemetricsconfig.enabled.md @@ -4,7 +4,7 @@ ## IRouteMetricsConfig.enabled property -Signature: +**Signature:** ```typescript enabled?: boolean | { diff --git a/docs/api/fastify-metrics.iroutemetricsconfig.groupstatuscodes.md b/docs/api/fastify-metrics.iroutemetricsconfig.groupstatuscodes.md index bd6ec02..f975355 100644 --- a/docs/api/fastify-metrics.iroutemetricsconfig.groupstatuscodes.md +++ b/docs/api/fastify-metrics.iroutemetricsconfig.groupstatuscodes.md @@ -6,7 +6,7 @@ Groups status code labels by first digit 200 becomes 2XX in metrics. -Signature: +**Signature:** ```typescript groupStatusCodes?: boolean; diff --git a/docs/api/fastify-metrics.iroutemetricsconfig.invalidroutegroup.md b/docs/api/fastify-metrics.iroutemetricsconfig.invalidroutegroup.md index 2d73610..347a163 100644 --- a/docs/api/fastify-metrics.iroutemetricsconfig.invalidroutegroup.md +++ b/docs/api/fastify-metrics.iroutemetricsconfig.invalidroutegroup.md @@ -6,7 +6,7 @@ Unknown route label. If registeredRoutesOnly routes set to `false` unknown routes will have following url. -Signature: +**Signature:** ```typescript invalidRouteGroup?: string; diff --git a/docs/api/fastify-metrics.iroutemetricsconfig.md b/docs/api/fastify-metrics.iroutemetricsconfig.md index 7b19413..3a8af5f 100644 --- a/docs/api/fastify-metrics.iroutemetricsconfig.md +++ b/docs/api/fastify-metrics.iroutemetricsconfig.md @@ -6,7 +6,7 @@ Route metrics configuration -Signature: +**Signature:** ```typescript export interface IRouteMetricsConfig @@ -14,13 +14,141 @@ export interface IRouteMetricsConfig ## Properties -| Property | Modifiers | Type | Description | -| -------------------------------------------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [customLabels?](./fastify-metrics.iroutemetricsconfig.customlabels.md) | | Record<string, string \| ((request: FastifyRequest, reply: FastifyReply) => string)> | (Optional) Custom labels to add to metrics | -| [enabled?](./fastify-metrics.iroutemetricsconfig.enabled.md) | | boolean \| { histogram?: boolean; summary?: boolean; } | (Optional) | -| [groupStatusCodes?](./fastify-metrics.iroutemetricsconfig.groupstatuscodes.md) | | boolean | (Optional) Groups status code labels by first digit 200 becomes 2XX in metrics. | -| [invalidRouteGroup?](./fastify-metrics.iroutemetricsconfig.invalidroutegroup.md) | | string | (Optional) Unknown route label. If registeredRoutesOnly routes set to false unknown routes will have following url. | -| [methodBlacklist?](./fastify-metrics.iroutemetricsconfig.methodblacklist.md) | | readonly HTTPMethods\[\] | (Optional) A list of HTTP methods that will be excluded from metrics collection | -| [overrides?](./fastify-metrics.iroutemetricsconfig.overrides.md) | | [IRouteMetricsOverrides](./fastify-metrics.iroutemetricsoverrides.md) | (Optional) Metric configuration overrides | -| [registeredRoutesOnly?](./fastify-metrics.iroutemetricsconfig.registeredroutesonly.md) | | boolean | (Optional) Collect metrics only for registered routes. If false, then metrics for unknown routes /unknown-unregistered-route will be collected as well. | -| [routeBlacklist?](./fastify-metrics.iroutemetricsconfig.routeblacklist.md) | | readonly (string \| RegExp)\[\] | (Optional) A list of routes that will be excluded from metrics collection. | + + + + + + + + + +
+ +Property + + + +Modifiers + + + +Type + + + +Description + +
+ +[customLabels?](./fastify-metrics.iroutemetricsconfig.customlabels.md) + + + + + +Record<string, string \| ((request: FastifyRequest, reply: FastifyReply) => string)> + + + +_(Optional)_ Custom labels to add to metrics + +
+ +[enabled?](./fastify-metrics.iroutemetricsconfig.enabled.md) + + + + + +boolean \| { histogram?: boolean; summary?: boolean; } + + + +_(Optional)_ + +
+ +[groupStatusCodes?](./fastify-metrics.iroutemetricsconfig.groupstatuscodes.md) + + + + + +boolean + + + +_(Optional)_ Groups status code labels by first digit 200 becomes 2XX in metrics. + +
+ +[invalidRouteGroup?](./fastify-metrics.iroutemetricsconfig.invalidroutegroup.md) + + + + + +string + + + +_(Optional)_ Unknown route label. If registeredRoutesOnly routes set to `false` unknown routes will have following url. + +
+ +[methodBlacklist?](./fastify-metrics.iroutemetricsconfig.methodblacklist.md) + + + + + +readonly HTTPMethods\[\] + + + +_(Optional)_ A list of HTTP methods that will be excluded from metrics collection + +
+ +[overrides?](./fastify-metrics.iroutemetricsconfig.overrides.md) + + + + + +[IRouteMetricsOverrides](./fastify-metrics.iroutemetricsoverrides.md) + + + +_(Optional)_ Metric configuration overrides + +
+ +[registeredRoutesOnly?](./fastify-metrics.iroutemetricsconfig.registeredroutesonly.md) + + + + + +boolean + + + +_(Optional)_ Collect metrics only for registered routes. If `false`, then metrics for unknown routes `/unknown-unregistered-route` will be collected as well. + +
+ +[routeBlacklist?](./fastify-metrics.iroutemetricsconfig.routeblacklist.md) + + + + + +readonly (string \| RegExp)\[\] + + + +_(Optional)_ A list of routes that will be excluded from metrics collection. + +
diff --git a/docs/api/fastify-metrics.iroutemetricsconfig.methodblacklist.md b/docs/api/fastify-metrics.iroutemetricsconfig.methodblacklist.md index 2c4db29..3fbd2d7 100644 --- a/docs/api/fastify-metrics.iroutemetricsconfig.methodblacklist.md +++ b/docs/api/fastify-metrics.iroutemetricsconfig.methodblacklist.md @@ -6,7 +6,7 @@ A list of HTTP methods that will be excluded from metrics collection -Signature: +**Signature:** ```typescript methodBlacklist?: readonly HTTPMethods[]; diff --git a/docs/api/fastify-metrics.iroutemetricsconfig.overrides.md b/docs/api/fastify-metrics.iroutemetricsconfig.overrides.md index 582c2c9..11303b8 100644 --- a/docs/api/fastify-metrics.iroutemetricsconfig.overrides.md +++ b/docs/api/fastify-metrics.iroutemetricsconfig.overrides.md @@ -6,7 +6,7 @@ Metric configuration overrides -Signature: +**Signature:** ```typescript overrides?: IRouteMetricsOverrides; diff --git a/docs/api/fastify-metrics.iroutemetricsconfig.registeredroutesonly.md b/docs/api/fastify-metrics.iroutemetricsconfig.registeredroutesonly.md index f9ada72..14c2935 100644 --- a/docs/api/fastify-metrics.iroutemetricsconfig.registeredroutesonly.md +++ b/docs/api/fastify-metrics.iroutemetricsconfig.registeredroutesonly.md @@ -6,7 +6,7 @@ Collect metrics only for registered routes. If `false`, then metrics for unknown routes `/unknown-unregistered-route` will be collected as well. -Signature: +**Signature:** ```typescript registeredRoutesOnly?: boolean; diff --git a/docs/api/fastify-metrics.iroutemetricsconfig.routeblacklist.md b/docs/api/fastify-metrics.iroutemetricsconfig.routeblacklist.md index 1cf9b16..c5d9508 100644 --- a/docs/api/fastify-metrics.iroutemetricsconfig.routeblacklist.md +++ b/docs/api/fastify-metrics.iroutemetricsconfig.routeblacklist.md @@ -6,7 +6,7 @@ A list of routes that will be excluded from metrics collection. -Signature: +**Signature:** ```typescript routeBlacklist?: readonly (string | RegExp)[]; diff --git a/docs/api/fastify-metrics.iroutemetricsoverrides.histogram.md b/docs/api/fastify-metrics.iroutemetricsoverrides.histogram.md index 9bb5648..f0a3e3d 100644 --- a/docs/api/fastify-metrics.iroutemetricsoverrides.histogram.md +++ b/docs/api/fastify-metrics.iroutemetricsoverrides.histogram.md @@ -6,7 +6,7 @@ Histogram overrides -Signature: +**Signature:** ```typescript histogram?: IHistogramOverrides; diff --git a/docs/api/fastify-metrics.iroutemetricsoverrides.labels.md b/docs/api/fastify-metrics.iroutemetricsoverrides.labels.md index e450340..262817f 100644 --- a/docs/api/fastify-metrics.iroutemetricsoverrides.labels.md +++ b/docs/api/fastify-metrics.iroutemetricsoverrides.labels.md @@ -6,7 +6,7 @@ Label Overrides -Signature: +**Signature:** ```typescript labels?: IRouteLabelsOverrides; diff --git a/docs/api/fastify-metrics.iroutemetricsoverrides.md b/docs/api/fastify-metrics.iroutemetricsoverrides.md index 99c08a4..a349c61 100644 --- a/docs/api/fastify-metrics.iroutemetricsoverrides.md +++ b/docs/api/fastify-metrics.iroutemetricsoverrides.md @@ -6,7 +6,7 @@ Route metrics overrides. -Signature: +**Signature:** ```typescript export interface IRouteMetricsOverrides @@ -14,8 +14,66 @@ export interface IRouteMetricsOverrides ## Properties -| Property | Modifiers | Type | Description | -| ------------------------------------------------------------------- | --------- | ------------------------------------------------------------------- | ------------------------------------- | -| [histogram?](./fastify-metrics.iroutemetricsoverrides.histogram.md) | | [IHistogramOverrides](./fastify-metrics.ihistogramoverrides.md) | (Optional) Histogram overrides | -| [labels?](./fastify-metrics.iroutemetricsoverrides.labels.md) | | [IRouteLabelsOverrides](./fastify-metrics.iroutelabelsoverrides.md) | (Optional) Label Overrides | -| [summary?](./fastify-metrics.iroutemetricsoverrides.summary.md) | | [ISummaryOverrides](./fastify-metrics.isummaryoverrides.md) | (Optional) Summary overrides | + + + + +
+ +Property + + + +Modifiers + + + +Type + + + +Description + +
+ +[histogram?](./fastify-metrics.iroutemetricsoverrides.histogram.md) + + + + + +[IHistogramOverrides](./fastify-metrics.ihistogramoverrides.md) + + + +_(Optional)_ Histogram overrides + +
+ +[labels?](./fastify-metrics.iroutemetricsoverrides.labels.md) + + + + + +[IRouteLabelsOverrides](./fastify-metrics.iroutelabelsoverrides.md) + + + +_(Optional)_ Label Overrides + +
+ +[summary?](./fastify-metrics.iroutemetricsoverrides.summary.md) + + + + + +[ISummaryOverrides](./fastify-metrics.isummaryoverrides.md) + + + +_(Optional)_ Summary overrides + +
diff --git a/docs/api/fastify-metrics.iroutemetricsoverrides.summary.md b/docs/api/fastify-metrics.iroutemetricsoverrides.summary.md index c34b1ca..26b7c26 100644 --- a/docs/api/fastify-metrics.iroutemetricsoverrides.summary.md +++ b/docs/api/fastify-metrics.iroutemetricsoverrides.summary.md @@ -6,7 +6,7 @@ Summary overrides -Signature: +**Signature:** ```typescript summary?: ISummaryOverrides; diff --git a/docs/api/fastify-metrics.isummaryoverrides.help.md b/docs/api/fastify-metrics.isummaryoverrides.help.md index ef498ec..663762e 100644 --- a/docs/api/fastify-metrics.isummaryoverrides.help.md +++ b/docs/api/fastify-metrics.isummaryoverrides.help.md @@ -6,7 +6,7 @@ Request duration summary help override -Signature: +**Signature:** ```typescript help?: string; diff --git a/docs/api/fastify-metrics.isummaryoverrides.md b/docs/api/fastify-metrics.isummaryoverrides.md index 90e68c1..3f510d0 100644 --- a/docs/api/fastify-metrics.isummaryoverrides.md +++ b/docs/api/fastify-metrics.isummaryoverrides.md @@ -6,18 +6,76 @@ Request time summary config overrides -Signature: +**Signature:** ```typescript export interface ISummaryOverrides extends Partial> ``` -Extends: Partial<SummaryConfiguration<string>> +**Extends:** Partial<SummaryConfiguration<string>> ## Properties -| Property | Modifiers | Type | Description | -| ------------------------------------------------------------------ | --------- | ---------- | -------------------------------------------------------- | -| [help?](./fastify-metrics.isummaryoverrides.help.md) | | string | (Optional) Request duration summary help override | -| [name?](./fastify-metrics.isummaryoverrides.name.md) | | string | (Optional) Request duration summary name override | -| [percentiles?](./fastify-metrics.isummaryoverrides.percentiles.md) | | number\[\] | (Optional) Request duration percentiles override | + + + + +
+ +Property + + + +Modifiers + + + +Type + + + +Description + +
+ +[help?](./fastify-metrics.isummaryoverrides.help.md) + + + + + +string + + + +_(Optional)_ Request duration summary help override + +
+ +[name?](./fastify-metrics.isummaryoverrides.name.md) + + + + + +string + + + +_(Optional)_ Request duration summary name override + +
+ +[percentiles?](./fastify-metrics.isummaryoverrides.percentiles.md) + + + + + +number\[\] + + + +_(Optional)_ Request duration percentiles override + +
diff --git a/docs/api/fastify-metrics.isummaryoverrides.name.md b/docs/api/fastify-metrics.isummaryoverrides.name.md index 836c4d2..4f61d5a 100644 --- a/docs/api/fastify-metrics.isummaryoverrides.name.md +++ b/docs/api/fastify-metrics.isummaryoverrides.name.md @@ -6,7 +6,7 @@ Request duration summary name override -Signature: +**Signature:** ```typescript name?: string; diff --git a/docs/api/fastify-metrics.isummaryoverrides.percentiles.md b/docs/api/fastify-metrics.isummaryoverrides.percentiles.md index b825e1f..bfedd15 100644 --- a/docs/api/fastify-metrics.isummaryoverrides.percentiles.md +++ b/docs/api/fastify-metrics.isummaryoverrides.percentiles.md @@ -6,7 +6,7 @@ Request duration percentiles override -Signature: +**Signature:** ```typescript percentiles?: number[]; diff --git a/docs/api/fastify-metrics.md b/docs/api/fastify-metrics.md index 65eb417..3da6115 100644 --- a/docs/api/fastify-metrics.md +++ b/docs/api/fastify-metrics.md @@ -8,20 +8,116 @@ Prometheus metrics exporter for Fastify. Based on [prom-client](https://github.c ## Interfaces -| Interface | Description | -| ----------------------------------------------------------------------------- | --------------------------------------- | -| [IDefaultMetricsConfig](./fastify-metrics.idefaultmetricsconfig.md) | Default prom-client metrics config | -| [IFastifyMetrics](./fastify-metrics.ifastifymetrics.md) | Plugin decorator | -| [IHistogramOverrides](./fastify-metrics.ihistogramoverrides.md) | Request time histofram config overrides | -| [IMetricsPluginOptions](./fastify-metrics.imetricspluginoptions.md) | Metrics plugin config | -| [IMetricsRouteContextConfig](./fastify-metrics.imetricsroutecontextconfig.md) | Route config for metrics | -| [IRouteLabelsOverrides](./fastify-metrics.iroutelabelsoverrides.md) | Label Overrides | -| [IRouteMetricsConfig](./fastify-metrics.iroutemetricsconfig.md) | Route metrics configuration | -| [IRouteMetricsOverrides](./fastify-metrics.iroutemetricsoverrides.md) | Route metrics overrides. | -| [ISummaryOverrides](./fastify-metrics.isummaryoverrides.md) | Request time summary config overrides | + + + + + + + + + + +
+ +Interface + + + +Description + +
+ +[IDefaultMetricsConfig](./fastify-metrics.idefaultmetricsconfig.md) + + + +Default prom-client metrics config + +
+ +[IFastifyMetrics](./fastify-metrics.ifastifymetrics.md) + + + +Plugin decorator + +
+ +[IHistogramOverrides](./fastify-metrics.ihistogramoverrides.md) + + + +Request time histofram config overrides + +
+ +[IMetricsPluginOptions](./fastify-metrics.imetricspluginoptions.md) + + + +Metrics plugin config + +
+ +[IMetricsRouteContextConfig](./fastify-metrics.imetricsroutecontextconfig.md) + + + +Route config for metrics + +
+ +[IRouteLabelsOverrides](./fastify-metrics.iroutelabelsoverrides.md) + + + +Label Overrides + +
+ +[IRouteMetricsConfig](./fastify-metrics.iroutemetricsconfig.md) + + + +Route metrics configuration + +
+ +[IRouteMetricsOverrides](./fastify-metrics.iroutemetricsoverrides.md) + + + +Route metrics overrides. + +
+ +[ISummaryOverrides](./fastify-metrics.isummaryoverrides.md) + + + +Request time summary config overrides + +
## Variables -| Variable | Description | -| ------------------------------------------ | ------------- | -| [\_default](./fastify-metrics._default.md) | Metric plugin | + + +
+ +Variable + + + +Description + +
+ +[\_default](./fastify-metrics._default.md) + + + +Metric plugin + +
diff --git a/docs/api/index.md b/docs/api/index.md index 0bbcde9..0632950 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -6,6 +6,22 @@ ## Packages -| Package | Description | -| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [fastify-metrics](./fastify-metrics.md) | Prometheus metrics exporter for Fastify. Based on [prom-client](https://github.com/siimon/prom-client). Also by default it adds fastify route response time metrics (histogram and summary). | + + +
+ +Package + + + +Description + +
+ +[fastify-metrics](./fastify-metrics.md) + + + +Prometheus metrics exporter for Fastify. Based on [prom-client](https://github.com/siimon/prom-client). Also by default it adds fastify route response time metrics (histogram and summary). + +
diff --git a/eslint.config.mjs b/eslint.config.mjs index 2352e6b..0d4db9b 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,111 +1,125 @@ -import prettier from "eslint-plugin-prettier"; -import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin"; -import tsdoc from "eslint-plugin-tsdoc"; -import globals from "globals"; -import tsParser from "@typescript-eslint/parser"; -import jest from "eslint-plugin-jest"; -import path from "node:path"; -import { fileURLToPath } from "node:url"; -import js from "@eslint/js"; -import { FlatCompat } from "@eslint/eslintrc"; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { FlatCompat } from '@eslint/eslintrc'; +import js from '@eslint/js'; +import typescriptEslintEslintPlugin from '@typescript-eslint/eslint-plugin'; +import tsParser from '@typescript-eslint/parser'; +import importX from 'eslint-plugin-import-x'; +import jest from 'eslint-plugin-jest'; +import prettier from 'eslint-plugin-prettier'; +import tsdoc from 'eslint-plugin-tsdoc'; +// import globals from 'globals'; +import tseslint from 'typescript-eslint'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, }); -export default [{ +export default [ + js.configs.recommended, + importX.flatConfigs.recommended, + importX.flatConfigs.typescript, + ...tseslint.configs.strict, + ...tseslint.configs.stylistic, + jest.configs['flat/recommended'], + { ignores: [ - "**/logs/", - "**/coverage/", - "**/node_modules/", - "**/.idea/", - "**/.vscode/", - "**/static/", - "**/*.xxx.*", - "**/dist/", - "examples/**/*", - "**/.eslintrc.js", - "**/jest.config.js", + '**/logs/', + '**/coverage/', + '**/node_modules/', + '**/.vscode/', + '**/.idea/', + '**/jest.config.js', + '**/*.xxx.*', + '**/dist/', + 'examples/**/*', + '**/eslint.config.mjs', + '**/.prettierrc.js', + '**/.releaserc.js', + '**/.release/', ], -}, ...compat.extends( - "eslint:recommended", - "google", - "prettier", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", -), { + }, + ...compat.extends( + 'google', + 'prettier', + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + ), + { + settings: { + 'import/resolver': { + typescript: { + alwaysTryTypes: true, // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` + project: 'tsconfig.json', + }, + }, + }, plugins: { - prettier, - "@typescript-eslint": typescriptEslintEslintPlugin, - tsdoc, + jest, + prettier, + '@typescript-eslint': typescriptEslintEslintPlugin, + tsdoc, }, languageOptions: { - globals: { - ...globals.node, - ...Object.fromEntries(Object.entries(globals.jest).map(([key]) => [key, "off"])), - }, - - parser: tsParser, - ecmaVersion: 2020, - sourceType: "module", + parser: tsParser, + ecmaVersion: 2020, + sourceType: 'module', - parserOptions: { - project: "tsconfig.json", - }, + parserOptions: { + project: 'tsconfig.json', + }, }, rules: { - "new-cap": ["error", { - capIsNewExceptions: ["ObjectId", "Fastify"], - }], - - "require-jsdoc": "off", - "valid-jsdoc": "off", - "tsdoc/syntax": "error", - "prettier/prettier": "error", - "@typescript-eslint/require-await": "off", - "@typescript-eslint/no-unsafe-member-access": "off", - "@typescript-eslint/no-unsafe-call": "off", - }, -}, { - files: ["**/__tests__/**/*", "**/__mocks__/**/*"], + 'import-x/no-unresolved': 'error', + 'import-x/no-duplicates': ['error'], - plugins: { - jest, - }, - - languageOptions: { - globals: { - ...jest.environments.globals.globals, + 'new-cap': [ + 'error', + { + capIsNewExceptions: ['ObjectId', 'Fastify'], + capIsNewExceptionPattern: '^Type\\.', }, - }, + ], + 'require-jsdoc': 'off', + 'valid-jsdoc': 'off', + 'tsdoc/syntax': 'error', + 'prettier/prettier': 'error', + '@typescript-eslint/require-await': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/consistent-type-exports': 'error', + '@typescript-eslint/no-extraneous-class': 'off', + '@typescript-eslint/no-empty-object-type': 'off', + '@typescript-eslint/consistent-type-imports': 'error', + '@typescript-eslint/no-import-type-side-effects': 'error', - rules: { - "jest/expect-expect": "warn", - "jest/no-alias-methods": "error", - "jest/no-commented-out-tests": "warn", - "jest/no-conditional-expect": "error", - "jest/no-deprecated-functions": "error", - "jest/no-disabled-tests": "warn", - "jest/no-done-callback": "error", - "jest/no-export": "error", - "jest/no-focused-tests": "error", - "jest/no-identical-title": "error", - "jest/no-interpolation-in-snapshots": "error", - "jest/no-jasmine-globals": "error", - "jest/no-mocks-import": "error", - "jest/no-standalone-expect": "error", - "jest/no-test-prefixes": "error", - "jest/valid-describe-callback": "error", - "jest/valid-expect": "error", - "jest/valid-expect-in-promise": "error", - "jest/valid-title": "error", + 'jest/expect-expect': 'warn', + 'jest/no-alias-methods': 'error', + 'jest/no-commented-out-tests': 'warn', + 'jest/no-conditional-expect': 'error', + 'jest/no-deprecated-functions': 'error', + 'jest/no-disabled-tests': 'warn', + 'jest/no-done-callback': 'error', + 'jest/no-export': 'error', + 'jest/no-focused-tests': 'error', + 'jest/no-identical-title': 'error', + 'jest/no-interpolation-in-snapshots': 'error', + 'jest/no-jasmine-globals': 'error', + 'jest/no-mocks-import': 'error', + 'jest/no-standalone-expect': 'error', + 'jest/no-test-prefixes': 'error', + 'jest/valid-describe-callback': 'error', + 'jest/valid-expect': 'error', + 'jest/valid-expect-in-promise': 'error', + 'jest/valid-title': 'error', }, -}]; \ No newline at end of file + }, +]; diff --git a/etc/fastify-metrics.api.md b/etc/fastify-metrics.api.md index 5ee7f2d..e2dd1e3 100644 --- a/etc/fastify-metrics.api.md +++ b/etc/fastify-metrics.api.md @@ -3,6 +3,7 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts + import client from 'prom-client'; import { DefaultMetricsCollectorConfiguration } from 'prom-client'; import { FastifyBaseLogger } from 'fastify'; @@ -17,91 +18,79 @@ import { RouteOptions } from 'fastify'; import { SummaryConfiguration } from 'prom-client'; // @public -const _default: FastifyPluginCallback< - Partial, - RawServerDefault, - FastifyTypeProviderDefault, - FastifyBaseLogger ->; +const _default: FastifyPluginCallback, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>; export default _default; // @public -export interface IDefaultMetricsConfig - extends DefaultMetricsCollectorConfiguration<'text/plain; version=0.0.4; charset=utf-8'> { - enabled: boolean; +export interface IDefaultMetricsConfig extends DefaultMetricsCollectorConfiguration<'text/plain; version=0.0.4; charset=utf-8'> { + enabled: boolean; } // @public export interface IFastifyMetrics { - client: typeof client; - initMetricsInRegistry(): void; + client: typeof client; + initMetricsInRegistry(): void; } // @public -export interface IHistogramOverrides - extends Partial> { - buckets?: number[]; - help?: string; - name?: string; +export interface IHistogramOverrides extends Partial> { + buckets?: number[]; + help?: string; + name?: string; } // @public export interface IMetricsPluginOptions { - clearRegisterOnInit: boolean; - defaultMetrics: IDefaultMetricsConfig; - endpoint: string | null | RouteOptions; - name: string; - promClient: typeof client | null; - routeMetrics: IRouteMetricsConfig; + clearRegisterOnInit: boolean; + defaultMetrics: IDefaultMetricsConfig; + endpoint: string | null | RouteOptions; + name: string; + promClient: typeof client | null; + routeMetrics: IRouteMetricsConfig; } // @public export interface IMetricsRouteContextConfig { - disableMetrics?: boolean; - statsId?: string; + disableMetrics?: boolean; + statsId?: string; } // @public export interface IRouteLabelsOverrides { - getRouteLabel?: (request: FastifyRequest) => string; - method?: string; - route?: string; - status?: string; + getRouteLabel?: (request: FastifyRequest) => string; + method?: string; + route?: string; + status?: string; } // @public export interface IRouteMetricsConfig { - customLabels?: Record< - string, - string | ((request: FastifyRequest, reply: FastifyReply) => string) - >; - // (undocumented) - enabled?: - | boolean - | { + customLabels?: Record string)>; + // (undocumented) + enabled?: boolean | { histogram?: boolean; summary?: boolean; - }; - groupStatusCodes?: boolean; - invalidRouteGroup?: string; - methodBlacklist?: readonly HTTPMethods[]; - overrides?: IRouteMetricsOverrides; - registeredRoutesOnly?: boolean; - routeBlacklist?: readonly (string | RegExp)[]; + }; + groupStatusCodes?: boolean; + invalidRouteGroup?: string; + methodBlacklist?: readonly HTTPMethods[]; + overrides?: IRouteMetricsOverrides; + registeredRoutesOnly?: boolean; + routeBlacklist?: readonly (string | RegExp)[]; } // @public export interface IRouteMetricsOverrides { - histogram?: IHistogramOverrides; - labels?: IRouteLabelsOverrides; - summary?: ISummaryOverrides; + histogram?: IHistogramOverrides; + labels?: IRouteLabelsOverrides; + summary?: ISummaryOverrides; } // @public -export interface ISummaryOverrides - extends Partial> { - help?: string; - name?: string; - percentiles?: number[]; +export interface ISummaryOverrides extends Partial> { + help?: string; + name?: string; + percentiles?: number[]; } + ``` diff --git a/examples/example.ts b/examples/example.ts index abb77be..096949e 100644 --- a/examples/example.ts +++ b/examples/example.ts @@ -1,4 +1,4 @@ -import fastify from 'fastify'; +import { fastify } from 'fastify'; import fastifyMetrics from '../dist'; const app = fastify({ diff --git a/package.json b/package.json index 75e5256..5662215 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "build:node": "tsc -p tsconfig.build.json", "example:ts": "ts-node examples/example.ts", "lint": "pnpm run lint:types && pnpm run lint:codestyle && pnpm run lint:packages", - "lint:codestyle": "eslint . --ext js,jsx,ts,tsx", + "lint:codestyle": "eslint", "lint:packages": "pnpm audit --prod --audit-level=high", "lint:types": "tsc -p tsconfig.json", "release": "semantic-release", @@ -49,6 +49,7 @@ "devDependencies": { "@commitlint/cli": "^19.5.0", "@commitlint/config-conventional": "^19.5.0", + "@ianvs/prettier-plugin-sort-imports": "^4.3.1", "@jest/globals": "^29.7.0", "@microsoft/api-documenter": "^7.25.14", "@microsoft/api-extractor": "^7.47.9", @@ -59,6 +60,8 @@ "@semantic-release/github": "^10.3.4", "@semantic-release/npm": "^12.0.1", "@semantic-release/release-notes-generator": "^14.0.1", + "@tsconfig/node-lts": "^20.1.3", + "@tsconfig/strictest": "^2.0.5", "@types/node": "^22.5.5", "@typescript-eslint/eslint-plugin": "^8.6.0", "@typescript-eslint/parser": "^8.6.0", @@ -66,7 +69,8 @@ "eslint": "^9.10.0", "eslint-config-google": "^0.14.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-import": "^2.30.0", + "eslint-import-resolver-typescript": "^3.6.3", + "eslint-plugin-import-x": "^4.2.1", "eslint-plugin-jest": "^28.8.3", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-tsdoc": "^0.3.0", @@ -74,14 +78,15 @@ "jest": "^29.7.0", "prettier": "^3.3.3", "prettier-plugin-jsdoc": "^1.3.0", - "prettier-plugin-organize-imports": "^4.0.0", "prettier-plugin-packagejson": "^2.5.2", - "prettier-plugin-sort-json": "4.0.0", + "prettier-plugin-sh": "^0.14.0", + "prettier-plugin-sort-json": "^4.0.0", "pretty-quick": "^4.0.0", "semantic-release": "^24.1.1", "ts-jest": "^29.2.5", "ts-node": "^10.9.2", - "typescript": "~5.6.2" + "typescript": "^5.6.2", + "typescript-eslint": "^8.6.0" }, "peerDependencies": { "fastify": ">=5" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2bdf463..f98f12e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,6 +21,9 @@ importers: '@commitlint/config-conventional': specifier: ^19.5.0 version: 19.5.0 + '@ianvs/prettier-plugin-sort-imports': + specifier: ^4.3.1 + version: 4.3.1(prettier@3.3.3) '@jest/globals': specifier: ^29.7.0 version: 29.7.0 @@ -51,6 +54,12 @@ importers: '@semantic-release/release-notes-generator': specifier: ^14.0.1 version: 14.0.1(semantic-release@24.1.1(typescript@5.6.2)) + '@tsconfig/node-lts': + specifier: ^20.1.3 + version: 20.1.3 + '@tsconfig/strictest': + specifier: ^2.0.5 + version: 2.0.5 '@types/node': specifier: ^22.5.5 version: 22.5.5 @@ -72,9 +81,12 @@ importers: eslint-config-prettier: specifier: ^9.1.0 version: 9.1.0(eslint@9.10.0(jiti@1.21.6)) - eslint-plugin-import: - specifier: ^2.30.0 - version: 2.30.0(@typescript-eslint/parser@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint@9.10.0(jiti@1.21.6)) + eslint-import-resolver-typescript: + specifier: ^3.6.3 + version: 3.6.3(@typescript-eslint/parser@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint-plugin-import-x@4.2.1(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint@9.10.0(jiti@1.21.6)) + eslint-plugin-import-x: + specifier: ^4.2.1 + version: 4.2.1(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2) eslint-plugin-jest: specifier: ^28.8.3 version: 28.8.3(@typescript-eslint/eslint-plugin@8.6.0(@typescript-eslint/parser@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint@9.10.0(jiti@1.21.6))(jest@29.7.0(@types/node@22.5.5)(ts-node@10.9.2(@types/node@22.5.5)(typescript@5.6.2)))(typescript@5.6.2) @@ -96,14 +108,14 @@ importers: prettier-plugin-jsdoc: specifier: ^1.3.0 version: 1.3.0(prettier@3.3.3) - prettier-plugin-organize-imports: - specifier: ^4.0.0 - version: 4.0.0(prettier@3.3.3)(typescript@5.6.2) prettier-plugin-packagejson: specifier: ^2.5.2 version: 2.5.2(prettier@3.3.3) + prettier-plugin-sh: + specifier: ^0.14.0 + version: 0.14.0(prettier@3.3.3) prettier-plugin-sort-json: - specifier: 4.0.0 + specifier: ^4.0.0 version: 4.0.0(prettier@3.3.3) pretty-quick: specifier: ^4.0.0 @@ -118,8 +130,11 @@ importers: specifier: ^10.9.2 version: 10.9.2(@types/node@22.5.5)(typescript@5.6.2) typescript: - specifier: ~5.6.2 + specifier: ^5.6.2 version: 5.6.2 + typescript-eslint: + specifier: ^8.6.0 + version: 8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2) packages: @@ -439,6 +454,15 @@ packages: resolution: {integrity: sha512-e5+YUKENATs1JgYHMzTr2MW/NDcXGfYFAuOQU8gJgF/kEh4EqKgfGrfLI67bMD4tbhZVlkigz/9YYwWcbOFthg==} engines: {node: '>=10.13.0'} + '@ianvs/prettier-plugin-sort-imports@4.3.1': + resolution: {integrity: sha512-ZHwbyjkANZOjaBm3ZosADD2OUYGFzQGxfy67HmGZU94mHqe7g1LCMA7YYKB1Cq+UTPCBqlAYapY0KXAjKEw8Sg==} + peerDependencies: + '@vue/compiler-sfc': 2.7.x || 3.x + prettier: 2 || 3 + peerDependenciesMeta: + '@vue/compiler-sfc': + optional: true + '@istanbuljs/load-nyc-config@1.1.0': resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} engines: {node: '>=8'} @@ -563,6 +587,10 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} + '@nolyfill/is-core-module@1.0.39': + resolution: {integrity: sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==} + engines: {node: '>=12.4.0'} + '@octokit/auth-token@5.1.1': resolution: {integrity: sha512-rh3G3wDO8J9wSjfI436JUKzHIxq8NaiL0tVeB2aXmG6p/9859aUOAjA9pmSPNGGZxfwmaJ9ozOJImuNVJdpvbA==} engines: {node: '>= 18'} @@ -631,9 +659,6 @@ packages: resolution: {integrity: sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==} engines: {node: '>=12'} - '@rtsao/scc@1.1.0': - resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} - '@rushstack/node-core-library@5.9.0': resolution: {integrity: sha512-MMsshEWkTbXqxqFxD4gcIUWQOCeBChlGczdZbHfqmNZQFLHB3yWxDFSMHFUdu2/OB9NUk7Awn5qRL+rws4HQNg==} peerDependencies: @@ -730,6 +755,9 @@ packages: '@sinonjs/fake-timers@10.3.0': resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + '@tsconfig/node-lts@20.1.3': + resolution: {integrity: sha512-m3b7EP2U+h5tNSpaBMfcTuHmHn04wrgRPQQrfKt75YIPq6kPs2153/KfPHdqkEWGx5pEBvS6rnvToT+yTtC1iw==} + '@tsconfig/node10@1.0.11': resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} @@ -742,6 +770,9 @@ packages: '@tsconfig/node16@1.0.4': resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + '@tsconfig/strictest@2.0.5': + resolution: {integrity: sha512-ec4tjL2Rr0pkZ5hww65c+EEPYwxOi4Ryv+0MtjeaSQRJyq322Q27eOQiFbuNgw2hpL4hB1/W/HBGk3VKS43osg==} + '@types/argparse@1.0.38': resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==} @@ -775,9 +806,6 @@ packages: '@types/istanbul-reports@3.0.4': resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} - '@types/json5@0.0.29': - resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} - '@types/mdast@4.0.4': resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} @@ -973,33 +1001,9 @@ packages: argv-formatter@1.0.0: resolution: {integrity: sha512-F2+Hkm9xFaRg+GkaNnbwXNDV5O6pnCFEmqyhvfC/Ic5LbgOWjJh3L+mN/s91rxVL3znE7DYVpW0GJFT+4YBgWw==} - array-buffer-byte-length@1.0.1: - resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} - engines: {node: '>= 0.4'} - array-ify@1.0.0: resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==} - array-includes@3.1.8: - resolution: {integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==} - engines: {node: '>= 0.4'} - - array.prototype.findlastindex@1.2.5: - resolution: {integrity: sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==} - engines: {node: '>= 0.4'} - - array.prototype.flat@1.3.2: - resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} - engines: {node: '>= 0.4'} - - array.prototype.flatmap@1.3.2: - resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==} - engines: {node: '>= 0.4'} - - arraybuffer.prototype.slice@1.0.3: - resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} - engines: {node: '>= 0.4'} - async@3.2.6: resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} @@ -1007,10 +1011,6 @@ packages: resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} engines: {node: '>=8.0.0'} - available-typed-arrays@1.0.7: - resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} - engines: {node: '>= 0.4'} - avvio@9.0.0: resolution: {integrity: sha512-UbYrOXgE/I+knFG+3kJr9AgC7uNo8DG+FGGODpH9Bj1O1kL/QDjBXnTem9leD3VdQKtaHjV3O85DQ7hHh4IIHw==} @@ -1085,10 +1085,6 @@ packages: buffer@6.0.3: resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} - call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} - callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -1318,18 +1314,6 @@ packages: resolution: {integrity: sha512-wAV9QHOsNbwnWdNW2FYvE1P56wtgSbM+3SZcdGiWQILwVjACCXDCI3Ai8QlCjMDB8YK5zySiXZYBiwGmNY3lnw==} engines: {node: '>=12'} - data-view-buffer@1.0.1: - resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} - engines: {node: '>= 0.4'} - - data-view-byte-length@1.0.1: - resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==} - engines: {node: '>= 0.4'} - - data-view-byte-offset@1.0.0: - resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} - engines: {node: '>= 0.4'} - debug@3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} peerDependencies: @@ -1369,14 +1353,6 @@ packages: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} - define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} - engines: {node: '>= 0.4'} - - define-properties@1.2.1: - resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} - engines: {node: '>= 0.4'} - dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} @@ -1408,9 +1384,9 @@ packages: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} - doctrine@2.1.0: - resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} - engines: {node: '>=0.10.0'} + doctrine@3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} dot-prop@5.3.0: resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} @@ -1437,6 +1413,10 @@ packages: emojilib@2.4.0: resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + enhanced-resolve@5.17.1: + resolution: {integrity: sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==} + engines: {node: '>=10.13.0'} + env-ci@11.1.0: resolution: {integrity: sha512-Z8dnwSDbV1XYM9SBF2J0GcNVvmfmfh3a49qddGIROhBoVro6MZVTji15z/sJbQ2ko2ei8n988EU1wzoLU/tF+g==} engines: {node: ^18.17 || >=20.6.1} @@ -1452,33 +1432,6 @@ packages: error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} - es-abstract@1.23.3: - resolution: {integrity: sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==} - engines: {node: '>= 0.4'} - - es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - es-object-atoms@1.0.0: - resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} - engines: {node: '>= 0.4'} - - es-set-tostringtag@2.0.3: - resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==} - engines: {node: '>= 0.4'} - - es-shim-unscopables@1.0.2: - resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} - - es-to-primitive@1.2.1: - resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} - engines: {node: '>= 0.4'} - escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} @@ -1514,6 +1467,19 @@ packages: eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} + eslint-import-resolver-typescript@3.6.3: + resolution: {integrity: sha512-ud9aw4szY9cCT1EWWdGv1L1XR6hh2PaRWif0j2QjQ0pgTY/69iw+W0Z4qZv5wHahOl8isEr+k/JnyAqNQkLkIA==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + eslint: '*' + eslint-plugin-import: '*' + eslint-plugin-import-x: '*' + peerDependenciesMeta: + eslint-plugin-import: + optional: true + eslint-plugin-import-x: + optional: true + eslint-module-utils@2.11.0: resolution: {integrity: sha512-gbBE5Hitek/oG6MUVj6sFuzEjA/ClzNflVrLovHi/JgLdC7fiN5gLAY1WIPW1a0V5I999MnsrvVrCOGmmVqDBQ==} engines: {node: '>=4'} @@ -1535,15 +1501,11 @@ packages: eslint-import-resolver-webpack: optional: true - eslint-plugin-import@2.30.0: - resolution: {integrity: sha512-/mHNE9jINJfiD2EKkg1BKyPyUk4zdnT54YgbOgfjSakWT5oyX/qQLVNTkehyfpcMxZXMy1zyonZ2v7hZTX43Yw==} - engines: {node: '>=4'} + eslint-plugin-import-x@4.2.1: + resolution: {integrity: sha512-WWi2GedccIJa0zXxx3WDnTgouGQTtdYK1nhXMwywbqqAgB0Ov+p1pYBsWh3VaB0bvBOwLse6OfVII7jZD9xo5Q==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true + eslint: ^8.57.0 || ^9.0.0 eslint-plugin-jest@28.8.3: resolution: {integrity: sha512-HIQ3t9hASLKm2IhIOqnu+ifw7uLZkIlR7RYNv7fMcEi/p0CIiJmfriStQS2LDkgtY4nyLbIZAD+JL347Yc2ETQ==} @@ -1751,9 +1713,6 @@ packages: flatted@3.3.1: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} - for-each@0.3.3: - resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} - forwarded@0.2.0: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} @@ -1784,13 +1743,6 @@ packages: resolution: {integrity: sha512-939eZS4gJ3htTHAldmyyuzlrD58P03fHG49v2JfFXbV6OhvZKRC9j2yAtdHw/zrp2zXHuv05zMIy40F0ge7spA==} engines: {node: '>=18'} - function.prototype.name@1.1.6: - resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} - engines: {node: '>= 0.4'} - - functions-have-names@1.2.3: - resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} @@ -1799,10 +1751,6 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - get-package-type@0.1.0: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} engines: {node: '>=8.0.0'} @@ -1827,9 +1775,8 @@ packages: resolution: {integrity: sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==} engines: {node: '>=18'} - get-symbol-description@1.0.2: - resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} - engines: {node: '>= 0.4'} + get-tsconfig@4.8.1: + resolution: {integrity: sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==} git-hooks-list@3.1.0: resolution: {integrity: sha512-LF8VeHeR7v+wAbXqfgRlTSX/1BJR9Q1vEMR8JAz1cEg6GX07+zyj3sAdDvYjj/xnlIfVuGgj4qBei1K3hKH+PA==} @@ -1876,10 +1823,6 @@ packages: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} - globalthis@1.0.4: - resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} - engines: {node: '>= 0.4'} - globby@13.2.2: resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -1888,9 +1831,6 @@ packages: resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} engines: {node: '>=18'} - gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - graceful-fs@4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} @@ -1905,9 +1845,6 @@ packages: engines: {node: '>=0.4.7'} hasBin: true - has-bigints@1.0.2: - resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} - has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} @@ -1916,21 +1853,6 @@ packages: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} - has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} - - has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} - engines: {node: '>= 0.4'} - - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - - has-tostringtag@1.0.2: - resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} - engines: {node: '>= 0.4'} - hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} @@ -2030,10 +1952,6 @@ packages: resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - internal-slot@1.0.7: - resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} - engines: {node: '>= 0.4'} - into-stream@7.0.0: resolution: {integrity: sha512-2dYz766i9HprMBasCMvHMuazJ7u4WzhJwo5kb3iPSiW/iRYV6uPari3zHoqZlnuaR7V1bEiNMxikhp37rdBXbw==} engines: {node: '>=12'} @@ -2042,36 +1960,16 @@ packages: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} - is-array-buffer@3.0.4: - resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} - engines: {node: '>= 0.4'} - is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - is-bigint@1.0.4: - resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} - - is-boolean-object@1.1.2: - resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} - engines: {node: '>= 0.4'} - - is-callable@1.2.7: - resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} - engines: {node: '>= 0.4'} + is-bun-module@1.2.1: + resolution: {integrity: sha512-AmidtEM6D6NmUiLOvvU7+IePxjEjOzra2h0pSrsfSAcXwl/83zLLXDByafUJy9k/rKK0pvXMLdwKwGHlX2Ke6Q==} is-core-module@2.15.1: resolution: {integrity: sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==} engines: {node: '>= 0.4'} - is-data-view@1.0.1: - resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} - engines: {node: '>= 0.4'} - - is-date-object@1.0.5: - resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} - engines: {node: '>= 0.4'} - is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -2088,14 +1986,6 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} - is-negative-zero@2.0.3: - resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} - engines: {node: '>= 0.4'} - - is-number-object@1.0.7: - resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} - engines: {node: '>= 0.4'} - is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} @@ -2112,14 +2002,6 @@ packages: resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} engines: {node: '>=12'} - is-regex@1.1.4: - resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} - engines: {node: '>= 0.4'} - - is-shared-array-buffer@1.0.3: - resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==} - engines: {node: '>= 0.4'} - is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} @@ -2132,35 +2014,17 @@ packages: resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==} engines: {node: '>=18'} - is-string@1.0.7: - resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} - engines: {node: '>= 0.4'} - - is-symbol@1.0.4: - resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} - engines: {node: '>= 0.4'} - is-text-path@2.0.0: resolution: {integrity: sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==} engines: {node: '>=8'} - is-typed-array@1.1.13: - resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} - engines: {node: '>= 0.4'} - is-unicode-supported@2.1.0: resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} engines: {node: '>=18'} - is-weakref@1.0.2: - resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} - isarray@1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} - isarray@2.0.5: - resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} - isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -2378,10 +2242,6 @@ packages: json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - json5@1.0.2: - resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} - hasBin: true - json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} @@ -2642,6 +2502,9 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + mvdan-sh@0.10.1: + resolution: {integrity: sha512-kMbrH0EObaKmK3nVRKUIIya1dpASHIEusM13S4V1ViHFuxuNxCo+arxoa6j/dbV22YBGjl7UKJm9QQKJ2Crzhg==} + mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} @@ -2766,30 +2629,6 @@ packages: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} - object-inspect@1.13.2: - resolution: {integrity: sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==} - engines: {node: '>= 0.4'} - - object-keys@1.1.1: - resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} - engines: {node: '>= 0.4'} - - object.assign@4.1.5: - resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} - engines: {node: '>= 0.4'} - - object.fromentries@2.0.8: - resolution: {integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==} - engines: {node: '>= 0.4'} - - object.groupby@1.0.3: - resolution: {integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==} - engines: {node: '>= 0.4'} - - object.values@1.2.0: - resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==} - engines: {node: '>= 0.4'} - on-exit-leak-free@2.1.2: resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==} engines: {node: '>=14.0.0'} @@ -2974,10 +2813,6 @@ packages: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} - possible-typed-array-names@1.0.0: - resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} - engines: {node: '>= 0.4'} - prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -2992,19 +2827,6 @@ packages: peerDependencies: prettier: ^3.0.0 - prettier-plugin-organize-imports@4.0.0: - resolution: {integrity: sha512-vnKSdgv9aOlqKeEFGhf9SCBsTyzDSyScy1k7E0R1Uo4L0cTcOV7c1XQaT7jfXIOc/p08WLBfN2QUQA9zDSZMxA==} - peerDependencies: - '@vue/language-plugin-pug': ^2.0.24 - prettier: '>=2.0' - typescript: '>=2.9' - vue-tsc: ^2.0.24 - peerDependenciesMeta: - '@vue/language-plugin-pug': - optional: true - vue-tsc: - optional: true - prettier-plugin-packagejson@2.5.2: resolution: {integrity: sha512-w+TmoLv2pIa+siplW1cCj2ujEXQQS6z7wmWLOiLQK/2QVl7Wy6xh/ZUpqQw8tbKMXDodmSW4GONxlA33xpdNOg==} peerDependencies: @@ -3013,6 +2835,12 @@ packages: prettier: optional: true + prettier-plugin-sh@0.14.0: + resolution: {integrity: sha512-hfXulj5+zEl/ulrO5kMuuTPKmXvOg0bnLHY1hKFNN/N+/903iZbNp8NyZBTsgI8dtkSgFfAEIQq0IQTyP1ZVFQ==} + engines: {node: '>=16.0.0'} + peerDependencies: + prettier: ^3.0.3 + prettier-plugin-sort-json@4.0.0: resolution: {integrity: sha512-zV5g+bWFD2zAqyQ8gCkwUTC49o9FxslaUdirwivt5GZHcf57hCocavykuyYqbExoEsuBOg8IU36OY7zmVEMOWA==} engines: {node: '>=18.0.0'} @@ -3103,10 +2931,6 @@ packages: resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==} engines: {node: '>= 12.13.0'} - regexp.prototype.flags@1.5.2: - resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} - engines: {node: '>= 0.4'} - registry-auth-token@5.0.2: resolution: {integrity: sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==} engines: {node: '>=14'} @@ -3131,6 +2955,9 @@ packages: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + resolve.exports@2.0.2: resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} engines: {node: '>=10'} @@ -3153,20 +2980,12 @@ packages: run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - safe-array-concat@1.1.2: - resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} - engines: {node: '>=0.4'} - safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - safe-regex-test@1.0.3: - resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} - engines: {node: '>= 0.4'} - safe-regex2@4.0.0: resolution: {integrity: sha512-Hvjfv25jPDVr3U+4LDzBuZPPOymELG3PYcSk5hcevooo1yxxamQL/bHs/GrEPGmMoMEwRrHVGiCA1pXi97B8Ew==} @@ -3207,13 +3026,9 @@ packages: set-cookie-parser@2.7.0: resolution: {integrity: sha512-lXLOiqpkUumhRdFF3k1osNXCy9akgx/dyPZ5p8qAg9seJzXr5ZrlqZuWIMuY6ejOsVLE6flJ5/h3lsn57fQ/PQ==} - set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} - engines: {node: '>= 0.4'} - - set-function-name@2.0.2: - resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==} - engines: {node: '>= 0.4'} + sh-syntax@0.4.2: + resolution: {integrity: sha512-/l2UZ5fhGZLVZa16XQM9/Vq/hezGGbdHeVEA01uWjOL1+7Ek/gt6FquW0iKKws4a9AYPYvlz6RyVvjh3JxOteg==} + engines: {node: '>=16.0.0'} shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} @@ -3223,10 +3038,6 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - side-channel@1.0.6: - resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} - engines: {node: '>= 0.4'} - signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} @@ -3299,6 +3110,9 @@ packages: sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + stable-hash@0.0.4: + resolution: {integrity: sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==} + stack-utils@2.0.6: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} engines: {node: '>=10'} @@ -3318,17 +3132,6 @@ packages: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} - string.prototype.trim@1.2.9: - resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} - engines: {node: '>= 0.4'} - - string.prototype.trimend@1.0.8: - resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} - - string.prototype.trimstart@1.0.8: - resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} - engines: {node: '>= 0.4'} - string_decoder@1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} @@ -3395,6 +3198,10 @@ packages: resolution: {integrity: sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==} engines: {node: ^14.18.0 || >=16.0.0} + tapable@2.2.1: + resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} + engines: {node: '>=6'} + tdigest@0.1.2: resolution: {integrity: sha512-+G0LLgjjo9BZX2MfdvPfH+MKLCrxlXSYec5DaPYP1fe6Iyhf0/fSmJ0bFiZ1F8BT6cGXl2LpltQptzjXKWEkKA==} @@ -3507,9 +3314,6 @@ packages: '@swc/wasm': optional: true - tsconfig-paths@3.15.0: - resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} - tslib@2.7.0: resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} @@ -3537,21 +3341,14 @@ packages: resolution: {integrity: sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==} engines: {node: '>=16'} - typed-array-buffer@1.0.2: - resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} - engines: {node: '>= 0.4'} - - typed-array-byte-length@1.0.1: - resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} - engines: {node: '>= 0.4'} - - typed-array-byte-offset@1.0.2: - resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==} - engines: {node: '>= 0.4'} - - typed-array-length@1.0.6: - resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} - engines: {node: '>= 0.4'} + typescript-eslint@8.6.0: + resolution: {integrity: sha512-eEhhlxCEpCd4helh3AO1hk0UP2MvbRi9CtIAJTVPQjuSXOOO2jsEacNi4UdcJzZJbeuVg1gMhtZ8UYb+NFYPrA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true typescript@5.4.2: resolution: {integrity: sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==} @@ -3568,9 +3365,6 @@ packages: engines: {node: '>=0.8.0'} hasBin: true - unbox-primitive@1.0.2: - resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} - undici-types@6.19.8: resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} @@ -3633,13 +3427,6 @@ packages: walker@1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} - which-boxed-primitive@1.0.2: - resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} - - which-typed-array@1.1.15: - resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} - engines: {node: '>= 0.4'} - which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -4101,6 +3888,18 @@ snapshots: '@hutson/parse-repository-url@5.0.0': {} + '@ianvs/prettier-plugin-sort-imports@4.3.1(prettier@3.3.3)': + dependencies: + '@babel/core': 7.25.2 + '@babel/generator': 7.25.6 + '@babel/parser': 7.25.6 + '@babel/traverse': 7.25.6 + '@babel/types': 7.25.6 + prettier: 3.3.3 + semver: 7.6.3 + transitivePeerDependencies: + - supports-color + '@istanbuljs/load-nyc-config@1.1.0': dependencies: camelcase: 5.3.1 @@ -4354,6 +4153,8 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 + '@nolyfill/is-core-module@1.0.39': {} + '@octokit/auth-token@5.1.1': {} '@octokit/core@6.1.2': @@ -4428,8 +4229,6 @@ snapshots: '@pnpm/network.ca-file': 1.0.2 config-chain: 1.1.13 - '@rtsao/scc@1.1.0': {} - '@rushstack/node-core-library@5.9.0(@types/node@22.5.5)': dependencies: ajv: 8.13.0 @@ -4589,6 +4388,8 @@ snapshots: dependencies: '@sinonjs/commons': 3.0.1 + '@tsconfig/node-lts@20.1.3': {} + '@tsconfig/node10@1.0.11': {} '@tsconfig/node12@1.0.11': {} @@ -4597,6 +4398,8 @@ snapshots: '@tsconfig/node16@1.0.4': {} + '@tsconfig/strictest@2.0.5': {} + '@types/argparse@1.0.38': {} '@types/babel__core@7.20.5': @@ -4642,8 +4445,6 @@ snapshots: dependencies: '@types/istanbul-lib-report': 3.0.3 - '@types/json5@0.0.29': {} - '@types/mdast@4.0.4': dependencies: '@types/unist': 3.0.3 @@ -4865,64 +4666,12 @@ snapshots: argv-formatter@1.0.0: {} - array-buffer-byte-length@1.0.1: - dependencies: - call-bind: 1.0.7 - is-array-buffer: 3.0.4 - array-ify@1.0.0: {} - array-includes@3.1.8: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-object-atoms: 1.0.0 - get-intrinsic: 1.2.4 - is-string: 1.0.7 - - array.prototype.findlastindex@1.2.5: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-errors: 1.3.0 - es-object-atoms: 1.0.0 - es-shim-unscopables: 1.0.2 - - array.prototype.flat@1.3.2: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-shim-unscopables: 1.0.2 - - array.prototype.flatmap@1.3.2: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-shim-unscopables: 1.0.2 - - arraybuffer.prototype.slice@1.0.3: - dependencies: - array-buffer-byte-length: 1.0.1 - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-errors: 1.3.0 - get-intrinsic: 1.2.4 - is-array-buffer: 3.0.4 - is-shared-array-buffer: 1.0.3 - async@3.2.6: {} atomic-sleep@1.0.0: {} - available-typed-arrays@1.0.7: - dependencies: - possible-typed-array-names: 1.0.0 - avvio@9.0.0: dependencies: '@fastify/error': 4.0.0 @@ -5030,14 +4779,6 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 - call-bind@1.0.7: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 - callsites@3.1.0: {} camelcase@5.3.1: {} @@ -5278,24 +5019,6 @@ snapshots: dargs@8.1.0: {} - data-view-buffer@1.0.1: - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-data-view: 1.0.1 - - data-view-byte-length@1.0.1: - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-data-view: 1.0.1 - - data-view-byte-offset@1.0.0: - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-data-view: 1.0.1 - debug@3.2.7: dependencies: ms: 2.1.3 @@ -5316,18 +5039,6 @@ snapshots: deepmerge@4.3.1: {} - define-data-property@1.1.4: - dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 - gopd: 1.0.1 - - define-properties@1.2.1: - dependencies: - define-data-property: 1.1.4 - has-property-descriptors: 1.0.2 - object-keys: 1.1.1 - dequal@2.0.3: {} detect-indent@7.0.1: {} @@ -5348,7 +5059,7 @@ snapshots: dependencies: path-type: 4.0.0 - doctrine@2.1.0: + doctrine@3.0.0: dependencies: esutils: 2.0.3 @@ -5372,6 +5083,11 @@ snapshots: emojilib@2.4.0: {} + enhanced-resolve@5.17.1: + dependencies: + graceful-fs: 4.2.11 + tapable: 2.2.1 + env-ci@11.1.0: dependencies: execa: 8.0.1 @@ -5385,81 +5101,6 @@ snapshots: dependencies: is-arrayish: 0.2.1 - es-abstract@1.23.3: - dependencies: - array-buffer-byte-length: 1.0.1 - arraybuffer.prototype.slice: 1.0.3 - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - data-view-buffer: 1.0.1 - data-view-byte-length: 1.0.1 - data-view-byte-offset: 1.0.0 - es-define-property: 1.0.0 - es-errors: 1.3.0 - es-object-atoms: 1.0.0 - es-set-tostringtag: 2.0.3 - es-to-primitive: 1.2.1 - function.prototype.name: 1.1.6 - get-intrinsic: 1.2.4 - get-symbol-description: 1.0.2 - globalthis: 1.0.4 - gopd: 1.0.1 - has-property-descriptors: 1.0.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - internal-slot: 1.0.7 - is-array-buffer: 3.0.4 - is-callable: 1.2.7 - is-data-view: 1.0.1 - is-negative-zero: 2.0.3 - is-regex: 1.1.4 - is-shared-array-buffer: 1.0.3 - is-string: 1.0.7 - is-typed-array: 1.1.13 - is-weakref: 1.0.2 - object-inspect: 1.13.2 - object-keys: 1.1.1 - object.assign: 4.1.5 - regexp.prototype.flags: 1.5.2 - safe-array-concat: 1.1.2 - safe-regex-test: 1.0.3 - string.prototype.trim: 1.2.9 - string.prototype.trimend: 1.0.8 - string.prototype.trimstart: 1.0.8 - typed-array-buffer: 1.0.2 - typed-array-byte-length: 1.0.1 - typed-array-byte-offset: 1.0.2 - typed-array-length: 1.0.6 - unbox-primitive: 1.0.2 - which-typed-array: 1.1.15 - - es-define-property@1.0.0: - dependencies: - get-intrinsic: 1.2.4 - - es-errors@1.3.0: {} - - es-object-atoms@1.0.0: - dependencies: - es-errors: 1.3.0 - - es-set-tostringtag@2.0.3: - dependencies: - get-intrinsic: 1.2.4 - has-tostringtag: 1.0.2 - hasown: 2.0.2 - - es-shim-unscopables@1.0.2: - dependencies: - hasown: 2.0.2 - - es-to-primitive@1.2.1: - dependencies: - is-callable: 1.2.7 - is-date-object: 1.0.5 - is-symbol: 1.0.4 - escalade@3.2.0: {} escape-string-regexp@1.0.5: {} @@ -5486,43 +5127,51 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.11.0(@typescript-eslint/parser@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint@9.10.0(jiti@1.21.6)): + eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint-plugin-import-x@4.2.1(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint@9.10.0(jiti@1.21.6)): + dependencies: + '@nolyfill/is-core-module': 1.0.39 + debug: 4.3.7 + enhanced-resolve: 5.17.1 + eslint: 9.10.0(jiti@1.21.6) + eslint-module-utils: 2.11.0(@typescript-eslint/parser@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint-plugin-import-x@4.2.1(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint@9.10.0(jiti@1.21.6)))(eslint@9.10.0(jiti@1.21.6)) + fast-glob: 3.3.2 + get-tsconfig: 4.8.1 + is-bun-module: 1.2.1 + is-glob: 4.0.3 + optionalDependencies: + eslint-plugin-import-x: 4.2.1(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2) + transitivePeerDependencies: + - '@typescript-eslint/parser' + - eslint-import-resolver-node + - eslint-import-resolver-webpack + - supports-color + + eslint-module-utils@2.11.0(@typescript-eslint/parser@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint-plugin-import-x@4.2.1(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint@9.10.0(jiti@1.21.6)))(eslint@9.10.0(jiti@1.21.6)): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2) eslint: 9.10.0(jiti@1.21.6) - eslint-import-resolver-node: 0.3.9 + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint-plugin-import-x@4.2.1(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint@9.10.0(jiti@1.21.6)) transitivePeerDependencies: - supports-color - eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint@9.10.0(jiti@1.21.6)): + eslint-plugin-import-x@4.2.1(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2): dependencies: - '@rtsao/scc': 1.1.0 - array-includes: 3.1.8 - array.prototype.findlastindex: 1.2.5 - array.prototype.flat: 1.3.2 - array.prototype.flatmap: 1.3.2 - debug: 3.2.7 - doctrine: 2.1.0 + '@typescript-eslint/utils': 8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2) + debug: 4.3.7 + doctrine: 3.0.0 eslint: 9.10.0(jiti@1.21.6) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.11.0(@typescript-eslint/parser@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint-import-resolver-node@0.3.9)(eslint@9.10.0(jiti@1.21.6)) - hasown: 2.0.2 - is-core-module: 2.15.1 + get-tsconfig: 4.8.1 is-glob: 4.0.3 - minimatch: 3.1.2 - object.fromentries: 2.0.8 - object.groupby: 1.0.3 - object.values: 1.2.0 - semver: 6.3.1 - tsconfig-paths: 3.15.0 - optionalDependencies: - '@typescript-eslint/parser': 8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2) + minimatch: 9.0.5 + semver: 7.6.3 + stable-hash: 0.0.4 + tslib: 2.7.0 transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - supports-color + - typescript eslint-plugin-jest@28.8.3(@typescript-eslint/eslint-plugin@8.6.0(@typescript-eslint/parser@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint@9.10.0(jiti@1.21.6))(jest@29.7.0(@types/node@22.5.5)(ts-node@10.9.2(@types/node@22.5.5)(typescript@5.6.2)))(typescript@5.6.2): dependencies: @@ -5798,10 +5447,6 @@ snapshots: flatted@3.3.1: {} - for-each@0.3.3: - dependencies: - is-callable: 1.2.7 - forwarded@0.2.0: {} from2@2.3.0: @@ -5830,27 +5475,10 @@ snapshots: function-timeout@1.0.2: {} - function.prototype.name@1.1.6: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - functions-have-names: 1.2.3 - - functions-have-names@1.2.3: {} - gensync@1.0.0-beta.2: {} get-caller-file@2.0.5: {} - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - get-package-type@0.1.0: {} get-stdin@9.0.0: {} @@ -5866,11 +5494,9 @@ snapshots: '@sec-ant/readable-stream': 0.4.1 is-stream: 4.0.1 - get-symbol-description@1.0.2: + get-tsconfig@4.8.1: dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - get-intrinsic: 1.2.4 + resolve-pkg-maps: 1.0.0 git-hooks-list@3.1.0: {} @@ -5930,11 +5556,6 @@ snapshots: globals@14.0.0: {} - globalthis@1.0.4: - dependencies: - define-properties: 1.2.1 - gopd: 1.0.1 - globby@13.2.2: dependencies: dir-glob: 3.0.1 @@ -5952,10 +5573,6 @@ snapshots: slash: 5.1.0 unicorn-magic: 0.1.0 - gopd@1.0.1: - dependencies: - get-intrinsic: 1.2.4 - graceful-fs@4.2.10: {} graceful-fs@4.2.11: {} @@ -5971,24 +5588,10 @@ snapshots: optionalDependencies: uglify-js: 3.19.3 - has-bigints@1.0.2: {} - has-flag@3.0.0: {} has-flag@4.0.0: {} - has-property-descriptors@1.0.2: - dependencies: - es-define-property: 1.0.0 - - has-proto@1.0.3: {} - - has-symbols@1.0.3: {} - - has-tostringtag@1.0.2: - dependencies: - has-symbols: 1.0.3 - hasown@2.0.2: dependencies: function-bind: 1.1.2 @@ -6071,12 +5674,6 @@ snapshots: ini@4.1.1: {} - internal-slot@1.0.7: - dependencies: - es-errors: 1.3.0 - hasown: 2.0.2 - side-channel: 1.0.6 - into-stream@7.0.0: dependencies: from2: 2.3.0 @@ -6084,36 +5681,16 @@ snapshots: ipaddr.js@1.9.1: {} - is-array-buffer@3.0.4: - dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 - is-arrayish@0.2.1: {} - is-bigint@1.0.4: + is-bun-module@1.2.1: dependencies: - has-bigints: 1.0.2 - - is-boolean-object@1.1.2: - dependencies: - call-bind: 1.0.7 - has-tostringtag: 1.0.2 - - is-callable@1.2.7: {} + semver: 7.6.3 is-core-module@2.15.1: dependencies: hasown: 2.0.2 - is-data-view@1.0.1: - dependencies: - is-typed-array: 1.1.13 - - is-date-object@1.0.5: - dependencies: - has-tostringtag: 1.0.2 - is-extglob@2.1.1: {} is-fullwidth-code-point@3.0.0: {} @@ -6124,12 +5701,6 @@ snapshots: dependencies: is-extglob: 2.1.1 - is-negative-zero@2.0.3: {} - - is-number-object@1.0.7: - dependencies: - has-tostringtag: 1.0.2 - is-number@7.0.0: {} is-obj@2.0.0: {} @@ -6138,47 +5709,20 @@ snapshots: is-plain-obj@4.1.0: {} - is-regex@1.1.4: - dependencies: - call-bind: 1.0.7 - has-tostringtag: 1.0.2 - - is-shared-array-buffer@1.0.3: - dependencies: - call-bind: 1.0.7 - is-stream@2.0.1: {} is-stream@3.0.0: {} is-stream@4.0.1: {} - is-string@1.0.7: - dependencies: - has-tostringtag: 1.0.2 - - is-symbol@1.0.4: - dependencies: - has-symbols: 1.0.3 - is-text-path@2.0.0: dependencies: text-extensions: 2.4.0 - is-typed-array@1.1.13: - dependencies: - which-typed-array: 1.1.15 - is-unicode-supported@2.1.0: {} - is-weakref@1.0.2: - dependencies: - call-bind: 1.0.7 - isarray@1.0.0: {} - isarray@2.0.5: {} - isexe@2.0.0: {} issue-parser@7.0.1: @@ -6586,10 +6130,6 @@ snapshots: json-stable-stringify-without-jsonify@1.0.1: {} - json5@1.0.2: - dependencies: - minimist: 1.2.8 - json5@2.2.3: {} jsonfile@4.0.0: @@ -6908,6 +6448,8 @@ snapshots: ms@2.1.3: {} + mvdan-sh@0.10.1: {} + mz@2.7.0: dependencies: any-promise: 1.3.0 @@ -6958,36 +6500,6 @@ snapshots: object-assign@4.1.1: {} - object-inspect@1.13.2: {} - - object-keys@1.1.1: {} - - object.assign@4.1.5: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - has-symbols: 1.0.3 - object-keys: 1.1.1 - - object.fromentries@2.0.8: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-object-atoms: 1.0.0 - - object.groupby@1.0.3: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - - object.values@1.2.0: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-object-atoms: 1.0.0 - on-exit-leak-free@2.1.2: {} once@1.4.0: @@ -7151,8 +6663,6 @@ snapshots: dependencies: find-up: 4.1.0 - possible-typed-array-names@1.0.0: {} - prelude-ls@1.2.1: {} prettier-linter-helpers@1.0.0: @@ -7168,11 +6678,6 @@ snapshots: transitivePeerDependencies: - supports-color - prettier-plugin-organize-imports@4.0.0(prettier@3.3.3)(typescript@5.6.2): - dependencies: - prettier: 3.3.3 - typescript: 5.6.2 - prettier-plugin-packagejson@2.5.2(prettier@3.3.3): dependencies: sort-package-json: 2.10.1 @@ -7180,6 +6685,12 @@ snapshots: optionalDependencies: prettier: 3.3.3 + prettier-plugin-sh@0.14.0(prettier@3.3.3): + dependencies: + mvdan-sh: 0.10.1 + prettier: 3.3.3 + sh-syntax: 0.4.2 + prettier-plugin-sort-json@4.0.0(prettier@3.3.3): dependencies: prettier: 3.3.3 @@ -7281,13 +6792,6 @@ snapshots: real-require@0.2.0: {} - regexp.prototype.flags@1.5.2: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-errors: 1.3.0 - set-function-name: 2.0.2 - registry-auth-token@5.0.2: dependencies: '@pnpm/npm-conf': 2.3.1 @@ -7304,6 +6808,8 @@ snapshots: resolve-from@5.0.0: {} + resolve-pkg-maps@1.0.0: {} + resolve.exports@2.0.2: {} resolve@1.22.8: @@ -7322,23 +6828,10 @@ snapshots: dependencies: queue-microtask: 1.2.3 - safe-array-concat@1.1.2: - dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 - has-symbols: 1.0.3 - isarray: 2.0.5 - safe-buffer@5.1.2: {} safe-buffer@5.2.1: {} - safe-regex-test@1.0.3: - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-regex: 1.1.4 - safe-regex2@4.0.0: dependencies: ret: 0.5.0 @@ -7398,21 +6891,9 @@ snapshots: set-cookie-parser@2.7.0: {} - set-function-length@1.2.2: - dependencies: - define-data-property: 1.1.4 - es-errors: 1.3.0 - function-bind: 1.1.2 - get-intrinsic: 1.2.4 - gopd: 1.0.1 - has-property-descriptors: 1.0.2 - - set-function-name@2.0.2: + sh-syntax@0.4.2: dependencies: - define-data-property: 1.1.4 - es-errors: 1.3.0 - functions-have-names: 1.2.3 - has-property-descriptors: 1.0.2 + tslib: 2.7.0 shebang-command@2.0.0: dependencies: @@ -7420,13 +6901,6 @@ snapshots: shebang-regex@3.0.0: {} - side-channel@1.0.6: - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - get-intrinsic: 1.2.4 - object-inspect: 1.13.2 - signal-exit@3.0.7: {} signal-exit@4.1.0: {} @@ -7497,6 +6971,8 @@ snapshots: sprintf-js@1.0.3: {} + stable-hash@0.0.4: {} + stack-utils@2.0.6: dependencies: escape-string-regexp: 2.0.0 @@ -7519,25 +6995,6 @@ snapshots: is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 - string.prototype.trim@1.2.9: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-object-atoms: 1.0.0 - - string.prototype.trimend@1.0.8: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-object-atoms: 1.0.0 - - string.prototype.trimstart@1.0.8: - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-object-atoms: 1.0.0 - string_decoder@1.1.1: dependencies: safe-buffer: 5.1.2 @@ -7593,6 +7050,8 @@ snapshots: '@pkgr/core': 0.1.1 tslib: 2.7.0 + tapable@2.2.1: {} + tdigest@0.1.2: dependencies: bintrees: 1.0.2 @@ -7698,13 +7157,6 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 - tsconfig-paths@3.15.0: - dependencies: - '@types/json5': 0.0.29 - json5: 1.0.2 - minimist: 1.2.8 - strip-bom: 3.0.0 - tslib@2.7.0: {} type-check@0.4.0: @@ -7721,37 +7173,16 @@ snapshots: type-fest@4.26.1: {} - typed-array-buffer@1.0.2: - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-typed-array: 1.1.13 - - typed-array-byte-length@1.0.1: - dependencies: - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 - - typed-array-byte-offset@1.0.2: - dependencies: - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 - - typed-array-length@1.0.6: + typescript-eslint@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2): dependencies: - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 - is-typed-array: 1.1.13 - possible-typed-array-names: 1.0.0 + '@typescript-eslint/eslint-plugin': 8.6.0(@typescript-eslint/parser@8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2))(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2) + '@typescript-eslint/parser': 8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2) + '@typescript-eslint/utils': 8.6.0(eslint@9.10.0(jiti@1.21.6))(typescript@5.6.2) + optionalDependencies: + typescript: 5.6.2 + transitivePeerDependencies: + - eslint + - supports-color typescript@5.4.2: {} @@ -7760,13 +7191,6 @@ snapshots: uglify-js@3.19.3: optional: true - unbox-primitive@1.0.2: - dependencies: - call-bind: 1.0.7 - has-bigints: 1.0.2 - has-symbols: 1.0.3 - which-boxed-primitive: 1.0.2 - undici-types@6.19.8: {} unicode-emoji-modifier-base@1.0.0: {} @@ -7820,22 +7244,6 @@ snapshots: dependencies: makeerror: 1.0.12 - which-boxed-primitive@1.0.2: - dependencies: - is-bigint: 1.0.4 - is-boolean-object: 1.1.2 - is-number-object: 1.0.7 - is-string: 1.0.7 - is-symbol: 1.0.4 - - which-typed-array@1.1.15: - dependencies: - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.2 - which@2.0.2: dependencies: isexe: 2.0.0 diff --git a/src/__tests__/clear-register.spec.ts b/src/__tests__/clear-register.spec.ts index ef9be80..34e44c9 100644 --- a/src/__tests__/clear-register.spec.ts +++ b/src/__tests__/clear-register.spec.ts @@ -6,19 +6,19 @@ import { expect, test, } from '@jest/globals'; -import fastify from 'fastify'; -import promClient from 'prom-client'; +import { fastify } from 'fastify'; +import { Counter, register } from 'prom-client'; import fastifyPlugin from '../'; describe('default metrics', () => { afterEach(() => { - promClient.register.clear(); + register.clear(); }); describe('{ clearRegisterOnInit = false }', () => { const app = fastify(); beforeAll(async () => { - const c = new promClient.Counter({ + const c = new Counter({ name: 'test_counter', help: 'Example of a counter', labelNames: ['code'], @@ -55,7 +55,7 @@ describe('default metrics', () => { expect.stringContaining('# HELP test_counter Example of a counter'), expect.stringContaining('# TYPE test_counter counter'), expect.stringContaining('test_counter 100'), - ]) + ]), ); }); }); @@ -63,7 +63,7 @@ describe('default metrics', () => { describe('{ clearRegisterOnInit = true }', () => { const app = fastify(); beforeAll(async () => { - const c = new promClient.Counter({ + const c = new Counter({ name: 'test_counter', help: 'Example of a counter', labelNames: ['code'], diff --git a/src/__tests__/default-metrics.spec.ts b/src/__tests__/default-metrics.spec.ts index aebe875..71d8c0e 100644 --- a/src/__tests__/default-metrics.spec.ts +++ b/src/__tests__/default-metrics.spec.ts @@ -6,13 +6,13 @@ import { expect, test, } from '@jest/globals'; -import fastify from 'fastify'; -import promClient, { Registry } from 'prom-client'; +import { fastify } from 'fastify'; +import { register, Registry } from 'prom-client'; import fastifyPlugin from '../'; describe('default metrics', () => { afterEach(() => { - promClient.register.clear(); + register.clear(); }); describe('{ }', () => { @@ -51,7 +51,7 @@ describe('default metrics', () => { expect.stringMatching(/process_cpu_user_seconds_total \d+/), expect.stringMatching(/process_cpu_system_seconds_total \d+/), expect.stringMatching(/process_start_time_seconds \d+/), - ]) + ]), ); }); }); @@ -94,7 +94,7 @@ describe('default metrics', () => { expect.stringMatching(/process_cpu_user_seconds_total \d+/), expect.stringMatching(/process_cpu_system_seconds_total \d+/), expect.stringMatching(/process_start_time_seconds \d+/), - ]) + ]), ); }); }); @@ -126,7 +126,7 @@ describe('default metrics', () => { app.inject({ method: 'GET', url: '/metrics', - }) + }), ).resolves.toMatchObject({ body: JSON.stringify({ message: 'Route GET:/metrics not found', @@ -144,7 +144,7 @@ describe('default metrics', () => { expect.stringMatching(/process_cpu_user_seconds_total \d+/), expect.stringMatching(/process_cpu_system_seconds_total \d+/), expect.stringMatching(/process_start_time_seconds \d+/), - ]) + ]), ); }); }); @@ -186,7 +186,7 @@ describe('default metrics', () => { expect.stringMatching(/process_cpu_user_seconds_total \d+/), expect.stringMatching(/process_cpu_system_seconds_total \d+/), expect.stringMatching(/process_start_time_seconds \d+/), - ]) + ]), ); }); }); diff --git a/src/__tests__/edge-cases.spec.ts b/src/__tests__/edge-cases.spec.ts index 19b28b4..eceb845 100644 --- a/src/__tests__/edge-cases.spec.ts +++ b/src/__tests__/edge-cases.spec.ts @@ -6,13 +6,13 @@ import { expect, test, } from '@jest/globals'; -import fastify from 'fastify'; -import promClient from 'prom-client'; +import { fastify } from 'fastify'; +import { register } from 'prom-client'; import fastifyPlugin from '..'; describe('edge cases', () => { afterEach(() => { - promClient.register.clear(); + register.clear(); }); describe('registry clear problem', () => { @@ -37,7 +37,7 @@ describe('edge cases', () => { app.inject({ method: 'GET', url: '/test', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -53,7 +53,7 @@ describe('edge cases', () => { expect.arrayContaining([ 'http_request_duration_seconds_count{method="GET",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="GET",route="/test",status_code="200"} 1', - ]) + ]), ); app.metrics.client.register.clear(); @@ -62,7 +62,7 @@ describe('edge cases', () => { app.inject({ method: 'GET', url: '/test', - }) + }), ).resolves.toBeDefined(); const metricsAfterClear = await app.inject({ @@ -83,7 +83,7 @@ describe('edge cases', () => { app.inject({ method: 'GET', url: '/test', - }) + }), ).resolves.toBeDefined(); const metricsAfterReinit = await app.inject({ @@ -127,7 +127,7 @@ describe('edge cases', () => { app.inject({ method: 'GET', url: '/test', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -142,11 +142,11 @@ describe('edge cases', () => { expect(lines).toEqual( expect.arrayContaining([ expect.stringMatching( - /process_cpu_user_seconds_total\{foo="bar"\} \d+/ + /process_cpu_user_seconds_total\{foo="bar"\} \d+/, ), 'http_request_duration_seconds_count{foo="bar",method="GET",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="GET",route="/test",status_code="200",foo="bar"} 1', - ]) + ]), ); }); }); diff --git a/src/__tests__/endpoint-object.spec.ts b/src/__tests__/endpoint-object.spec.ts index 0acf5b0..1e6301d 100644 --- a/src/__tests__/endpoint-object.spec.ts +++ b/src/__tests__/endpoint-object.spec.ts @@ -1,6 +1,6 @@ import { afterAll, beforeAll, describe, expect, test } from '@jest/globals'; -import fastify, { RouteOptions } from 'fastify'; -import promClient from 'prom-client'; +import { fastify, type RouteOptions } from 'fastify'; +import { register } from 'prom-client'; import fastifyPlugin from '../'; describe('endpoint as object', () => { @@ -27,7 +27,7 @@ describe('endpoint as object', () => { }); afterAll(async () => { - promClient.register.clear(); + register.clear(); await app.close(); }); @@ -55,7 +55,7 @@ describe('endpoint as object', () => { expect.stringMatching(/process_cpu_user_seconds_total \d+/), expect.stringMatching(/process_cpu_system_seconds_total \d+/), expect.stringMatching(/process_start_time_seconds \d+/), - ]) + ]), ); }); }); diff --git a/src/__tests__/exports.spec.ts b/src/__tests__/exports.spec.ts index b4ece05..d24f789 100644 --- a/src/__tests__/exports.spec.ts +++ b/src/__tests__/exports.spec.ts @@ -1,6 +1,6 @@ import { afterAll, afterEach, describe, expect, test } from '@jest/globals'; -import fastify from 'fastify'; -import promClient from 'prom-client'; +import { fastify } from 'fastify'; +import { register } from 'prom-client'; import fastifyPlugin from '../'; describe('exports', () => { @@ -11,7 +11,7 @@ describe('exports', () => { describe('plugin', () => { afterEach(() => { - promClient.register.clear(); + register.clear(); }); describe('registers with default name', () => { @@ -40,7 +40,7 @@ describe('plugin', () => { await expect( app.register(fastifyPlugin, { name: 'foo', - }) + }), ).resolves.toBeDefined(); await expect(app.ready()).resolves.toBeDefined(); expect(app.metrics).toBeUndefined(); diff --git a/src/__tests__/inject-prom-client.spec.ts b/src/__tests__/inject-prom-client.spec.ts index 079feaf..b9fab18 100644 --- a/src/__tests__/inject-prom-client.spec.ts +++ b/src/__tests__/inject-prom-client.spec.ts @@ -1,5 +1,5 @@ import { afterEach, describe, expect, test } from '@jest/globals'; -import fastify from 'fastify'; +import { fastify } from 'fastify'; import type promClient from 'prom-client'; import fastifyPlugin from '../'; diff --git a/src/__tests__/route-metrics.spec.ts b/src/__tests__/route-metrics.spec.ts index 6a7bd45..0084672 100644 --- a/src/__tests__/route-metrics.spec.ts +++ b/src/__tests__/route-metrics.spec.ts @@ -1,11 +1,11 @@ import { afterEach, beforeEach, describe, expect, test } from '@jest/globals'; -import fastify, { FastifyRequest } from 'fastify'; -import promClient from 'prom-client'; +import { fastify, type FastifyRequest } from 'fastify'; +import { register } from 'prom-client'; import fastifyPlugin from '../'; describe('route metrics', () => { afterEach(() => { - promClient.register.clear(); + register.clear(); }); describe('{ }', () => { @@ -40,14 +40,14 @@ describe('route metrics', () => { app.inject({ method: 'GET', url: '/test', - }) + }), ).resolves.toBeDefined(); await expect( app.inject({ method: 'POST', url: '/test', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -65,7 +65,7 @@ describe('route metrics', () => { 'http_request_duration_seconds_count{method="POST",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="GET",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="POST",route="/test",status_code="200"} 1', - ]) + ]), ); }); @@ -74,7 +74,7 @@ describe('route metrics', () => { app.inject({ method: 'GET', url: '/unknown', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -90,7 +90,7 @@ describe('route metrics', () => { expect.not.arrayContaining([ 'http_request_duration_seconds_count{method="GET",route="/unknown",status_code="404"} 1', 'http_request_summary_seconds_count{method="GET",route="/unknown",status_code="404"} 1', - ]) + ]), ); }); @@ -99,7 +99,7 @@ describe('route metrics', () => { app.inject({ method: 'GET', url: '/hidden', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -115,7 +115,7 @@ describe('route metrics', () => { expect.not.arrayContaining([ 'http_request_duration_seconds_count{method="GET",route="/hidden",status_code="200"} 1', 'http_request_summary_seconds_count{method="GET",route="/hidden",status_code="200"} 1', - ]) + ]), ); }); @@ -124,7 +124,7 @@ describe('route metrics', () => { app.inject({ method: 'GET', url: '/custom', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -140,7 +140,7 @@ describe('route metrics', () => { expect.arrayContaining([ 'http_request_duration_seconds_count{method="GET",route="__custom__",status_code="200"} 1', 'http_request_summary_seconds_count{method="GET",route="__custom__",status_code="200"} 1', - ]) + ]), ); }); }); @@ -175,14 +175,14 @@ describe('route metrics', () => { app.inject({ method: 'GET', url: '/test', - }) + }), ).resolves.toBeDefined(); await expect( app.inject({ method: 'POST', url: '/test', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -200,7 +200,7 @@ describe('route metrics', () => { 'http_request_duration_seconds_count{method="POST",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="GET",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="POST",route="/test",status_code="200"} 1', - ]) + ]), ); }); }); @@ -235,14 +235,14 @@ describe('route metrics', () => { app.inject({ method: 'GET', url: '/test', - }) + }), ).resolves.toBeDefined(); await expect( app.inject({ method: 'POST', url: '/test', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -260,7 +260,7 @@ describe('route metrics', () => { 'http_request_duration_seconds_count{method="POST",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="GET",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="POST",route="/test",status_code="200"} 1', - ]) + ]), ); }); }); @@ -295,14 +295,14 @@ describe('route metrics', () => { app.inject({ method: 'GET', url: '/unknown', - }) + }), ).resolves.toBeDefined(); await expect( app.inject({ method: 'POST', url: '/test', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -320,7 +320,7 @@ describe('route metrics', () => { 'http_request_duration_seconds_count{method="POST",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="GET",route="__unknown__",status_code="404"} 1', 'http_request_summary_seconds_count{method="POST",route="/test",status_code="200"} 1', - ]) + ]), ); }); }); @@ -356,14 +356,14 @@ describe('route metrics', () => { app.inject({ method: 'GET', url: '/unknown', - }) + }), ).resolves.toBeDefined(); await expect( app.inject({ method: 'POST', url: '/test', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -381,7 +381,7 @@ describe('route metrics', () => { 'http_request_duration_seconds_count{method="POST",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="GET",route="foo",status_code="404"} 1', 'http_request_summary_seconds_count{method="POST",route="/test",status_code="200"} 1', - ]) + ]), ); }); }); @@ -417,14 +417,14 @@ describe('route metrics', () => { app.inject({ method: 'GET', url: '/test', - }) + }), ).resolves.toBeDefined(); await expect( app.inject({ method: 'GET', url: '/test-1', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -440,13 +440,13 @@ describe('route metrics', () => { expect.not.arrayContaining([ 'http_request_duration_seconds_count{method="GET",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="GET",route="/test",status_code="200"} 1', - ]) + ]), ); expect(lines).toEqual( expect.arrayContaining([ 'http_request_duration_seconds_count{method="GET",route="/test-1",status_code="200"} 1', 'http_request_summary_seconds_count{method="GET",route="/test-1",status_code="200"} 1', - ]) + ]), ); }); }); @@ -488,28 +488,28 @@ describe('route metrics', () => { app.inject({ method: 'GET', url: '/api/documentation', - }) + }), ).resolves.toBeDefined(); await expect( app.inject({ method: 'GET', url: '/api/documentation/json', - }) + }), ).resolves.toBeDefined(); await expect( app.inject({ method: 'GET', url: '/api/documentation/yaml', - }) + }), ).resolves.toBeDefined(); await expect( app.inject({ method: 'GET', url: '/api/other', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -526,10 +526,10 @@ describe('route metrics', () => { expect.stringContaining('route="/api/documentation"'), expect.stringContaining('route="/api/documentation/json"'), expect.stringContaining('route="/api/documentation/yaml"'), - ]) + ]), ); expect(lines).toEqual( - expect.arrayContaining([expect.stringContaining('route="/api/other"')]) + expect.arrayContaining([expect.stringContaining('route="/api/other"')]), ); }); }); @@ -562,14 +562,14 @@ describe('route metrics', () => { app.inject({ method: 'GET', url: '/test', - }) + }), ).resolves.toBeDefined(); await expect( app.inject({ method: 'HEAD', url: '/test', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -585,13 +585,13 @@ describe('route metrics', () => { expect.not.arrayContaining([ 'http_request_duration_seconds_count{method="GET",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="GET",route="/test",status_code="200"} 1', - ]) + ]), ); expect(lines).toEqual( expect.arrayContaining([ 'http_request_duration_seconds_count{method="HEAD",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="HEAD",route="/test",status_code="200"} 1', - ]) + ]), ); }); }); @@ -629,7 +629,7 @@ describe('route metrics', () => { await reply .code(parseInt((request.query as { r: string }).r)) .send('foo'); - } + }, ); await app.ready(); }); @@ -640,14 +640,14 @@ describe('route metrics', () => { method: 'GET', url: '/test', query: { r: '200' }, - }) + }), ).resolves.toBeDefined(); await expect( app.inject({ method: 'GET', url: '/test', query: { r: '201' }, - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -663,13 +663,13 @@ describe('route metrics', () => { expect.arrayContaining([ 'http_request_duration_seconds_count{method="GET",route="/test",status_code="2xx"} 2', 'http_request_summary_seconds_count{method="GET",route="/test",status_code="2xx"} 2', - ]) + ]), ); expect(lines).toEqual( expect.not.arrayContaining([ 'http_request_duration_seconds_count{method="HEAD",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="HEAD",route="/test",status_code="200"} 1', - ]) + ]), ); }); }); @@ -706,7 +706,7 @@ describe('route metrics', () => { app.inject({ method: 'GET', url: '/test', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -722,7 +722,7 @@ describe('route metrics', () => { expect.arrayContaining([ 'http_request_duration_seconds_count{method="GET",route="/test",status_code="200"} 1', 'http_request_summary_seconds_count{method="GET",route="/test",status_code="200"} 1', - ]) + ]), ); }); }); @@ -758,7 +758,7 @@ describe('route metrics', () => { app.inject({ method: 'GET', url: '/test', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -774,7 +774,7 @@ describe('route metrics', () => { expect.arrayContaining([ 'http_request_duration_seconds_count{method="GET",route="*",status_code="200",foo="bar",url="/test"} 1', 'http_request_summary_seconds_count{method="GET",route="*",status_code="200",foo="bar",url="/test"} 1', - ]) + ]), ); }); }); @@ -811,7 +811,7 @@ describe('route metrics', () => { app.inject({ method: 'GET', url: '/test', - }) + }), ).resolves.toBeDefined(); const metrics = await app.inject({ @@ -826,13 +826,13 @@ describe('route metrics', () => { expect(lines).toEqual( expect.arrayContaining([ 'http_request_duration_seconds_count{method="GET",route="*",status_code="200",url="/test"} 1', - ]) + ]), ); expect(lines).toEqual( expect.not.arrayContaining([ 'http_request_summary_seconds_count{method="GET",route="*",status_code="200",url="/test"} 1', - ]) + ]), ); }); }); diff --git a/src/fastify-metrics.ts b/src/fastify-metrics.ts index 13834c7..d390aa2 100644 --- a/src/fastify-metrics.ts +++ b/src/fastify-metrics.ts @@ -1,17 +1,19 @@ -import { +import type { FastifyInstance, FastifyReply, FastifyRequest, RouteOptions, } from 'fastify'; +// eslint-disable-next-line @typescript-eslint/consistent-type-imports import promClient, { - Histogram, - LabelValues, - PrometheusContentType, - Registry, - Summary, + type Histogram, + type LabelValues, + type PrometheusContentType, + type Registry, + type Summary, } from 'prom-client'; -import { IFastifyMetrics, IMetricsPluginOptions } from './types'; +import type { IFastifyMetrics, IMetricsPluginOptions } from './types'; + /** * Plugin constructor * @@ -67,7 +69,7 @@ export class FastifyMetrics implements IFastifyMetrics { private readonly routesWhitelist = new Set(); private readonly methodBlacklist = new Set(); - private routeMetrics: IRouteMetrics; + private routeMetrics?: IRouteMetrics; private readonly options: IMetricsPluginOptions; private readonly routeFallback: string; private readonly getRouteLabel: (request: FastifyRequest) => string; @@ -147,7 +149,7 @@ export class FastifyMetrics implements IFastifyMetrics { (pattern) => typeof pattern === 'string' ? pattern === routeOptions.url - : pattern.test(routeOptions.url) + : pattern.test(routeOptions.url), ); if (isRouteBlacklisted) { return; @@ -159,7 +161,7 @@ export class FastifyMetrics implements IFastifyMetrics { FastifyMetrics.getRouteSlug({ method, url: routeOptions.url, - }) + }), ); } }); @@ -206,13 +208,15 @@ export class FastifyMetrics implements IFastifyMetrics { const routeRegistries = this.getCustomRouteMetricsRegistries(); const regisitriesToMerge = Array.from( - new Set([globalRegistry, ...defaultRegistries, ...routeRegistries]) + new Set([globalRegistry, ...defaultRegistries, ...routeRegistries]), ); const routeHandler = async (_: FastifyRequest, reply: FastifyReply) => { if (regisitriesToMerge.length === 1) { - const data = await regisitriesToMerge[0].metrics(); - return reply.type(regisitriesToMerge[0].contentType).send(data); + const data = await regisitriesToMerge?.[0]?.metrics(); + return reply + .type(regisitriesToMerge?.[0]?.contentType ?? 'text/plain') + .send(data); } // WARN: Looses default labels const merged = this.deps.client.Registry.merge(regisitriesToMerge); @@ -260,7 +264,7 @@ export class FastifyMetrics implements IFastifyMetrics { }; const customLabelNames: string[] = Object.keys( - this.options.routeMetrics.customLabels ?? {} + this.options.routeMetrics.customLabels ?? {}, ); const routeHist = new this.deps.client.Histogram({ @@ -302,19 +306,30 @@ export class FastifyMetrics implements IFastifyMetrics { * option */ private createTimers(request: FastifyRequest): void { - if (this.options.routeMetrics.enabled instanceof Object) { + if ( + this.routeMetrics && + this.options.routeMetrics.enabled instanceof Object + ) { this.metricStorage.set(request, { - hist: !(this.options.routeMetrics.enabled.histogram === false) - ? this.routeMetrics.routeHist.startTimer() - : undefined, - sum: !(this.options.routeMetrics.enabled.summary === false) - ? this.routeMetrics.routeSum.startTimer() - : undefined, + ...(this.options.routeMetrics.enabled.histogram === false + ? {} + : { hist: this.routeMetrics.routeHist.startTimer() }), + // hist: !(this.options.routeMetrics.enabled.histogram === false) + // ? this.routeMetrics.routeHist.startTimer() + // : undefined, + ...(this.options.routeMetrics.enabled.summary === false + ? {} + : { + sum: this.routeMetrics.routeSum.startTimer(), + }), + // sum: !(this.options.routeMetrics.enabled.summary === false) + // ? this.routeMetrics.routeSum.startTimer() + // : undefined, }); return; } - if (!(this.options.routeMetrics.enabled === false)) { + if (this.routeMetrics && !(this.options.routeMetrics.enabled === false)) { this.metricStorage.set(request, { hist: this.routeMetrics.routeHist.startTimer(), sum: this.routeMetrics.routeSum.startTimer(), @@ -325,68 +340,73 @@ export class FastifyMetrics implements IFastifyMetrics { /** Collect per-route metrics */ private collectRouteMetrics(): void { - this.deps.fastify - .addHook('onRequest', (request, _, done) => { - if ( - request.routeOptions.config.disableMetrics === true || - !request.raw.url - ) { - return done(); - } - - if (this.options.routeMetrics.registeredRoutesOnly === false) { - if (!this.methodBlacklist.has(request.routeOptions.method)) { - this.createTimers(request); + if (this.routeMetrics !== undefined) { + this.deps.fastify + .addHook('onRequest', (request, _, done) => { + if ( + request.routeOptions.config.disableMetrics === true || + !request.raw.url + ) { + return done(); } - return done(); - } + if (this.options.routeMetrics.registeredRoutesOnly === false) { + if (!this.methodBlacklist.has(request.routeOptions.method)) { + this.createTimers(request); + } - if ( - this.routesWhitelist.has( - FastifyMetrics.getRouteSlug({ - method: request.routeOptions.method, - // use actual url when config url is empty - url: request.routeOptions.url ?? request.url, - }) - ) - ) { - this.createTimers(request); - } - - return done(); - }) - .addHook('onResponse', (request, reply, done) => { - const metrics = this.metricStorage.get(request); - if (!metrics) { - return done(); - } - - const statusCode = - this.options.routeMetrics.groupStatusCodes === true - ? `${Math.floor(reply.statusCode / 100)}xx` - : reply.statusCode; - const route = this.getRouteLabel(request); - const method = request.method; + return done(); + } - const labels = { - [this.routeMetrics.labelNames.method]: method, - [this.routeMetrics.labelNames.route]: route, - [this.routeMetrics.labelNames.status]: statusCode, - ...this.collectCustomLabels(request, reply), - }; + if ( + this.routesWhitelist.has( + FastifyMetrics.getRouteSlug({ + method: request.routeOptions.method, + // use actual url when config url is empty + url: request.routeOptions.url ?? request.url, + }), + ) + ) { + this.createTimers(request); + } - if (metrics.hist) metrics.hist(labels); - if (metrics.sum) metrics.sum(labels); + return done(); + }) + .addHook('onResponse', (request, reply, done) => { + const metrics = this.metricStorage.get(request); + if (!metrics) { + return done(); + } - done(); - }); + const statusCode = + this.options.routeMetrics.groupStatusCodes === true + ? `${Math.floor(reply.statusCode / 100)}xx` + : reply.statusCode; + const route = this.getRouteLabel(request); + const method = request.method; + + const labels = { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + [this.routeMetrics!.labelNames.method]: method, + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + [this.routeMetrics!.labelNames.route]: route, + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + [this.routeMetrics!.labelNames.status]: statusCode, + ...this.collectCustomLabels(request, reply), + }; + + if (metrics.hist) metrics.hist(labels); + if (metrics.sum) metrics.sum(labels); + + done(); + }); + } } /** Get custom labels for route metrics */ private collectCustomLabels( request: FastifyRequest, - reply: FastifyReply + reply: FastifyReply, ): Record { const customLabels = this.options.routeMetrics.customLabels ?? {}; const labels: Record = {}; diff --git a/src/index.ts b/src/index.ts index fb670e9..e796aad 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,10 +6,10 @@ * @packageDocumentation */ -import fastifyPlugin from 'fastify-plugin'; +import { fastifyPlugin } from 'fastify-plugin'; import client from 'prom-client'; import { FastifyMetrics } from './fastify-metrics'; -import { +import type { IFastifyMetrics, IMetricsPluginOptions, IMetricsRouteContextConfig, @@ -69,5 +69,5 @@ export default fastifyPlugin>( { fastify: '>=4.0.0', name: 'fastify-metrics', - } + }, ); diff --git a/src/types.ts b/src/types.ts index 0931bd9..d1c81ad 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,14 +1,15 @@ -import { +import type { FastifyReply, FastifyRequest, HTTPMethods, RouteOptions, } from 'fastify'; -import client, { +import type { DefaultMetricsCollectorConfiguration, HistogramConfiguration, SummaryConfiguration, } from 'prom-client'; +import type client from 'prom-client'; /** * Route config for metrics diff --git a/tsconfig.json b/tsconfig.json index 5135103..ee1f786 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,30 +1,19 @@ { "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { + "allowSyntheticDefaultImports": true, "declaration": true, "declarationMap": true, "esModuleInterop": true, - "module": "NodeNext", - "moduleResolution": "NodeNext", - "newLine": "LF", - "noErrorTruncation": true, - "noImplicitAny": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "outDir": "dist", - "resolveJsonModule": true, - "sourceMap": true, - "strictNullChecks": true, - "target": "ES2020", - "noEmit": true + "module": "CommonJS", + "moduleResolution": "node", + "noEmit": true, + "target": "ES2019" }, - "exclude": [ - "dist/**/*", - "coverage/**/*", - "node_modules/**/*", - "jest.config.js", - "example/**/*", - ".*" + "exclude": ["dist/**/*", "coverage/**/*", "node_modules/**/*"], + "extends": [ + "@tsconfig/node-lts/tsconfig.json", + "@tsconfig/strictest/tsconfig.json" ], - "include": ["src/**/*"] + "include": ["src/**/*", "package.json", "test/**/*"] } diff --git a/tsdoc.json b/tsdoc.json new file mode 100644 index 0000000..3d4a09e --- /dev/null +++ b/tsdoc.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", + "tagDefinitions": [ + { + "syntaxKind": "block", + "tagName": "@description" + }, + { + "syntaxKind": "modifier", + "tagName": "@implements" + }, + { + "syntaxKind": "modifier", + "tagName": "@private" + }, + { + "syntaxKind": "modifier", + "tagName": "@static" + } + ] +}