refactor: change _open endpoint to /__open-in-editor

upgrade @nuxtjs/youch to 4.0.0

ref: vuejs/vue-devtools#483
This commit is contained in:
Pooya Parsa 2018-01-04 20:44:11 +03:30
parent 5b923fd97e
commit 96c3b4a15b
5 changed files with 10 additions and 10 deletions

View File

@ -226,7 +226,7 @@ module.exports = class Renderer {
const _this = this
if (this.options.debug && this.options.dev) {
this.useMiddleware({
path: '_open',
path: '__open-in-editor',
handler(req, res) {
// Lazy load open-in-editor
const openInEditor = require('open-in-editor')

View File

@ -56,7 +56,7 @@
"npm": ">=5.0.0"
},
"dependencies": {
"@nuxtjs/youch": "^3.1.0",
"@nuxtjs/youch": "^4.0.0",
"ansi-html": "^0.0.7",
"autoprefixer": "^7.2.3",
"babel-core": "^6.26.0",

View File

@ -25,18 +25,18 @@ test.serial('Init Nuxt.js', async t => {
t.true(logSpy.calledWithMatch('OPEN'))
})
test.serial('/test/_open (open-in-editor)', async t => {
test.serial('/test/__open-in-editor (open-in-editor)', async t => {
const logSpy = await interceptLog()
const { body } = await rp(url('/test/_open?file=pages/index.vue'), { resolveWithFullResponse: true })
const { body } = await rp(url('/test/__open-in-editor?file=pages/index.vue'), { resolveWithFullResponse: true })
t.is(body, 'opened in editor!')
release()
t.is(logSpy.getCall(0).args[0], '[open in editor]')
t.true(logSpy.calledOnce)
})
test.serial('/test/_open should return error (open-in-editor)', async t => {
test.serial('/test/__open-in-editor should return error (open-in-editor)', async t => {
const logSpy = await interceptLog()
const { body } = await rp(url('/test/_open?file='), { resolveWithFullResponse: true })
const { body } = await rp(url('/test/__open-in-editor?file='), { resolveWithFullResponse: true })
t.is(body, 'File is not specified')
release()
t.is(logSpy.getCall(0).args[0], '[open in editor]')

View File

@ -2,7 +2,7 @@ module.exports = {
router: {
base: '/test/'
},
dev: true, // Needed for _open middleware
dev: true, // Needed for __open-in-editor middleware
debug: true,
editor: {
cmd: 'echo',

View File

@ -97,9 +97,9 @@
dependencies:
arrify "^1.0.1"
"@nuxtjs/youch@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@nuxtjs/youch/-/youch-3.1.0.tgz#0e4f38d1b9ede2a77b121c02cbd839937e8918ad"
"@nuxtjs/youch@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@nuxtjs/youch/-/youch-4.0.0.tgz#74eb880f57a3f76f7684f69ba2753a815f308deb"
dependencies:
cookie "^0.3.1"
mustache "^2.3.0"