Skip to content

Commit 8594bce

Browse files
committed
refactor: remove @secjs/config dependency and use config from utils
1 parent 5985530 commit 8594bce

7 files changed

Lines changed: 19 additions & 34 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ driver (SQL and NoSQL).
3030
> it keeps as dev dependency because one day `@secjs/core` will install everything once.
3131
3232
```bash
33-
npm install @secjs/env @secjs/utils @secjs/config @secjs/exceptions
33+
npm install @secjs/env @secjs/utils @secjs/exceptions
3434
```
3535

3636
> Then you can install the package using:

package-lock.json

Lines changed: 9 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@secjs/database",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Handle your application database with factories, seeders and query builder in Node.js",
55
"license": "MIT",
66
"author": "João Lenon <lenon@secjs.com.br>",
@@ -24,10 +24,9 @@
2424
"query-builder"
2525
],
2626
"devDependencies": {
27-
"@secjs/config": "1.1.4",
2827
"@secjs/env": "1.2.8",
2928
"@secjs/exceptions": "1.0.4",
30-
"@secjs/utils": "1.7.3",
29+
"@secjs/utils": "1.7.4",
3130
"@types/jest": "27.0.1",
3231
"@types/knex": "0.16.1",
3332
"@types/mime-types": "2.1.1",

src/Database.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import {
1111
InternalServerException,
1212
NotImplementedException,
1313
} from '@secjs/exceptions'
14-
import { Config } from '@secjs/config'
14+
1515
import { Drivers } from './Drivers/Drivers'
1616
import { JoinType } from './Contracts/JoinType'
17-
import { PaginatedResponse } from '@secjs/utils'
17+
import { Config, PaginatedResponse } from '@secjs/utils'
1818
import { DriverContract } from './Contracts/DriverContract'
1919
import { DatabaseContract } from './Contracts/DatabaseContract'
2020
import { TransactionContract } from './Contracts/TransactionContract'

src/Utils/ConnectionResolver.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
*/
99

1010
import knex, { Knex } from 'knex'
11-
import { Config } from '@secjs/config'
12-
import { Parser } from '@secjs/utils'
1311
import { createConnection } from 'mongoose'
12+
import { Config, Parser } from '@secjs/utils'
1413
import { InternalServerException } from '@secjs/exceptions'
1514

1615
export class ConnectionResolver {

tests/database-mongodb.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import '@secjs/env/src/utils/global'
1111

12-
import { Config } from '@secjs/config'
12+
import { Config, Path } from '@secjs/utils'
1313
import { Database } from '../src/Database'
1414
import { MongoMemoryReplSet } from 'mongodb-memory-server'
1515
import { TableBuilder } from '../src/Builders/TableBuilder'
@@ -41,7 +41,7 @@ describe('\n Database Mongo Class', () => {
4141
process.env.DB_PASSWORD = ''
4242
process.env.DB_FILENAME = ':memory:'
4343

44-
await new Config().load()
44+
await new Config().load(Path.config('database.ts'))
4545
})
4646

4747
beforeEach(async () => {

tests/database-postgresql.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import '@secjs/env/src/utils/global'
1111

1212
import { Knex } from 'knex'
13-
import { Config } from '@secjs/config'
13+
import { Config, Path } from '@secjs/utils'
1414
import { Database } from '../src/Database'
1515
import { DatabaseContract } from '../src/Contracts/DatabaseContract'
1616

@@ -25,7 +25,7 @@ describe('\n Database PostgreSQL Class', () => {
2525
process.env.DB_PASSWORD = 'root'
2626
process.env.DB_FILENAME = ':memory:'
2727

28-
await new Config().load()
28+
await new Config().load(Path.config('database.ts'))
2929
})
3030

3131
beforeEach(async () => {

0 commit comments

Comments
 (0)