Skip to content

Commit

Permalink
chore(npm): update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Sep 7, 2023
1 parent 8a3febc commit b1ecd0c
Show file tree
Hide file tree
Showing 22 changed files with 204 additions and 173 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ build
*.js
*.d.ts
*.js.map
!tests/stubs/**/*.js
!tests/stubs/**/*.d.ts
!tests/stubs/**/*.js.map
!tests/fixtures/**/*.js
!tests/fixtures/**/*.d.ts
!tests/fixtures/**/*.js.map
!configurer/config/mail.js

# IDE
Expand Down
285 changes: 157 additions & 128 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/mail",
"version": "4.2.0",
"version": "4.3.0",
"description": "The Athenna email handler. Built on top of nodemailer.",
"license": "MIT",
"author": "Victor Tesoura Júnior <[email protected]>",
Expand Down Expand Up @@ -54,17 +54,17 @@
},
"dependencies": {
"nodemailer": "^6.9.4",
"nodemailer-markdown": "^1.0.3",
"nodemailer-markdown": "^1.0.2",
"smtp-server": "^3.13.0"
},
"devDependencies": {
"@athenna/artisan": "^4.2.0",
"@athenna/common": "^4.4.0",
"@athenna/config": "^4.3.0",
"@athenna/ioc": "^4.1.0",
"@athenna/logger": "^4.2.0",
"@athenna/test": "^4.3.0",
"@athenna/view": "^4.1.0",
"@athenna/artisan": "^4.9.0",
"@athenna/common": "^4.10.1",
"@athenna/config": "^4.4.0",
"@athenna/ioc": "^4.2.0",
"@athenna/logger": "^4.3.0",
"@athenna/test": "^4.5.0",
"@athenna/view": "^4.2.0",
"@types/nodemailer": "^6.4.7",
"@types/smtp-server": "^3.5.7",
"@typescript-eslint/eslint-plugin": "^5.56.0",
Expand Down Expand Up @@ -122,7 +122,7 @@
},
"prettier": {
"singleQuote": true,
"trailingComma": "all",
"trailingComma": "none",
"arrowParens": "avoid",
"endOfLine": "lf",
"semi": false,
Expand Down Expand Up @@ -189,7 +189,9 @@
"repository": "node_modules/@athenna/core/templates/repository.edge",
"service": "node_modules/@athenna/core/templates/service.edge",
"test": "node_modules/@athenna/core/templates/test.edge",
"testFn": "node_modules/@athenna/core/templates/testFn.edge",
"test-fn": "node_modules/@athenna/core/templates/test-fn.edge",
"test-cli": "node_modules/@athenna/core/templates/test-cli.edge",
"test-rest": "node_modules/@athenna/core/templates/test-rest.edge",
"command": "node_modules/@athenna/artisan/templates/command.edge",
"controller": "node_modules/@athenna/http/templates/controller.edge",
"middleware": "node_modules/@athenna/http/templates/middleware.edge",
Expand Down
8 changes: 4 additions & 4 deletions src/drivers/SmtpDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type { Envelope } from 'nodemailer/lib/mailer/index.js'
import {
createTransport,
type Transporter,
type SendMailOptions,
type SendMailOptions
} from 'nodemailer'

const markdown = nodemailerMd.markdown
Expand Down Expand Up @@ -141,7 +141,7 @@ export class SmtpDriver {
public attachment(
pathOrFileName: string,
content?: any,
encoding?: string,
encoding?: string
): SmtpDriver {
if (!this.message.attachments) {
this.message.attachments = []
Expand All @@ -152,7 +152,7 @@ export class SmtpDriver {

this.message.attachments.push({
filename: file.base,
content: file.getContentSync(),
content: file.getContentSync()
})

return this
Expand Down Expand Up @@ -218,7 +218,7 @@ export class SmtpDriver {
public view(
name: string,
data?: any,
renderType: 'markdown' | 'html' | 'text' = 'html',
renderType: 'markdown' | 'html' | 'text' = 'html'
): SmtpDriver {
this.message[renderType] = View.renderSync(name, data)

Expand Down
2 changes: 1 addition & 1 deletion src/exceptions/NotFoundDriverException.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class NotFoundDriverException extends Exception {
message,
status: 500,
code: 'E_NOT_FOUND_ERROR',
help: `Available drivers are: ${availableDrivers}. Look into your config/mail file if ${driverName} driver is implemented by mail. Or create ${driverName} driver implementation using DriverFactory.createDriver("${driverName}", ...) method.`,
help: `Available drivers are: ${availableDrivers}. Look into your config/mail file if ${driverName} driver is implemented by mail. Or create ${driverName} driver implementation using DriverFactory.createDriver("${driverName}", ...) method.`
})
}
}
4 changes: 2 additions & 2 deletions src/exceptions/NotImplementedConfigException.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class NotImplementedConfigException extends Exception {

if (Config.get('mail.mailers')) {
const availableConfigs = Object.keys(Config.get('mail.mailers')).join(
', ',
', '
)

help += `Available mailers are: ${availableConfigs}.`
Expand All @@ -32,7 +32,7 @@ export class NotImplementedConfigException extends Exception {
message,
status: 500,
code: 'E_NOT_IMPLEMENTED_CONFIG_ERROR',
help,
help
})
}
}
2 changes: 1 addition & 1 deletion src/facades/SmtpServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ import { Facade } from '@athenna/ioc'
import type { SmtpServerImpl } from '#src'

export const SmtpServer = Facade.createFor<SmtpServerImpl>(
'Athenna/Core/SmtpServer',
'Athenna/Core/SmtpServer'
)
2 changes: 1 addition & 1 deletion src/factories/DriverFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class DriverFactory {
* Driver of driver factory.
*/
public static drivers: Map<string, { Driver: any }> = new Map().set('smtp', {
Driver: SmtpDriver,
Driver: SmtpDriver
})

/**
Expand Down
2 changes: 1 addition & 1 deletion src/mail/MailImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class MailImpl {
public view(
name: string,
data?: any,
renderType?: 'markdown' | 'html' | 'text',
renderType?: 'markdown' | 'html' | 'text'
): MailImpl {
this.driver.view(name, data, renderType)

Expand Down
2 changes: 1 addition & 1 deletion src/providers/SmtpServerProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class SmtpServerProvider extends ServiceProvider {

public async shutdown() {
const SmtpServer = this.container.use<SmtpServerImpl>(
'Athenna/Core/SmtpServer',
'Athenna/Core/SmtpServer'
)

if (!SmtpServer) {
Expand Down
2 changes: 1 addition & 1 deletion src/smtp/SmtpServerImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class SmtpServerImpl {
public async listen(
port = 5025,
host?: string,
backlog?: number,
backlog?: number
): Promise<void> {
return new Promise((resolve, reject) => {
try {
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions tests/stubs/config/mail.ts → tests/fixtures/config/mail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export default {
host: 'localhost',
port: 5025,
tls: {
rejectUnauthorized: false,
},
rejectUnauthorized: false
}
},
nullDriver: {
driver: 'not-found',
},
},
driver: 'not-found'
}
}
}
File renamed without changes.
8 changes: 8 additions & 0 deletions tests/fixtures/config/view.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
disks: {
mail: Path.fixtures('views/mail')
},
edge: {
cache: false
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/helpers/BaseTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class BaseTest {

process.env.IS_TS = 'true'

await Config.loadAll(Path.stubs('config'))
await Config.loadAll(Path.fixtures('config'))

await new MailProvider().register()
await new ViewProvider().register()
Expand Down Expand Up @@ -61,7 +61,7 @@ export class BaseTest {
CommanderHandler.getCommander<any>()._version = undefined

await Folder.safeRemove(Path.config())
await Folder.safeRemove(Path.stubs('storage'))
await Folder.safeRemove(Path.fixtures('storage'))

await File.safeRemove(Path.pwd('.env'))
await File.safeRemove(Path.pwd('.env.test'))
Expand Down
8 changes: 0 additions & 8 deletions tests/stubs/config/view.ts

This file was deleted.

8 changes: 4 additions & 4 deletions tests/unit/drivers/SmtpDriverTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class SmtpDriverTest extends BaseTest {
assert.deepEqual(result.response, '250 OK: message queued')
assert.deepEqual(result.envelope, {
from: '[email protected]',
to: ['[email protected]'],
to: ['[email protected]']
})
}

Expand Down Expand Up @@ -100,7 +100,7 @@ export default class SmtpDriverTest extends BaseTest {
const result = await Mail.from('[email protected]')
.to('[email protected]')
.subject('Email attachment')
.attachment(Path.stubs('attachments/file.txt'))
.attachment(Path.fixtures('attachments/file.txt'))
.text('Sending the e-mail attachment')
.send()

Expand All @@ -126,7 +126,7 @@ export default class SmtpDriverTest extends BaseTest {
const result = await Mail.from('[email protected]')
.to('[email protected]')
.subject('Email attachments')
.attachments(Path.stubs('attachments'))
.attachments(Path.fixtures('attachments'))
.text('Sending the e-mail attachments')
.send()

Expand All @@ -141,7 +141,7 @@ export default class SmtpDriverTest extends BaseTest {
.from('[email protected]')
.to('[email protected]')
.subject('Email attachments')
.attachments(Path.stubs('attachments'))
.attachments(Path.fixtures('attachments'))
.text('Sending the e-mail attachments')
.send()

Expand Down

0 comments on commit b1ecd0c

Please sign in to comment.