@anvil-works/anvil-cli 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +208 -145
  2. package/dist/cli.js +847 -141
  3. package/dist/index.js +12 -5
  4. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -20042,7 +20042,8 @@ var __webpack_exports__ = {};
20042
20042
  }
20043
20043
  const configDefaults = {
20044
20044
  devMode: false,
20045
- verbose: false
20045
+ verbose: false,
20046
+ preferredEditor: ""
20046
20047
  };
20047
20048
  function isTestMode() {
20048
20049
  return "test" === process.env.NODE_ENV || !!process.env.RSTEST;
@@ -22721,6 +22722,7 @@ var __webpack_exports__ = {};
22721
22722
  });
22722
22723
  this.ws.on("error", (error)=>{
22723
22724
  logger_logger.debug(`[WebSocket ${this.sessionId}]`, `Error: ${error.message}`);
22725
+ if (this.isClosing) return;
22724
22726
  if (error.message.includes("502")) logger_logger.error(chalk_source.red("WebSocket connection failed (502 Bad Gateway) - likely a temporary server issue"));
22725
22727
  else logger_logger.error(chalk_source.red(`WebSocket error: ${error.message}`));
22726
22728
  this.emit("error", {
@@ -22821,15 +22823,20 @@ var __webpack_exports__ = {};
22821
22823
  }
22822
22824
  teardownSocket() {
22823
22825
  this.stopHeartbeat();
22824
- if (!this.ws) return;
22826
+ const socket = this.ws;
22827
+ this.ws = null;
22828
+ if (!socket) return;
22825
22829
  try {
22826
22830
  logger_logger.debug(`[WebSocket ${this.sessionId}]`, "Closing WebSocket");
22827
- this.ws.removeAllListeners();
22828
- if (this.ws.readyState === ws_wrapper.OPEN || this.ws.readyState === ws_wrapper.CONNECTING) this.ws.terminate();
22831
+ if (socket.readyState === ws_wrapper.CONNECTING) {
22832
+ socket.once("error", ()=>{});
22833
+ socket.terminate();
22834
+ return;
22835
+ }
22836
+ if (socket.readyState === ws_wrapper.OPEN) return void socket.close();
22829
22837
  } catch (e) {
22830
22838
  logger_logger.debug(`[WebSocket ${this.sessionId}]`, "Error closing WebSocket (ignoring):", e);
22831
22839
  }
22832
- this.ws = null;
22833
22840
  }
22834
22841
  }
22835
22842
  async function detectRemoteChanges(gitService, oldCommitId, newCommitId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvil-works/anvil-cli",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "CLI tool for developing Anvil apps locally",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",