From c6a3cb59275b095bc69e392d77a982a6334f6551 Mon Sep 17 00:00:00 2001 From: Billyyyyy3320 Date: Mon, 20 Jan 2020 17:47:50 +0800 Subject: [PATCH] feat($cli): run debug mode without clearing screen (close #2100) (#2116) --- packages/@vuepress/core/lib/node/dev/index.js | 2 +- .../core/lib/node/webpack/DevLogPlugin.js | 2 +- packages/docs/docs/api/cli.md | 2 +- packages/docs/docs/zh/api/cli.md | 2 +- packages/vuepress/package.json | 52 +++++++++---------- yarn.lock | 8 +-- 6 files changed, 34 insertions(+), 34 deletions(-) diff --git a/packages/@vuepress/core/lib/node/dev/index.js b/packages/@vuepress/core/lib/node/dev/index.js index 48bad424f4..bec9a1de2c 100644 --- a/packages/@vuepress/core/lib/node/dev/index.js +++ b/packages/@vuepress/core/lib/node/dev/index.js @@ -175,7 +175,7 @@ module.exports = class DevProcess extends EventEmitter { port: this.port, displayHost: this.displayHost, publicPath: this.context.base, - clearScreen: this.context.options.clearScreen + clearScreen: !(this.context.options.debug || !this.context.options.clearScreen) }]) config = config.toConfig() diff --git a/packages/@vuepress/core/lib/node/webpack/DevLogPlugin.js b/packages/@vuepress/core/lib/node/webpack/DevLogPlugin.js index 1296a82e6a..1c9c4af5c9 100644 --- a/packages/@vuepress/core/lib/node/webpack/DevLogPlugin.js +++ b/packages/@vuepress/core/lib/node/webpack/DevLogPlugin.js @@ -17,7 +17,7 @@ module.exports = class DevLogPlugin { apply (compiler) { let isFirst = true - const { displayHost, port, publicPath, clearScreen: shouldClearScreen = true } = this.options + const { displayHost, port, publicPath, clearScreen: shouldClearScreen } = this.options compiler.hooks.done.tap('vuepress-log', stats => { if (shouldClearScreen) { diff --git a/packages/docs/docs/api/cli.md b/packages/docs/docs/api/cli.md index 54cbff90cf..b28b783dfc 100644 --- a/packages/docs/docs/api/cli.md +++ b/packages/docs/docs/api/cli.md @@ -40,7 +40,7 @@ See [host](../config/README.md#host). Open browser when ready. ### --no-clear-screen -Do not clear screen when dev server is ready. +Do not clear screen when dev server is ready. Note that dev server will not clear screen if you start it in debug mode. ## eject diff --git a/packages/docs/docs/zh/api/cli.md b/packages/docs/docs/zh/api/cli.md index 64b2df8008..9e44810b4f 100644 --- a/packages/docs/docs/zh/api/cli.md +++ b/packages/docs/docs/zh/api/cli.md @@ -40,7 +40,7 @@ vuepress targetDir [options] 当服务端准备就绪时自动打开浏览器。 ### --no-clear-screen -当 dev server 就绪时不清除屏幕。 +当 dev server 就绪时不清除屏幕。请注意 dev server 不会在调试模式下清除屏幕。 ## eject diff --git a/packages/vuepress/package.json b/packages/vuepress/package.json index fd448c1352..81a6a9151d 100644 --- a/packages/vuepress/package.json +++ b/packages/vuepress/package.json @@ -2,51 +2,51 @@ "name": "vuepress", "version": "1.2.0", "description": "Minimalistic doc generator with Vue component based layout system", - "main": "index.js", + "keywords": [ + "documentation", + "generator", + "vue" + ], + "homepage": "https://github.com/vuejs/vuepress#readme", + "bugs": { + "url": "https://github.com/vuejs/vuepress/issues" + }, "repository": { "type": "git", "url": "git+https://github.com/vuejs/vuepress.git", "directory": "packages/vuepress" }, - "scripts": { - "postinstall": "opencollective-postinstall || true" - }, - "keywords": [ - "documentation", - "vue", - "generator" - ], + "license": "MIT", + "author": "Evan You", + "main": "index.js", "bin": { "vuepress": "cli.js" }, - "author": "Evan You", - "maintainers": [ - { - "name": "ULIVZ", - "email": "chl814@foxmail.com" - } - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/vuejs/vuepress/issues" + "scripts": { + "postinstall": "opencollective-postinstall || true" }, - "homepage": "https://github.com/vuejs/vuepress#readme", + "browserslist": [ + ">1%" + ], "dependencies": { "@vuepress/core": "^1.2.0", "@vuepress/theme-default": "^1.2.0", - "cac": "^6.3.9", + "cac": "^6.5.5", "envinfo": "^7.2.0", "opencollective-postinstall": "^2.0.2", "update-notifier": "^4.0.0" }, + "engines": { + "node": ">=8.6" + }, "collective": { "type": "opencollective", "url": "https://opencollective.com/vuepress" }, - "engines": { - "node": ">=8.6" - }, - "browserslist": [ - ">1%" + "maintainers": [ + { + "name": "ULIVZ", + "email": "chl814@foxmail.com" + } ] } diff --git a/yarn.lock b/yarn.lock index 33f89ddc09..8b3f44cf02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3485,10 +3485,10 @@ bytes@3.1.0: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== -cac@^6.3.9: - version "6.5.3" - resolved "https://registry.yarnpkg.com/cac/-/cac-6.5.3.tgz#dcd8b7496b563b87e8a1fc69e3118bdf29c781f2" - integrity sha512-wZfzSWVXuue1H3J7TDNjbzg4KTqPXCmh7F3QIzEYXfnhMCcOUrx99M7rpO2UDVJA9dqv3butGj2nHvCV47CmPg== +cac@^6.5.5: + version "6.5.5" + resolved "https://registry.yarnpkg.com/cac/-/cac-6.5.5.tgz#fb7720ecb95988d1425e5b4a2db41f6c5cd6e672" + integrity sha512-DF1HgrY2BkyrY1+g3Fwk/HFUcycI1PHpV3hCCxHM9qAPe+nrIOKFbzej2uiWdAjw4ry5eSYVWR4MLQYp2nV5YA== cacache@^11.3.3: version "11.3.3"