From c826589b35622597daebca456e70b489e3acd756 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sun, 8 Dec 2024 10:44:43 +0000 Subject: [PATCH] build(deps-dev): replace standard with neostandard --- README.md | 2 +- package.json | 6 ++-- types/index.d.ts | 82 +++++++++++++++++++++---------------------- types/index.test-d.ts | 46 ++++++++++++------------ 4 files changed, 68 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index 2ec2099..57d98ca 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![CI](https://github.com/fastify/fastify-kafka/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/fastify/fastify-kafka/actions/workflows/ci.yml) [![NPM version](https://img.shields.io/npm/v/@fastify/kafka.svg?style=flat)](https://www.npmjs.com/package/@fastify/kafka) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/) +[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard) Fastify plugin to interact with [Apache Kafka](http://kafka.apache.org/). Supports Kafka producer and consumer. To achieve the best performance, the plugin uses [`node-rdkafka`](https://github.com/Blizzard/node-rdkafka). diff --git a/package.json b/package.json index f2e2f6d..7c5363f 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "scripts": { "infra:start": "docker-compose up -d", "infra:stop": "docker-compose stop", - "lint": "standard", - "lint:fix": "standard --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "test": "npm run test:unit && npm run test:typescript", "test:unit": "tap", "test:typescript": "tsd" @@ -39,7 +39,7 @@ "@types/node": "^22.0.0", "abstract-logging": "2.0.1", "fastify": "^5.0.0", - "standard": "^17.1.0", + "neostandard": "^0.11.9", "tap": "^20.0.3", "tsd": "^0.31.1" }, diff --git a/types/index.d.ts b/types/index.d.ts index 734d75d..9e90d18 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,54 +1,54 @@ -import { FastifyPluginCallback } from 'fastify'; +import { FastifyPluginCallback } from 'fastify' import { - ConsumerGlobalConfig, - ConsumerTopicConfig, - KafkaConsumer, - Message, - MetadataOptions, - Producer, - ProducerGlobalConfig, - ProducerTopicConfig -} from 'node-rdkafka'; + ConsumerGlobalConfig, + ConsumerTopicConfig, + KafkaConsumer, + Message, + MetadataOptions, + Producer, + ProducerGlobalConfig, + ProducerTopicConfig +} from 'node-rdkafka' declare module 'fastify' { - interface FastifyKafkaMessage extends Pick { - payload: unknown; - } - - interface FastifyKafkaProducer { - producer: Producer; - push(message: FastifyKafkaMessage): void; - stop(done: () => void): void; - } - - interface FastifyKafkaConsumer extends Pick { - consumer: KafkaConsumer; - stop(done: () => void): void; - } - - interface Kafka extends Pick, Pick { - producer?: FastifyKafkaProducer; - consumer?: FastifyKafkaConsumer; - } - interface FastifyInstance { - kafka: Kafka; - } + interface FastifyKafkaMessage extends Pick { + payload: unknown; + } + + interface FastifyKafkaProducer { + producer: Producer; + push(message: FastifyKafkaMessage): void; + stop(done: () => void): void; + } + + interface FastifyKafkaConsumer extends Pick { + consumer: KafkaConsumer; + stop(done: () => void): void; + } + + interface Kafka extends Pick, Pick { + producer?: FastifyKafkaProducer; + consumer?: FastifyKafkaConsumer; + } + interface FastifyInstance { + kafka: Kafka; + } } -type FastifyKafka = FastifyPluginCallback; +type FastifyKafka = FastifyPluginCallback declare namespace fastifyKafka { - export interface FastifyKafkaOptions { - producer?: ProducerGlobalConfig; - consumer?: ConsumerGlobalConfig; - producerTopicConf?: ProducerTopicConfig; - consumerTopicConf?: ConsumerTopicConfig; - metadataOptions?: MetadataOptions; - } + export interface FastifyKafkaOptions { + producer?: ProducerGlobalConfig; + consumer?: ConsumerGlobalConfig; + producerTopicConf?: ProducerTopicConfig; + consumerTopicConf?: ConsumerTopicConfig; + metadataOptions?: MetadataOptions; + } export const fastifyKafka: FastifyKafka export { fastifyKafka as default } } -declare function fastifyKafka(...params: Parameters): ReturnType +declare function fastifyKafka (...params: Parameters): ReturnType export = fastifyKafka diff --git a/types/index.test-d.ts b/types/index.test-d.ts index 6f79e26..683d729 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -1,30 +1,30 @@ -import Fastify, { FastifyKafkaConsumer, FastifyKafkaProducer, Kafka } from 'fastify'; -import { expectAssignable } from 'tsd'; -import fastifyKafka from '..'; +import Fastify, { FastifyKafkaConsumer, FastifyKafkaProducer, Kafka } from 'fastify' +import { expectAssignable } from 'tsd' +import fastifyKafka from '..' const app = Fastify() app.register(fastifyKafka, { - producer: { - 'metadata.broker.list': '127.0.0.1:9092', - dr_cb: true - }, - consumer: { - 'metadata.broker.list': '127.0.0.1:9092', - 'group.id': "new-group-1", - 'fetch.wait.max.ms': 10, - 'fetch.error.backoff.ms': 50, - }, - consumerTopicConf: { - 'auto.offset.reset': 'earliest' - }, - producerTopicConf: { - "request.timeout.ms": 10 - }, - metadataOptions: { - timeout: 1000 - } -}); + producer: { + 'metadata.broker.list': '127.0.0.1:9092', + dr_cb: true + }, + consumer: { + 'metadata.broker.list': '127.0.0.1:9092', + 'group.id': 'new-group-1', + 'fetch.wait.max.ms': 10, + 'fetch.error.backoff.ms': 50, + }, + consumerTopicConf: { + 'auto.offset.reset': 'earliest' + }, + producerTopicConf: { + 'request.timeout.ms': 10 + }, + metadataOptions: { + timeout: 1000 + } +}) // Check whether all properties are merged successfully or not expectAssignable(app.kafka)