@wix/wix-code-diagnostics-plugin 1.1.7 → 1.1.8

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.
package/README.md CHANGED
@@ -53,22 +53,22 @@ server so the editor can show runtime errors from the running app:
53
53
  | Through the dispatcher | `wss://<editor-host>/remote-machine/studio-proxy/projects/<projectId>/ports/52415/runtime-errors`. The dispatcher forwards the **full** original path, so the server strips `/remote-machine/{proxy,studio-proxy}/projects/<id>/ports/<port>` before matching |
54
54
  | Why WebSocket | The dispatcher buffers whole HTTP response bodies, so SSE (or any HTTP streaming) never reaches the editor. WebSocket upgrades are streamed through it frame by frame |
55
55
  | Messages | JSON text frames: `{ "type": "runtime-error", "error": { id, name, message, file, line, column, stack, timestamp } }` and `{ "type": "ping" }` |
56
- | Replay | Ring buffer of the last 100 errors, replayed on connect. `?after=<id>` replays only what came after that error; an unknown id (buffer rolled over) replays everything |
56
+ | Delivery | Live only. Each accepted error is broadcast to clients connected at that moment and then forgotten. A later connection receives no history |
57
57
  | Heartbeat | `{ "type": "ping" }` every ~25s. Application-level on purpose: browsers cannot observe protocol pings, and the editor needs to tell a live socket from a dead one |
58
- | Status probe | A plain `GET` on the same path answers `200 { transport, path, bufferedErrors, connectedClients }` — handy for checking the proxy route from a browser tab |
58
+ | Status probe | A plain `GET` on the same path answers `200 { transport, path, bufferedErrors: 0, connectedClients }` — `bufferedErrors` remains as a compatibility field; the server stores no errors |
59
59
  | Slow clients | A socket whose unsent bytes reach 1 MB is terminated, so a stalled editor tab cannot grow the dev process's memory |
60
- | Shutdown | When `wix dev` exits the process ends and the editor sees an abnormal close (`1006`); treat it like any dropped socket and reconnect with `?after=`. The programmatic `close()` sends `1001` (going away) and cuts a peer that does not answer within 1 s |
60
+ | Shutdown | When `wix dev` exits the process ends and the editor sees an abnormal close (`1006`); reconnect live, with no replay. The programmatic `close()` sends `1001` (going away) and cuts a peer that does not answer within 1 s |
61
61
  | Origins | `editor.wix.com`, `manage.wix.com`, `*.editor.wix.com`, `*.wix-code.com`. An `Origin` outside that list gets `403` on the upgrade and on the probe; a request with no `Origin` is served |
62
62
  | Origin override | `WIX_CODE_RUNTIME_ERRORS_ALLOWED_ORIGINS` replaces the list entirely — comma-separated. A hostname (`editor.wix.com`) matches on any scheme and port; a full origin (`http://localhost:3000`) matches **exactly**, that scheme and that port only; `*.editor.wix.com` matches any subdomain. An entry that is neither (`localhost:3000`, with a port but no scheme) is ambiguous, so it is dropped with a warning rather than widened. Set this to run a local editor against the stream |
63
63
  | Port clash | A second `wix dev` in the same sandbox cannot have `52415`. The stream moves to an ephemeral port and says so in the CLI output — the editor only looks at `52415`, so that run's errors do not reach it |
64
64
 
65
65
  The plugin subscribes to the CLI's `runtime-error` event — that subscription is
66
66
  what enables capture on the CLI side. Each error is serialized, passed through a
67
- fingerprint dedup (1s window) and a rate cap (50 per 10s), then buffered and
68
- broadcast.
67
+ fingerprint dedup (1s window) and a rate cap (50 per 10s), then broadcast to
68
+ currently connected editors and forgotten.
69
69
 
70
- Runtime errors are ephemeral by design: no orchestrator, no persistence, and the
71
- buffer dies with the dev server. The stream part is active on every `wix dev`
70
+ Runtime errors are ephemeral by design: no orchestrator, no persistence, and no
71
+ replay. The stream part is active on every `wix dev`
72
72
  run, independent of the two diagnostics env vars above.
73
73
 
74
74
  `ws` is bundled into `dist/index.mjs`, so the published package still has no
@@ -7,10 +7,8 @@ export declare const RUNTIME_ERRORS_PATH = "/runtime-errors";
7
7
  * `/dispatcher/<port>` prefix, so the plugin has to drop this one itself.
8
8
  */
9
9
  export declare const REMOTE_MACHINE_PROXY_PREFIX: RegExp;
