@wix/wix-code-diagnostics-plugin 1.1.8 → 1.1.9
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 +3 -2
- package/dist/index.mjs +8 -0
- package/dist/plugin.d.ts +1 -0
- package/dist/plugin.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -60,6 +60,7 @@ server so the editor can show runtime errors from the running app:
|
|
|
60
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
|
+
| Opt-out | `WIX_CODE_RUNTIME_ERRORS_SERVER=off` skips the server and the `runtime-error` subscription; `cli-error` reporting is unaffected. The orchestrator sets it on `wix dev` for sessions in the `studio2DisableRuntimeErrorsServer` experiment, which rolls the stream down before its removal |
|
|
63
64
|
| 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
65
|
|
|
65
66
|
The plugin subscribes to the CLI's `runtime-error` event — that subscription is
|
|
@@ -68,8 +69,8 @@ fingerprint dedup (1s window) and a rate cap (50 per 10s), then broadcast to
|
|
|
68
69
|
currently connected editors and forgotten.
|
|
69
70
|
|
|
70
71
|
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
|
+
replay. The stream part is active on every `wix dev` run unless
|
|
73
|
+
`WIX_CODE_RUNTIME_ERRORS_SERVER=off`, independent of the two diagnostics env vars above.
|
|
73
74
|
|
|
74
75
|
`ws` is bundled into `dist/index.mjs`, so the published package still has no
|
|
75
76
|
runtime dependencies. Its optional native accelerators (`bufferutil`,
|
package/dist/index.mjs
CHANGED
|
@@ -4087,11 +4087,13 @@ var startRuntimeErrorsServer = async ({
|
|
|
4087
4087
|
// src/plugin.ts
|
|
4088
4088
|
var ENV_ENDPOINT = "WIX_CODE_DIAGNOSTICS_ENDPOINT";
|
|
4089
4089
|
var ENV_TOKEN = "WIX_CODE_DIAGNOSTICS_TOKEN";
|
|
4090
|
+
var ENV_RUNTIME_ERRORS_SERVER = "WIX_CODE_RUNTIME_ERRORS_SERVER";
|
|
4090
4091
|
var wixCodeDiagnosticsPlugin = ({
|
|
4091
4092
|
startServer = startRuntimeErrorsServer
|
|
4092
4093
|
} = {}) => {
|
|
4093
4094
|
const endpoint = process.env[ENV_ENDPOINT];
|
|
4094
4095
|
const token = process.env[ENV_TOKEN];
|
|
4096
|
+
const runtimeErrorsServerOff = process.env[ENV_RUNTIME_ERRORS_SERVER] === "off";
|
|
4095
4097
|
return {
|
|
4096
4098
|
name: "wix-code-diagnostics",
|
|
4097
4099
|
hooks: {
|
|
@@ -4111,6 +4113,12 @@ var wixCodeDiagnosticsPlugin = ({
|
|
|
4111
4113
|
if (cmd !== "dev") {
|
|
4112
4114
|
return;
|
|
4113
4115
|
}
|
|
4116
|
+
if (runtimeErrorsServerOff) {
|
|
4117
|
+
console.log(
|
|
4118
|
+
`[wix-code-diagnostics] runtime-errors WebSocket not started: ${ENV_RUNTIME_ERRORS_SERVER}=off`
|
|
4119
|
+
);
|
|
4120
|
+
return;
|
|
4121
|
+
}
|
|
4114
4122
|
const limiter = createRuntimeErrorLimiter();
|
|
4115
4123
|
const serverPromise = startServer({ port: RUNTIME_ERRORS_PORT }).then((server) => {
|
|
4116
4124
|
console.log(
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { WixCliPlugin } from './types';
|
|
2
2
|
import { startRuntimeErrorsServer } from './runtimeErrorsServer';
|
|
3
|
+
export declare const ENV_RUNTIME_ERRORS_SERVER = "WIX_CODE_RUNTIME_ERRORS_SERVER";
|
|
3
4
|
export interface WixCodeDiagnosticsPluginOptions {
|
|
4
5
|
startServer?: typeof startRuntimeErrorsServer;
|
|
5
6
|
}
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAMjE,eAAO,MAAM,yBAAyB,mCAAmC,CAAC;AAE1E,MAAM,WAAW,+BAA+B;IAC9C,WAAW,CAAC,EAAE,OAAO,wBAAwB,CAAC;CAC/C;AAED,eAAO,MAAM,wBAAwB,GAAI,mBAEtC,+BAAoC,KAAG,YAoEzC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/wix-code-diagnostics-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
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": "
|
|
46
|
+
"falconPackageHash": "771d51f4572d4054f36b714d3f9669b15b25b7b7d030927c9563203a"
|
|
47
47
|
}
|