Skip to content

Commit

Permalink
refactor: cleanup types
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Oct 18, 2023
1 parent 0fbfab9 commit 3b786c0
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 35 deletions.
2 changes: 1 addition & 1 deletion factories/redis_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import RedisManager from '../src/redis_manager.js'
import { LoggerFactory } from '@adonisjs/core/factories/logger'
import type { RedisClusterConnectionConfig, RedisConnectionConfig } from '../src/types/main.js'
import type { RedisClusterConnectionConfig, RedisConnectionConfig } from '../src/types.js'

/**
* Redis manager factory is used to create an instance of the redis
Expand Down
10 changes: 5 additions & 5 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
* file that was distributed with this source code.
*/

import './src/types/extended.js'

export { defineConfig } from './src/define_config.js'
export { stubsRoot } from './stubs/index.js'
export { configure } from './configure.js'
export * as errors from './src/errors.js'
export { configure } from './configure.js'
export { stubsRoot } from './stubs/index.js'
export { defineConfig } from './src/define_config.js'
export { default as RedisManager } from './src/redis_manager.js'
export { RedisConnection } from './src/connections/redis_connection.js'
export { RedisClusterConnection } from './src/connections/redis_cluster_connection.js'
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"./services/main": "./build/services/main.js",
"./redis_provider": "./build/providers/redis_provider.js",
"./factories": "./build/factories/main.js",
"./types": "./build/src/types/main.js"
"./types": "./build/src/types.js"
},
"scripts": {
"pretest": "npm run lint",
Expand Down Expand Up @@ -117,7 +117,7 @@
"./services/main.ts",
"./providers/redis_provider.ts",
"./factories/main.ts",
"./src/types/main.ts"
"./src/types.ts"
],
"outDir": "./build",
"clean": true,
Expand Down
2 changes: 1 addition & 1 deletion providers/redis_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import type { ApplicationService } from '@adonisjs/core/types'
import type { RedisService } from '../src/types/main.js'
import type { RedisService } from '../src/types.js'

declare module '@adonisjs/core/types' {
export interface ContainerBindings {
Expand Down
2 changes: 1 addition & 1 deletion services/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import app from '@adonisjs/core/services/app'
import { RedisService } from '../src/types/main.js'
import { RedisService } from '../src/types.js'

let redis: RedisService

Expand Down
2 changes: 1 addition & 1 deletion src/connections/abstract_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
ConnectionEvents,
PubSubChannelHandler,
PubSubPatternHandler,
} from '../types/main.js'
} from '../types.js'

/**
* Abstract factory implements the shared functionality required by Redis cluster
Expand Down
2 changes: 1 addition & 1 deletion src/connections/redis_cluster_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
ConnectionEvents,
IORedisBaseCommands,
RedisClusterConnectionConfig,
} from '../types/main.js'
} from '../types.js'

/**
* Redis cluster connection exposes the API to run Redis commands using `ioredis` as the
Expand Down
2 changes: 1 addition & 1 deletion src/connections/redis_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
ConnectionEvents,
RedisConnectionConfig,
IORedisConnectionCommands,
} from '../types/main.js'
} from '../types.js'

/**
* Redis connection exposes the API to run Redis commands using `ioredis` as the
Expand Down
2 changes: 1 addition & 1 deletion src/define_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { RuntimeException } from '@poppinss/utils'
import type { RedisConnectionsList } from './types/main.js'
import type { RedisConnectionsList } from './types.js'

/**
* Define config for redis
Expand Down
2 changes: 1 addition & 1 deletion src/redis_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type {
PubSubChannelHandler,
PubSubPatternHandler,
RedisConnectionsList,
} from './types/main.js'
} from './types.js'

/**
* Redis Manager exposes the API to manage multiple redis connections
Expand Down
8 changes: 4 additions & 4 deletions src/types/main.ts → src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

import type { Redis, Cluster, RedisOptions, ClusterOptions } from 'ioredis'

import type RedisManager from '../redis_manager.js'
import type { baseMethods, redisMethods } from '../connections/io_methods.js'
import type RedisConnection from '../connections/redis_connection.js'
import type RedisClusterConnection from '../connections/redis_cluster_connection.js'
import type RedisManager from './redis_manager.js'
import type RedisConnection from './connections/redis_connection.js'
import type { baseMethods, redisMethods } from './connections/io_methods.js'
import type RedisClusterConnection from './connections/redis_cluster_connection.js'

/**
* PubSub subscriber
Expand Down
16 changes: 0 additions & 16 deletions src/types/extended.ts

This file was deleted.

0 comments on commit 3b786c0

Please sign in to comment.