10
- export declare const REPLAY_AFTER_PARAM = "after";
11
10
  export declare const HEARTBEAT_INTERVAL_MS = 25000;
12
11
  export declare const CLOSE_GRACE_MS = 1000;
13
- export declare const RUNTIME_ERRORS_BUFFER_SIZE = 100;
14
12
  export declare const DEDUP_WINDOW_MS = 1000;
15
13
  export declare const MAX_ERRORS_PER_WINDOW = 50;
16
14
  export declare const RATE_WINDOW_MS = 10000;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AAEzC,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAC0C,CAAC;AAEnF,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAE1C,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAE5C,eAAO,MAAM,cAAc,OAAQ,CAAC;AAEpC,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,eAAO,MAAM,eAAe,OAAQ,CAAC;AAErC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,cAAc,QAAS,CAAC;AAErC,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,eAAO,MAAM,mBAAmB,4CAA4C,CAAC;AAE7E,eAAO,MAAM,wBAAwB;;;CAG3B,CAAC;AAEX,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAE/C,eAAO,MAAM,uBAAuB,UAAY,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AAEzC,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAC0C,CAAC;AAEnF,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAE5C,eAAO,MAAM,cAAc,OAAQ,CAAC;AAEpC,eAAO,MAAM,eAAe,OAAQ,CAAC;AAErC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,cAAc,QAAS,CAAC;AAErC,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,eAAO,MAAM,mBAAmB,4CAA4C,CAAC;AAE7E,eAAO,MAAM,wBAAwB;;;CAG3B,CAAC;AAEX,eAAO,MAAM,mBAAmB,cAAc,CAAC;AAE/C,eAAO,MAAM,uBAAuB,UAAY,CAAC"}
package/dist/index.d.ts CHANGED
@@ -9,5 +9,5 @@ export { serializeRuntimeError, createRuntimeErrorLimiter } from './runtimeError
9
9
  export type { SerializedRuntimeError } from './runtimeError';
10
10
  export type { RuntimeErrorsMessage } from './protocol';
11
11
  export { parseRequestPath } from './requestPath';
