Skip to content

Commit

Permalink
fix: persistent spinner breaks vscode context link detection (#1602)
Browse files Browse the repository at this point in the history
* fix: persistent spinner breaks vscode context link detection

* update dep visual-logger
  • Loading branch information
jchip authored Apr 16, 2020
1 parent b4bca3d commit 065431e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
21 changes: 10 additions & 11 deletions packages/xarc-app-dev/lib/dev-admin/admin-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ const DEV_ADMIN_STATUS = "DevAdminStatus";
const WDS_PROGRESS = "WDSProgress";
const LOG_ALERT = "LogAlert";

const PROMPT_SPINNER = ">>>>>>>> ";

const SERVER_ENVS = {
[APP_SERVER_NAME]: {
XARC_BABEL_TARGET: "node"
Expand Down Expand Up @@ -68,8 +66,7 @@ class AdminServer {
this._io.setup();
this._io.addItem({
name: DEV_ADMIN_STATUS,
display: ck`[<green.inverse>DEV ADMIN</>]`,
spinner: PROMPT_SPINNER
display: ck`[<green.inverse>DEV ADMIN</>]`
});
this.updateStatus("webpack is PENDING");
this.handleUserInput();
Expand Down Expand Up @@ -134,8 +131,7 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown
}

getServer(name) {
if (this._servers[name]) return this._servers[name];
return {};
return this._servers[name] || {};
}

handleServerExit(name) {
Expand Down Expand Up @@ -330,7 +326,11 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown
}
if (line.startsWith(progSig)) {
progLine = line.substring(progSig.length).replace(cwdRegex, ".");
this._io.addItem({ name: WDS_PROGRESS, spinner: true, display: `Webpack Progress` });
this._io.addItem({
name: WDS_PROGRESS,
spinner: true,
display: `Webpack Progress`
});
this._io.updateItem(WDS_PROGRESS, progLine);
const match = progLine.match(/\d{1,3}%/);
if (match) {
Expand Down Expand Up @@ -389,9 +389,8 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown

toggleFullLogUrlMessage(serverName) {
const server = this.getServer(serverName);
if (server && server.options.logSaver) {
const { options } = server;
const { logSaver } = options;
if (server.options) {
const { logSaver } = server.options;
logSaver._toggle = !logSaver._toggle;
if (!logSaver._toggle) {
this._io.removeItem(LOG_ALERT);
Expand All @@ -405,7 +404,7 @@ ${proxyItem}<magenta>M</> - Show this menu <magenta>Q</> - Shutdown
this._io.addItem({
name: LOG_ALERT,
display: ck`[<orange.inverse>ALERT</>]`,
spinner: PROMPT_SPINNER
spinner: false
});
const instruction = `<orange>View full logs at: <cyan.underline>${url}</></> - \
<green>Press Z to hide or show this message</>`;
Expand Down
2 changes: 1 addition & 1 deletion packages/xarc-app-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"style-loader": "^0.20.1",
"subapp-util": "^1.0.5",
"sudo-prompt": "^8.2.5",
"visual-logger": "^1.1.0",
"visual-logger": "^1.1.2",
"webpack-cli": "^3.3.9",
"webpack-dev-middleware": "^3.4.0",
"webpack-hot-middleware": "^2.22.2",
Expand Down

0 comments on commit 065431e

Please sign in to comment.