Skip to content

Commit

Permalink
feat: remove custom registration decorators and reduce base dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoGathK committed Sep 24, 2022
1 parent e4945e5 commit d03108c
Show file tree
Hide file tree
Showing 10 changed files with 318 additions and 257 deletions.
537 changes: 297 additions & 240 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@
]
},
"dependencies": {
"@vodyani/class-decorator": "^8.2.2",
"@vodyani/core": "^8.7.1",
"@nestjs/common": "^8.4.7",
"@vodyani/class-decorator": "^8.2.3",
"@vodyani/core": "^8.8.0",
"@vodyani/utils": "^8.5.2",
"chokidar": "3.5.3",
"lodash": "4.17.21",
Expand Down
2 changes: 1 addition & 1 deletion src/common/interface/manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WatchOptions } from 'chokidar';
import { Type, DynamicModule, ForwardReference, Provider } from '@vodyani/core';
import { Type, DynamicModule, ForwardReference, Provider } from '@nestjs/common';

export interface EnvConfigOptions {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DynamicModule } from '@vodyani/core';
import { DynamicModule } from '@nestjs/common';
import { isValidArray, toConvert } from '@vodyani/utils';

import {
Expand Down
2 changes: 1 addition & 1 deletion src/provider/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cloneDeep } from 'lodash';
import { Injectable } from '@vodyani/core';
import { Injectable } from '@nestjs/common';
import { ArgumentValidator, CustomValidated, Required, This } from '@vodyani/class-decorator';
import { toDeepMerge, toDeepMatch, toDeepRestore, isValidObject, isKeyof, isValidDict } from '@vodyani/utils';

Expand Down
9 changes: 5 additions & 4 deletions src/provider/dynamic-data-source.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { toConvert } from '@vodyani/utils';
import { Injectable } from '@nestjs/common';
import { ArgumentValidator, Required, This } from '@vodyani/class-decorator';
import { AsyncClient, AsyncInject, Client, Injectable } from '@vodyani/core';
import { AsyncClient, AsyncInject, Client } from '@vodyani/core';
import { toConvert } from '@vodyani/utils';

import { CreateAsyncClient, CreateClient, IAsyncClientProxy, IClientProxy } from '../common';
import { AsyncClientProxy, ClientProxy } from '../struct';
import { CreateClient, CreateAsyncClient, IClientProxy, IAsyncClientProxy } from '../common';

import { ConfigProvider } from './config';
import { ArkManager } from './manager';
import { ConfigMonitor } from './monitor';
import { ConfigProvider } from './config';

@Injectable()
export class DynamicDataSourceProvider<T = any, O = any> {
Expand Down
4 changes: 2 additions & 2 deletions src/provider/handler.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { readFileSync } from 'fs';

import { Injectable } from '@vodyani/core';
import { isValidObject } from '@vodyani/utils';
import { Injectable } from '@nestjs/common';
import { ArgumentValidator, Required, This } from '@vodyani/class-decorator';
import { isValidObject } from '@vodyani/utils';

import { ConfigProvider } from './config';

Expand Down
4 changes: 2 additions & 2 deletions src/provider/manager.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { existsSync } from 'fs';

import { isValidArray, isValidDict } from '@vodyani/utils';
import { ArgumentValidator, CustomValidated, This } from '@vodyani/class-decorator';
import { AsyncInjectable, AsyncProvider, AsyncProviderFactory, RemoteConfigClient } from '@vodyani/core';
import { isValidArray, isValidDict } from '@vodyani/utils';

import { ArkManagerOptions, RemoteConfigOptions } from '../common';

import { ConfigProvider } from './config';
import { ConfigHandler } from './handler';
import { ConfigMonitor } from './monitor';
import { ConfigProvider } from './config';

@AsyncInjectable
export class ArkManager extends AsyncProvider implements AsyncProviderFactory {
Expand Down
7 changes: 4 additions & 3 deletions src/provider/monitor.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { readFileSync } from 'fs';

import { uniqueId } from 'lodash';
import { Injectable } from '@nestjs/common';
import { This } from '@vodyani/class-decorator';
import { isValid, circular } from '@vodyani/utils';
import { RemoteConfigClient } from '@vodyani/core';
import { circular, isValid } from '@vodyani/utils';
import { FSWatcher, watch, WatchOptions } from 'chokidar';
import { Injectable, RemoteConfigClient } from '@vodyani/core';
import { uniqueId } from 'lodash';

import { toHash, WatchInfo } from '../common';

Expand Down
3 changes: 2 additions & 1 deletion test/config-manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { sleep } from '@vodyani/utils';
import { This } from '@vodyani/class-decorator';
import { describe, it, expect } from '@jest/globals';
import { Test, TestingModule } from '@nestjs/testing';
import { Injectable, Module, RemoteConfigClient } from '@vodyani/core';
import { RemoteConfigClient } from '@vodyani/core';
import { Injectable, Module } from '@nestjs/common';

import { ArkModule } from '../src/module';
import { ConfigProvider } from '../src/provider/config';
Expand Down

0 comments on commit d03108c

Please sign in to comment.