Skip to content

Commit

Permalink
feat: consola integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooya Parsa committed Mar 31, 2018
1 parent 5367bd5 commit 4ec3b5d
Show file tree
Hide file tree
Showing 4 changed files with 1,260 additions and 1,124 deletions.
12 changes: 5 additions & 7 deletions lib/module.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const chalk = require('chalk')
const path = require('path')
const debug = require('debug')('nuxt:axios')
const consola = require('consola')

const logger = consola.withScope('nuxt:axios')

module.exports = function nuxtAxios (_moduleOptions) {
// Combine options
Expand Down Expand Up @@ -94,12 +96,8 @@ module.exports = function nuxtAxios (_moduleOptions) {
// Set _AXIOS_BASE_URL_ for dynamic SSR baseURL
process.env._AXIOS_BASE_URL_ = options.baseURL

/* eslint-disable no-console */
debug(
`BaseURL: ${chalk.green(options.baseURL)} (Browser: ${chalk.green(
options.browserBaseURL
)})`
)
logger.info(`BaseURL: ${chalk.green(options.baseURL)}`)
logger.info(`BaseURL (Browser): ${chalk.green(options.browserBaseURL)}`)
}

module.exports.meta = require('../package.json')
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@
]
},
"dependencies": {
"@nuxtjs/proxy": "^1.1.4",
"@nuxtjs/proxy": "^1.2.1",
"axios": "^0.18.0",
"axios-retry": "^3.0.2",
"chalk": "^2.3.2",
"debug": "^3.1.0"
"consola": "^1.0.0"
},
"devDependencies": {
"codecov": "latest",
"eslint": "^4.17.0",
"eslint-config-standard": "11.0.0",
"eslint-plugin-import": "latest",
"eslint-plugin-jest": "latest",
"eslint-plugin-import": "^2.10.0",
"eslint-plugin-jest": "^21.15.0",
"eslint-plugin-node": "6.0.1",
"eslint-plugin-promise": "latest",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-standard": "latest",
"eslint-plugin-vue": "latest",
"jest": "latest",
"eslint-plugin-vue": "^4.4.0",
"jest": "^22.4.3",
"jsdom": "^11.6.2",
"nuxt": "^1.3.0",
"nuxt-edge": "^2.0.0-25375287.923164e",
"standard-version": "latest"
}
}
2 changes: 1 addition & 1 deletion test/axios.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Nuxt, Builder } = require('nuxt')
const { Nuxt, Builder } = require('nuxt-edge')
const axios = require('axios')
const config = require('./fixture/nuxt.config')

Expand Down
Loading

0 comments on commit 4ec3b5d

Please sign in to comment.