@jay-framework/editor-client 0.10.0 → 0.12.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 (2) hide show
  1. package/dist/index.js +8 -7
  2. package/package.json +5 -4
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ var __publicField = (obj, key, value) => {
6
6
  };
7
7
  import { io } from "socket.io-client";
8
8
  import { v4 } from "uuid";
9
+ import { getLogger } from "@jay-framework/logger";
9
10
  import { createProtocolMessage } from "@jay-framework/editor-protocol";
10
11
  class ConnectionManager {
11
12
  constructor(options = {}) {
@@ -96,7 +97,7 @@ class ConnectionManager {
96
97
  try {
97
98
  callback(newState);
98
99
  } catch (error) {
99
- console.error("Error in connection state callback:", error);
100
+ getLogger().error(`Error in connection state callback: ${error}`);
100
101
  }
101
102
  });
102
103
  if (newState === "disconnected" && this.autoReconnect && !this.isManualDisconnect) {
@@ -177,16 +178,16 @@ ${errors.join("\n")}`
177
178
  forceNew: true
178
179
  });
179
180
  this.socket.on("connect", () => {
180
- console.log("Connected to editor server");
181
+ getLogger().info("Connected to editor server");
181
182
  this.setupSocketHandlers();
182
183
  resolve();
183
184
  });
184
185
  this.socket.on("connect_error", (error) => {
185
- console.error("Connection error:", error);
186
+ getLogger().error(`Connection error: ${error}`);
186
187
  reject(error);
187
188
  });
188
189
  this.socket.on("disconnect", () => {
189
- console.log("Disconnected from editor server");
190
+ getLogger().info("Disconnected from editor server");
190
191
  this.updateConnectionState("disconnected");
191
192
  });
192
193
  });
@@ -210,12 +211,12 @@ ${errors.join("\n")}`
210
211
  if (this.isManualDisconnect || this.isConnecting) {
211
212
  return;
212
213
  }
213
- console.log("Attempting to reconnect...");
214
+ getLogger().info("Attempting to reconnect...");
214
215
  try {
215
216
  await this.connect();
216
- console.log("Reconnected successfully");
217
+ getLogger().info("Reconnected successfully");
217
218
  } catch (error) {
218
- console.error("Reconnection failed:", error);
219
+ getLogger().error(`Reconnection failed: ${error}`);
219
220
  this.scheduleReconnect();
220
221
  }
221
222
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jay-framework/editor-client",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -24,14 +24,15 @@
24
24
  "test:watch": "vitest"
25
25
  },
26
26
  "dependencies": {
27
- "@jay-framework/editor-protocol": "^0.10.0",
27
+ "@jay-framework/editor-protocol": "^0.12.0",
28
+ "@jay-framework/logger": "^0.12.0",
28
29
  "get-port": "^7.0.0",
29
30
  "socket.io-client": "^4.7.4",
30
31
  "uuid": "^9.0.1"
31
32
  },
32
33
  "devDependencies": {
33
- "@jay-framework/dev-environment": "^0.10.0",
34
- "@jay-framework/jay-cli": "^0.10.0",
34
+ "@jay-framework/dev-environment": "^0.12.0",
35
+ "@jay-framework/jay-cli": "^0.12.0",
35
36
  "@types/node": "^22.15.21",
36
37
  "@types/uuid": "^9.0.7",
37
38
  "rimraf": "^5.0.5",