12
- export { RUNTIME_ERRORS_PORT, RUNTIME_ERRORS_HOST, RUNTIME_ERRORS_PATH, REPLAY_AFTER_PARAM, REMOTE_MACHINE_PROXY_PREFIX, } from './constants';
12
+ export { RUNTIME_ERRORS_PORT, RUNTIME_ERRORS_HOST, RUNTIME_ERRORS_PATH, REMOTE_MACHINE_PROXY_PREFIX, } from './constants';
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAChE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAClF,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,GAC5B,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAChE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAClF,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,aAAa,CAAC"}
package/dist/index.mjs CHANGED
@@ -3774,10 +3774,8 @@ var reportDiagnostic = async ({
3774
3774
  var RUNTIME_ERRORS_PORT = 52415;
3775
3775
  var RUNTIME_ERRORS_PATH = "/runtime-errors";
3776
3776
  var REMOTE_MACHINE_PROXY_PREFIX = /^\/remote-machine\/(?:proxy|studio-proxy)\/projects\/[^/]+\/ports\/\d+(?=\/|$)/;
3777
- var REPLAY_AFTER_PARAM = "after";
3778
3777
  var HEARTBEAT_INTERVAL_MS = 25e3;
3779
3778
  var CLOSE_GRACE_MS = 1e3;
3780
- var RUNTIME_ERRORS_BUFFER_SIZE = 100;
3781
3779
  var DEDUP_WINDOW_MS = 1e3;
3782
3780
  var MAX_ERRORS_PER_WINDOW = 50;
3783
3781
  var RATE_WINDOW_MS = 1e4;
@@ -3997,22 +3995,13 @@ var startRuntimeErrorsServer = async ({
3997
3995
  port = RUNTIME_ERRORS_PORT,
3998
3996
  host = RUNTIME_ERRORS_HOST,
3999
3997
  path = RUNTIME_ERRORS_PATH,
4000
- bufferSize = RUNTIME_ERRORS_BUFFER_SIZE,
4001
3998
  heartbeatIntervalMs = HEARTBEAT_INTERVAL_MS,
4002
3999
  maxClientBufferBytes = MAX_CLIENT_BUFFER_BYTES,
4003
4000
  closeGraceMs = CLOSE_GRACE_MS,
4004
4001
  allowedOrigins = resolveOriginAllowlist()
4005
4002
  } = {}) => {
4006
- const buffer = [];
4007
4003
  const clients = /* @__PURE__ */ new Set();
4008
4004
  const broadcast = (message) => sendToClients(clients, message, maxClientBufferBytes);
4009
- const replayFrom = (afterId) => {
4010
- if (!afterId) {
4011
- return buffer;
4012
- }
4013
- const index = buffer.findIndex((error) => error.id === afterId);
4014
- return index === -1 ? buffer : buffer.slice(index + 1);
4015
- };
4016
4005
  const gate = (request) => {
4017
4006
  if (request.method !== "GET" || parseRequestPath(request.url).path !== path) {
4018
4007
  return { status: 404, reason: "not found" };
@@ -4035,7 +4024,7 @@ var startRuntimeErrorsServer = async ({
4035
4024
  JSON.stringify({
4036
4025
  transport: "websocket",
4037
4026
  path,
4038
- bufferedErrors: buffer.length,
4027
+ bufferedErrors: 0,
4039
4028
  connectedClients: clients.size
4040
4029
  })
4041
4030
  );
@@ -4048,10 +4037,6 @@ var startRuntimeErrorsServer = async ({
4048
4037
  return;
4049
4038
  }
4050
4039
  wss.handleUpgrade(request, socket, head, (client) => {
4051
- const { query } = parseRequestPath(request.url);
4052
- for (const error of replayFrom(query.get(REPLAY_AFTER_PARAM))) {
4053
- client.send(encodeMessage({ type: "runtime-error", error }));
4054
- }
4055
4040
  clients.add(client);
4056
4041
  client.on("close", () => clients.delete(client));
4057
4042
  client.on("error", () => clients.delete(client));
@@ -4087,10 +4072,6 @@ var startRuntimeErrorsServer = async ({
4087
4072
  usingFallbackPort,
4088
4073
  host,
4089
4074
  publish: (error) => {
4090
- buffer.push(error);
4091
- if (buffer.length > bufferSize) {
4092
- buffer.splice(0, buffer.length - bufferSize);
4093
- }
4094
4075
  broadcast(encodeMessage({ type: "runtime-error", error }));
4095
4076
  },
4096
4077
  close: async () => {
@@ -4161,7 +4142,6 @@ var wixCodeDiagnosticsPlugin = ({
4161
4142
  };
4162
4143
  export {
4163
4144
  REMOTE_MACHINE_PROXY_PREFIX,
4164
- REPLAY_AFTER_PARAM,
4165
4145
  RUNTIME_ERRORS_HOST,
4166
4146
  RUNTIME_ERRORS_PATH,
4167
4147
  RUNTIME_ERRORS_PORT,
@@ -4,7 +4,6 @@ export interface RuntimeErrorsServerOptions {
4
4
  port?: number;
5
5
  host?: string;
6
6
  path?: string;
7
- bufferSize?: number;
8
7
  heartbeatIntervalMs?: number;
9
8
  maxClientBufferBytes?: number;
10
9
  closeGraceMs?: number;
@@ -18,5 +17,5 @@ export interface RuntimeErrorsServer {
18
17
  publish: (error: SerializedRuntimeError) => void;
19
18
  close: () => Promise<void>;
20
19
  }
21
- export declare const startRuntimeErrorsServer: ({ port, host, path, bufferSize, heartbeatIntervalMs, maxClientBufferBytes, closeGraceMs, allowedOrigins, }?: RuntimeErrorsServerOptions) => Promise<RuntimeErrorsServer>;
20
+ export declare const startRuntimeErrorsServer: ({ port, host, path, heartbeatIntervalMs, maxClientBufferBytes, closeGraceMs, allowedOrigins, }?: RuntimeErrorsServerOptions) => Promise<RuntimeErrorsServer>;
22
21
  //# sourceMappingURL=runtimeErrorsServer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeErrorsServer.d.ts","sourceRoot":"","sources":["../src/runtimeErrorsServer.ts"],"names":[],"mappings":"AAaA,OAAO,EAA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M,CAAC;IACtB,cAAc,CAAC,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACjD,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAuDD,eAAO,MAAM,wBAAwB,GAAU,iGAQ5C,0BAA+B,KAAG,OAAO,CAAC,mBAAmB,CAkG/D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/wix-code-diagnostics-plugin",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "Wix CLI plugin that forwards CLI build/preview/dev diagnostics to the code-project-orchestrator over HTTP",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -43,5 +43,5 @@
43
43
  "typescript": "^5.9.3",
44
44
  "ws": "^8.21.3"
45
45
  },
46
- "falconPackageHash": "5d93feccee8c5b00cd5ae9dad8d135a2cd2ea5d9af17070a3c1cb1c3"
46
+ "falconPackageHash": "a354338121504c210ebb8975e072aa6b5edcf948691d27683fce4ce8"
47
47
  }