Skip to content

Commit a4167d5

Browse files
authored
Merge pull request #180 from AthennaIO/develop
chore(npm): update dependencies
2 parents 294f7c3 + 9c4be0e commit a4167d5

5 files changed

Lines changed: 74 additions & 8 deletions

File tree

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@athenna/common",
3-
"version": "5.28.0",
3+
"version": "5.29.0",
44
"description": "The Athenna common helpers to use in any Node.js ESM project.",
55
"license": "MIT",
66
"author": "João Lenon <lenon@athenna.io>",

src/helpers/Path.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ export class Path extends Macroable {
4646
seeders: 'src/database/seeders',
4747
migrations: 'src/database/migrations',
4848
lang: 'src/lang',
49+
events: 'src/events',
50+
listeners: 'src/events/listeners',
4951
resources: 'resources',
5052
views: 'resources/views',
5153
locales: 'resources/locales',
@@ -265,6 +267,38 @@ export class Path extends Macroable {
265267
return this
266268
}
267269

270+
/**
271+
* Return the events path of your project.
272+
*/
273+
public static events(subPath: string = sep): string {
274+
return this.pwd(this.dirs.events + sep + normalize(subPath))
275+
}
276+
277+
/**
278+
* Set the directory of events folder.
279+
*/
280+
public static setEvents(directory: string): typeof Path {
281+
this.dirs.events = directory
282+
283+
return this
284+
}
285+
286+
/**
287+
* Return the listeners path of your project.
288+
*/
289+
public static listeners(subPath: string = sep): string {
290+
return this.pwd(this.dirs.listeners + sep + normalize(subPath))
291+
}
292+
293+
/**
294+
* Set the directory of listeners folder.
295+
*/
296+
public static setListeners(directory: string): typeof Path {
297+
this.dirs.listeners = directory
298+
299+
return this
300+
}
301+
268302
/**
269303
* Return the node_modules path of your project.
270304
*/

src/types/PathDirs.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ export interface PathDirs {
3636
seeders?: string
3737
migrations?: string
3838
lang?: string
39+
events?: string
40+
listeners?: string
3941
resources?: string
4042
apiResources?: string
4143
views?: string

tests/unit/helpers/PathTest.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ export default class PathTest {
179179
.setSeeders('build/src/database/seeders')
180180
.setMigrations('build/src/database/migrations')
181181
.setLang('build/src/lang')
182+
.setEvents('build/src/events')
183+
.setListeners('build/src/events/listeners')
182184
.setResources('build/resources')
183185
.setApiResources('build/src/resources')
184186
.setViews('build/resources/views')
@@ -226,6 +228,8 @@ export default class PathTest {
226228
assert.isTrue(Path.migrations().endsWith(`build${sep}src${sep}database${sep}migrations`))
227229
assert.isTrue(Path.resources().endsWith(`build${sep}resources`))
228230
assert.isTrue(Path.views().endsWith(`build${sep}resources${sep}views`))
231+
assert.isTrue(Path.events().endsWith(`build${sep}src${sep}events`))
232+
assert.isTrue(Path.listeners().endsWith(`build${sep}src${sep}events${sep}listeners`))
229233
assert.isTrue(Path.locales().endsWith(`build${sep}resources${sep}locales`))
230234
assert.isTrue(Path.apiResources().endsWith(`build${sep}src${sep}resources`))
231235
assert.isTrue(Path.nodeModules().endsWith(`build${sep}node_modules`))

0 commit comments

Comments
 (0)