Skip to content

Commit d2fd607

Browse files
authored
Merge pull request #71 from AthennaIO/develop
Update deps
2 parents 81a869c + 6eb84b0 commit d2fd607

40 files changed

+233
-240
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ build
120120
*.js
121121
*.d.ts
122122
*.js.map
123-
!tests/stubs/**/*.js
124-
!tests/stubs/**/*.d.ts
125-
!tests/stubs/**/*.js.map
123+
!tests/fixtures/**/*.js
124+
!tests/fixtures/**/*.d.ts
125+
!tests/fixtures/**/*.js.map
126126

127127
# IDE
128128
.idea
@@ -133,6 +133,7 @@ build
133133
.env
134134
.env.testing
135135
.env.production
136+
!tests/fixtures/**/.env**
136137

137138
# MacOS folder mapper file
138139
.DS_Store

package-lock.json

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

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@athenna/config",
3-
"version": "4.3.0",
3+
"version": "4.4.0",
44
"description": "Cache and handle environment variables and config files of Athenna.",
55
"license": "MIT",
66
"author": "João Lenon <lenon@athenna.io>",
@@ -50,12 +50,12 @@
5050
},
5151
"dependencies": {
5252
"dotenv": "^16.3.1",
53-
"magicast": "^0.2.9",
53+
"magicast": "^0.2.10",
5454
"syntax-error": "^1.4.0"
5555
},
5656
"devDependencies": {
57-
"@athenna/common": "^4.5.0",
58-
"@athenna/test": "^4.4.0",
57+
"@athenna/common": "^4.10.1",
58+
"@athenna/test": "^4.5.0",
5959
"@types/lodash": "^4.14.191",
6060
"@types/syntax-error": "^1.4.2",
6161
"@typescript-eslint/eslint-plugin": "^5.56.0",
@@ -116,7 +116,7 @@
116116
},
117117
"prettier": {
118118
"singleQuote": true,
119-
"trailingComma": "all",
119+
"trailingComma": "none",
120120
"arrowParens": "avoid",
121121
"endOfLine": "lf",
122122
"semi": false,

src/annotations/Value.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function Value(key: string, defaultValue?: any): PropertyDecorator {
1919
return (target: any, propKey: string | symbol) => {
2020
if (Is.Defined(defaultValue) || defaultValue === null) {
2121
Object.defineProperty(target, propKey, {
22-
value: Config.get(key, defaultValue),
22+
value: Config.get(key, defaultValue)
2323
})
2424

2525
return

src/config/Config.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
ObjectBuilder,
1515
Exec,
1616
Module,
17-
Is,
17+
Is
1818
} from '@athenna/common'
1919
import { debug } from '#src/debug'
2020
import { loadFile, writeFile } from 'magicast'
@@ -30,7 +30,7 @@ export class Config {
3030
public static configs: ObjectBuilder = Json.builder({
3131
ignoreNull: false,
3232
ignoreUndefined: true,
33-
referencedValues: false,
33+
referencedValues: false
3434
})
3535

3636
/**
@@ -39,7 +39,7 @@ export class Config {
3939
public static paths: ObjectBuilder = Json.builder({
4040
ignoreNull: false,
4141
ignoreUndefined: true,
42-
referencedValues: false,
42+
referencedValues: false
4343
})
4444

4545
public static fatherConfigPath: string = null
@@ -51,7 +51,7 @@ export class Config {
5151
this.configs = Json.builder({
5252
ignoreNull: false,
5353
ignoreUndefined: true,
54-
referencedValues: false,
54+
referencedValues: false
5555
})
5656

5757
return this
@@ -188,8 +188,8 @@ export class Config {
188188
quote: 'single',
189189
tabWidth: 2,
190190
trailingComma: {
191-
objects: true,
192-
} as any,
191+
objects: true
192+
} as any
193193
})
194194
}
195195

@@ -198,7 +198,7 @@ export class Config {
198198
*/
199199
public static async loadAll(
200200
path = Path.config(),
201-
safe = false,
201+
safe = false
202202
): Promise<void> {
203203
if (extname(path)) {
204204
safe ? await this.safeLoad(path) : await this.load(path)
@@ -211,7 +211,7 @@ export class Config {
211211
this.fatherConfigPath = path
212212

213213
await Exec.concurrently(files, file =>
214-
safe ? this.safeLoad(file.path) : this.load(file.path),
214+
safe ? this.safeLoad(file.path) : this.load(file.path)
215215
)
216216
}
217217

@@ -221,7 +221,7 @@ export class Config {
221221
*/
222222
public static async safeLoad(
223223
path: string,
224-
callNumber?: number,
224+
callNumber?: number
225225
): Promise<void> {
226226
if (!(await File.exists(path))) {
227227
return
@@ -243,7 +243,7 @@ export class Config {
243243
if (!(await File.exists(path))) {
244244
debug(
245245
'Configuration file path %s does not exist, and will be skipped.',
246-
path,
246+
path
247247
)
248248

249249
return
@@ -258,7 +258,7 @@ export class Config {
258258
if (base.includes('.js.map') || base.includes('.d.ts')) {
259259
debug(
260260
'Configuration file %s being skipped since its extension is not valid.',
261-
base,
261+
base
262262
)
263263

264264
return
@@ -267,7 +267,7 @@ export class Config {
267267
if (base.includes('.ts') && Env('IS_TS') === false) {
268268
debug(
269269
'Configuration file %s being skipped since its a TypeScript file and the application is not running in a TypeScript environment.',
270-
base,
270+
base
271271
)
272272

273273
return
@@ -317,7 +317,7 @@ export class Config {
317317
debug(
318318
'Loading configuration file %s with configuration key as %s.',
319319
file.href,
320-
configKey,
320+
configKey
321321
)
322322

323323
this.configs.set(configKey, await file.import())

src/env/Env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { EnvHelper } from '#src/helpers/EnvHelper'
1717
export function Env<T = any>(
1818
env: string,
1919
defaultValue?: any,
20-
autoCast = true,
20+
autoCast = true
2121
): T {
2222
const environment = EnvHelper.setEnvInEnv(process.env[env], autoCast)
2323

src/exceptions/NotFoundConfigException.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class NotFoundConfigException extends Exception {
1515
status: 500,
1616
code: 'E_NOT_FOUND_CONFIG',
1717
message: `The configuration ${key} does not exist or the value is a hardcoded undefined.`,
18-
help: `To solve this problem you can set a default value when trying to get your configuration or setting a value to your ${key} configuration.`,
18+
help: `To solve this problem you can set a default value when trying to get your configuration or setting a value to your ${key} configuration.`
1919
})
2020
}
2121
}

src/exceptions/NotSupportedKeyException.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class NotSupportedKeyException extends Exception {
1717
status: 500,
1818
code: 'E_NOT_SUPPORTED_KEY',
1919
message: `Rewriting a single key such as ({bold,yellow} "${key}") in your configuration file is not supported.`,
20-
help: `To rewrite the key ({bold,yellow} "${key}") in your configuration file you can simple use the ({bold,green} "Config.set('${key}', ...)") method first. Then, you can use the ({bold,green} "Config.rewrite('${possibleConfigFileName}')") method to rewrite the entire configuration file.`,
20+
help: `To rewrite the key ({bold,yellow} "${key}") in your configuration file you can simple use the ({bold,green} "Config.set('${key}', ...)") method first. Then, you can use the ({bold,green} "Config.rewrite('${possibleConfigFileName}')") method to rewrite the entire configuration file.`
2121
})
2222
}
2323
}

src/exceptions/NotSupportedRcException.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class NotSupportedRcException extends Exception {
1515
status: 500,
1616
code: 'E_NOT_SUPPORTED_RC',
1717
message: `Rewriting the athenna rc file using ({bold,yellow} "Config.rewrite()") method is not supported.`,
18-
help: `To rewrite the values of your athenna rc file you can use the ({bold,green} "Rc") helper imported from ({bold,green} "@athenna/config").`,
18+
help: `To rewrite the values of your athenna rc file you can use the ({bold,green} "Rc") helper imported from ({bold,green} "@athenna/config").`
1919
})
2020
}
2121
}

src/exceptions/NotValidArrayConfigException.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class NotValidArrayConfigException extends Exception {
1515
status: 500,
1616
code: 'E_NOT_VALID_CONFIG_ARRAY',
1717
message: `The configuration ${key} is not a valid array, and it is not possible to push values to it.`,
18-
help: `Try changing your configuration key when calling push and pushAll methods or transform the value of your configuration ${key} to an array.`,
18+
help: `Try changing your configuration key when calling push and pushAll methods or transform the value of your configuration ${key} to an array.`
1919
})
2020
}
2121
}

0 commit comments

Comments
 (0)