feat: consola integration

master
Pooya Parsa 2018-03-31 22:22:54 +04:30
parent 5367bd5620
commit 4ec3b5dd0f
4 changed files with 1263 additions and 1127 deletions

View File

@ -1,6 +1,8 @@
const chalk = require('chalk') const chalk = require('chalk')
const path = require('path') 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) { module.exports = function nuxtAxios (_moduleOptions) {
// Combine options // Combine options
@ -94,12 +96,8 @@ module.exports = function nuxtAxios (_moduleOptions) {
// Set _AXIOS_BASE_URL_ for dynamic SSR baseURL // Set _AXIOS_BASE_URL_ for dynamic SSR baseURL
process.env._AXIOS_BASE_URL_ = options.baseURL process.env._AXIOS_BASE_URL_ = options.baseURL
/* eslint-disable no-console */ logger.info(`BaseURL: ${chalk.green(options.baseURL)}`)
debug( logger.info(`BaseURL (Browser): ${chalk.green(options.browserBaseURL)}`)
`BaseURL: ${chalk.green(options.baseURL)} (Browser: ${chalk.green(
options.browserBaseURL
)})`
)
} }
module.exports.meta = require('../package.json') module.exports.meta = require('../package.json')

View File

@ -34,25 +34,25 @@
] ]
}, },
"dependencies": { "dependencies": {
"@nuxtjs/proxy": "^1.1.4", "@nuxtjs/proxy": "^1.2.1",
"axios": "^0.18.0", "axios": "^0.18.0",
"axios-retry": "^3.0.2", "axios-retry": "^3.0.2",
"chalk": "^2.3.2", "chalk": "^2.3.2",
"debug": "^3.1.0" "consola": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
"codecov": "latest", "codecov": "latest",
"eslint": "^4.17.0", "eslint": "^4.17.0",
"eslint-config-standard": "11.0.0", "eslint-config-standard": "11.0.0",
"eslint-plugin-import": "latest", "eslint-plugin-import": "^2.10.0",
"eslint-plugin-jest": "latest", "eslint-plugin-jest": "^21.15.0",
"eslint-plugin-node": "6.0.1", "eslint-plugin-node": "6.0.1",
"eslint-plugin-promise": "latest", "eslint-plugin-promise": "^3.7.0",
"eslint-plugin-standard": "latest", "eslint-plugin-standard": "latest",
"eslint-plugin-vue": "latest", "eslint-plugin-vue": "^4.4.0",
"jest": "latest", "jest": "^22.4.3",
"jsdom": "^11.6.2", "jsdom": "^11.6.2",
"nuxt": "^1.3.0", "nuxt-edge": "^2.0.0-25375287.923164e",
"standard-version": "latest" "standard-version": "latest"
} }
} }

View File

@ -1,4 +1,4 @@
const { Nuxt, Builder } = require('nuxt') const { Nuxt, Builder } = require('nuxt-edge')
const axios = require('axios') const axios = require('axios')
const config = require('./fixture/nuxt.config') const config = require('./fixture/nuxt.config')

2360
yarn.lock

File diff suppressed because it is too large Load Diff