Skip to content

Commit

Permalink
fix: sync with template
Browse files Browse the repository at this point in the history
  • Loading branch information
KillWolfVlad committed Jan 26, 2023
1 parent 33f4f7d commit 94ee2e6
Show file tree
Hide file tree
Showing 22 changed files with 10,291 additions and 7,682 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ TODO text
# Templates
*.dot text
*.ejs text
*.erb text
*.haml text
*.handlebars text
*.hbs text
Expand All @@ -91,6 +92,7 @@ TODO text
*.mustache text
*.njk text
*.phtml text
*.svelte text
*.tmpl text
*.tpl text
*.twig text
Expand All @@ -109,6 +111,7 @@ TODO text
package.json text eol=lf
package-lock.json text -diff
pnpm-lock.yaml text eol=lf -diff
.prettierrc text
yarn.lock text -diff
*.toml text
*.yaml text
Expand Down
24 changes: 0 additions & 24 deletions .github/dependabot.yaml

This file was deleted.

43 changes: 30 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
### https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
### https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore

.idea/*

### https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore
### https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore

.vscode/*
**/.vscode/*
*.code-workspace

# Local History for Visual Studio Code
.history/

### https://github.com/github/gitignore/blob/master/Node.gitignore
# Built Visual Studio Code Extensions
*.vsix

### https://github.com/github/gitignore/blob/main/Node.gitignore

# Logs
logs
Expand All @@ -19,6 +22,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand Down Expand Up @@ -67,6 +71,9 @@ web_modules/
# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
Expand All @@ -82,9 +89,12 @@ web_modules/
# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
# dotenv environment variable files
.env
.env.test
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand All @@ -107,6 +117,13 @@ dist
# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

Expand All @@ -123,13 +140,13 @@ dist
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
.pnp.*

### https://github.com/github/gitignore/blob/master/Global/Linux.gitignore
### https://github.com/github/gitignore/blob/main/Global/Linux.gitignore

*~

Expand All @@ -145,7 +162,7 @@ dist
# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
### https://github.com/github/gitignore/blob/main/Global/Windows.gitignore

# Windows thumbnail cache files
Thumbs.db
Expand All @@ -172,7 +189,7 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

### https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
### https://github.com/github/gitignore/blob/main/Global/macOS.gitignore

# General
.DS_Store
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,10 @@ Kafka for NestJS
## Requirements

- Node.js v14 LTS or later
- npm or yarn
- Yarn

## Install

```bash
npm install @byndyusoft/nest-kafka @byndyusoft/class-validator-extended @byndyusoft/nest-opentracing @kafkajs/confluent-schema-registry @nestjs/common @nestjs/microservices class-transformer class-validator kafkajs nestjs-pino rxjs
```

or

```bash
yarn add @byndyusoft/nest-kafka @byndyusoft/class-validator-extended @byndyusoft/nest-opentracing @kafkajs/confluent-schema-registry @nestjs/common @nestjs/microservices class-transformer class-validator kafkajs nestjs-pino rxjs
```
Expand Down
29 changes: 10 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@
"files": [
"dist",
"src",
"index.ts",
"tsconfig.json",
"!dist/*.tsbuildinfo",
"!**/__tests__",
"!**/*spec.ts"
"!dist/*.tsbuildinfo"
],
"scripts": {
"_test:cov": "jest --coverage",
"prebuild": "shx rm -rf ./dist",
"build": "tsc --project ./tsconfig.build.json",
"postinstall": "husky install && ts-patch install",
"build": "yarn run prebuild && yarn run build:src",
"build:src": "tsc --project ./tsconfig.build.json",
"postinstall": "husky install",
"lint": "yarn run lint:eslint && yarn run lint:markdown && yarn run lint:prettier",
"lint:eslint": "eslint --ignore-path ./.gitignore --max-warnings 0 --ext .ts,.js .",
"lint:eslint:fix": "eslint --ignore-path ./.gitignore --fix --ext .ts,.js .",
Expand All @@ -43,33 +40,26 @@
"jest": {
"collectCoverageFrom": [
"./src/**/*.ts",
"!**/__tests__/**/*.ts",
"!**/index.ts"
],
"coverageDirectory": "<rootDir>/coverage",
"coverageThreshold": {
"global": {
"branches": 100,
"functions": 100,
"lines": 100,
"statements": 100
}
},
"coverageReporters": [
"lcov",
"text"
],
"moduleFileExtensions": [
"ts",
"js"
],
"resetMocks": true,
"rootDir": "./",
"roots": [
"<rootDir>/src",
"<rootDir>/test"
],
"setupFilesAfterEnv": [
"jest-extended/all"
],
"testEnvironment": "node",
"testRegex": ".*\\.spec\\.ts$",
"testRegex": ".*\\.test\\.ts$",
"transform": {
"^.+\\.ts$": "ts-jest"
}
Expand Down Expand Up @@ -131,6 +121,7 @@
"nestjs-pino": "^3.1.1",
"rxjs": "^7.5.7"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=14"
},
Expand Down
3 changes: 3 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["local>Byndyusoft/node-renovate-config"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

import { EventPattern } from "@nestjs/microservices";

import { DefaultConnectionName, KafkaConsumerTransportId } from "~/src/consts";

import { DefaultConnectionName, KafkaConsumerTransportId } from "../../consts";
import {
IKafkaConsumerOptions,
IKafkaConsumerSerializedOptions,
Expand Down
7 changes: 3 additions & 4 deletions src/consumer/interfaces/kafkaConsumerContextInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
* limitations under the License.
*/

import { IKafkaOptions } from "~/src/options";
import { KafkaCoreProducer } from "~/src/producer";
import { KafkaCoreSchemaRegistry } from "~/src/schemaRegistry";

import { IKafkaOptions } from "../../options";
import { KafkaCoreProducer } from "../../producer";
import { KafkaCoreSchemaRegistry } from "../../schemaRegistry";
import { KafkaConsumerMessageHandlerLogger } from "../kafkaConsumerMessageHandlerLogger";

export interface IKafkaConsumerContext {
Expand Down
4 changes: 2 additions & 2 deletions src/consumer/kafkaConsumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import {
ConsumersMapToken,
KafkaConsumerTransportId,
KafkaOptionsToken,
} from "~/src/consts";
import { IKafkaOptions } from "~/src/options";
} from "../consts";
import { IKafkaOptions } from "../options";

import { IKafkaConsumerSerializedOptions } from "./interfaces";
import { KafkaConsumerMessageHandler } from "./kafkaConsumerMessageHandler";
Expand Down
8 changes: 4 additions & 4 deletions src/consumer/kafkaConsumerMessageHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import { storage as loggerStorage, Store } from "nestjs-pino/storage";
import retry from "retry";
import { isObservable, lastValueFrom } from "rxjs";

import { KafkaOptionsToken } from "~/src/consts";
import { IKafkaOptions } from "~/src/options";
import { KafkaCoreProducer } from "~/src/producer";
import { KafkaCoreSchemaRegistry } from "~/src/schemaRegistry";
import { KafkaOptionsToken } from "../consts";
import { IKafkaOptions } from "../options";
import { KafkaCoreProducer } from "../producer";
import { KafkaCoreSchemaRegistry } from "../schemaRegistry";

import { getErrorCause, KafkaConsumerError } from "./errors";
import { IKafkaConsumerContext, IKafkaConsumerPayload } from "./interfaces";
Expand Down
2 changes: 1 addition & 1 deletion src/producer/decorators/injectKafkaProducerDecorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { Inject } from "@nestjs/common";

import { DefaultConnectionName } from "~/src/consts";
import { DefaultConnectionName } from "../../consts";

import { kafkaProducerDecoratedProviders } from "./kafkaProducerDecoratedProviders";

Expand Down
3 changes: 1 addition & 2 deletions src/producer/decorators/kafkaProducerDecoratedProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* limitations under the License.
*/

import { DecoratedProviders } from "~/src/decoratedProviders";

import { DecoratedProviders } from "../../decoratedProviders";
import { KafkaProducer } from "../kafkaProducer";

export const kafkaProducerDecoratedProviders = new DecoratedProviders(
Expand Down
2 changes: 1 addition & 1 deletion src/producer/kafkaCoreProducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from "@nestjs/common";
import { Producer } from "kafkajs";

import { ProducersMapToken } from "~/src/consts";
import { ProducersMapToken } from "../consts";

@Injectable()
export class KafkaCoreProducer implements OnModuleInit, OnModuleDestroy {
Expand Down
2 changes: 1 addition & 1 deletion src/producer/kafkaProducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { Injectable, Scope } from "@nestjs/common";
import { Producer } from "kafkajs";

import { IDecoratedProvider } from "~/src/decoratedProviders";
import { IDecoratedProvider } from "../decoratedProviders";

import { KafkaCoreProducer } from "./kafkaCoreProducer";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { Inject } from "@nestjs/common";

import { DefaultConnectionName } from "~/src/consts";
import { DefaultConnectionName } from "../../consts";

import { kafkaSchemaRegistryDecoratedProviders } from "./kafkaSchemaRegistryDecoratedProviders";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* limitations under the License.
*/

import { DecoratedProviders } from "~/src/decoratedProviders";

import { DecoratedProviders } from "../../decoratedProviders";
import { KafkaSchemaRegistry } from "../kafkaSchemaRegistry";

export const kafkaSchemaRegistryDecoratedProviders = new DecoratedProviders(
Expand Down
2 changes: 1 addition & 1 deletion src/schemaRegistry/kafkaCoreSchemaRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { SchemaRegistry } from "@kafkajs/confluent-schema-registry";
import { Inject, Injectable } from "@nestjs/common";

import { SchemaRegistriesMapToken } from "~/src/consts";
import { SchemaRegistriesMapToken } from "../consts";

@Injectable()
export class KafkaCoreSchemaRegistry {
Expand Down
2 changes: 1 addition & 1 deletion src/schemaRegistry/kafkaSchemaRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { SchemaRegistry } from "@kafkajs/confluent-schema-registry";
import { Injectable, Scope } from "@nestjs/common";

import { IDecoratedProvider } from "~/src/decoratedProviders";
import { IDecoratedProvider } from "../decoratedProviders";

import { KafkaCoreSchemaRegistry } from "./kafkaCoreSchemaRegistry";

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["./dist", "./node_modules", "./test", "**/__tests__", "**/*spec.ts"]
"include": ["src"]
}
Loading

0 comments on commit 94ee2e6

Please sign in to comment.