chore(package): update all dependencies
This commit is contained in:
parent
d23df2ab15
commit
978c881ab7
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"comments": false,
|
|
||||||
"compact": true,
|
|
||||||
"optional": [
|
|
||||||
"es7.asyncFunctions",
|
|
||||||
"es7.decorators",
|
|
||||||
"es7.exportExtensions",
|
|
||||||
"es7.functionBind",
|
|
||||||
"runtime"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,9 +1,6 @@
|
|||||||
/.nyc_output/
|
/.nyc_output/
|
||||||
/bower_components/
|
|
||||||
/dist/
|
/dist/
|
||||||
|
/node_modules/
|
||||||
|
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
npm-debug.log.*
|
npm-debug.log.*
|
||||||
|
|
||||||
!node_modules/*
|
|
||||||
node_modules/*/
|
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
Error.stackTraceLimit = 100
|
|
||||||
|
|
||||||
try { require('trace') } catch (_) {}
|
|
||||||
try { require('clarify') } catch (_) {}
|
|
||||||
try { require('source-map-support/register') } catch (_) {}
|
|
@ -1 +0,0 @@
|
|||||||
--require ./.mocha.js
|
|
@ -3,7 +3,6 @@ node_js:
|
|||||||
- 'stable'
|
- 'stable'
|
||||||
- '4'
|
- '4'
|
||||||
- '0.12'
|
- '0.12'
|
||||||
- '0.10'
|
|
||||||
|
|
||||||
# Use containers.
|
# Use containers.
|
||||||
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
|
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
|
||||||
|
@ -4,21 +4,16 @@
|
|||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
Go inside your `xo-server` folder and install it:
|
Installation of the [npm package](https://npmjs.org/package/xo-server-transport-email):
|
||||||
|
|
||||||
```
|
```
|
||||||
> npm install xo-server-transport-email
|
> npm install --global xo-server-auth-email
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Edit your `xo-server` configuration and add the plugin name in the `plugins` section.
|
Like all other xo-server plugins, it can be configured directly via
|
||||||
|
the web iterface, see [the plugin documentation](https://xen-orchestra.com/docs/plugins.html).
|
||||||
```yaml
|
|
||||||
plugins:
|
|
||||||
|
|
||||||
xo-server-transport-email:
|
|
||||||
```
|
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
@ -24,38 +24,46 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"dist/"
|
"dist/"
|
||||||
],
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.12"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"babel-runtime": "^5.8.34",
|
"nodemailer": "^2.4.2",
|
||||||
"nodemailer": "^1.10.0",
|
|
||||||
"nodemailer-markdown": "^1.0.0",
|
"nodemailer-markdown": "^1.0.0",
|
||||||
"pify": "^2.3.0"
|
"promise-toolbox": "^0.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel": "^5.8.34",
|
"babel-cli": "^6.10.1",
|
||||||
"babel-eslint": "^4.1.5",
|
"babel-eslint": "^6.1.0",
|
||||||
"clarify": "^1.0.5",
|
"babel-preset-es2015": "^6.9.0",
|
||||||
|
"babel-preset-stage-0": "^6.5.0",
|
||||||
"dependency-check": "^2.5.1",
|
"dependency-check": "^2.5.1",
|
||||||
"mocha": "^2.3.4",
|
"ghooks": "^1.2.4",
|
||||||
"must": "^0.13.1",
|
"standard": "^7.1.2"
|
||||||
"nyc": "^3.2.2",
|
|
||||||
"source-map-support": "^0.3.3",
|
|
||||||
"standard": "^5.4.1",
|
|
||||||
"trace": "^2.0.1"
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "babel --source-maps --out-dir=dist/ src/",
|
"build": "NODE_ENV=production babel --source-maps --out-dir=dist/ src/",
|
||||||
"dev": "babel --watch --source-maps --out-dir=dist/ src/",
|
|
||||||
"dev-test": "mocha --opts .mocha.opts --watch --reporter=min \"dist/**/*.spec.js\"",
|
|
||||||
"lint": "standard",
|
|
||||||
"depcheck": "dependency-check ./package.json",
|
"depcheck": "dependency-check ./package.json",
|
||||||
|
"dev": "babel --watch --source-maps --out-dir=dist/ src/",
|
||||||
|
"lint": "standard",
|
||||||
"posttest": "npm run lint && npm run depcheck",
|
"posttest": "npm run lint && npm run depcheck",
|
||||||
"prepublish": "npm run build",
|
"prepublish": "npm run build"
|
||||||
"test": "nyc mocha --opts .mocha.opts \"dist/**/*.spec.js\""
|
},
|
||||||
|
"babel": {
|
||||||
|
"presets": [
|
||||||
|
"stage-0",
|
||||||
|
"es2015"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"standard": {
|
"standard": {
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"dist/**"
|
"dist"
|
||||||
],
|
],
|
||||||
"parser": "babel-eslint"
|
"parser": "babel-eslint"
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"ghooks": {
|
||||||
|
"commit-msg": "npm test"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import pify from 'pify'
|
|
||||||
import { createTransport } from 'nodemailer'
|
import { createTransport } from 'nodemailer'
|
||||||
import { markdown as nodemailerMarkdown } from 'nodemailer-markdown'
|
import { markdown as nodemailerMarkdown } from 'nodemailer-markdown'
|
||||||
|
import { promisify } from 'promise-toolbox'
|
||||||
|
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ class TransportEmailPlugin {
|
|||||||
transport.use('compile', markdownCompiler)
|
transport.use('compile', markdownCompiler)
|
||||||
|
|
||||||
this._conf = conf
|
this._conf = conf
|
||||||
this._send = pify(::transport.sendMail, Promise)
|
this._send = transport.sendMail::promisify(transport)
|
||||||
}
|
}
|
||||||
|
|
||||||
load () {
|
load () {
|
||||||
@ -141,15 +141,15 @@ class TransportEmailPlugin {
|
|||||||
this._unset()
|
this._unset()
|
||||||
}
|
}
|
||||||
|
|
||||||
async _sendEmail ({
|
_sendEmail ({
|
||||||
from,
|
from = this._conf.from,
|
||||||
to, cc, bcc,
|
to, cc, bcc,
|
||||||
subject,
|
subject,
|
||||||
markdown
|
markdown
|
||||||
}) {
|
}) {
|
||||||
// TODO: handle errors
|
// TODO: handle errors
|
||||||
await this._send({
|
return this._send({
|
||||||
from: from || this._conf.from,
|
from,
|
||||||
to, cc, bcc,
|
to, cc, bcc,
|
||||||
subject,
|
subject,
|
||||||
markdown
|
markdown
|
||||||
|
Loading…
Reference in New Issue
Block a user