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

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.
@@ -0,0 +1,18 @@
1
+ export interface OriginAllowlist {
2
+ /** Full origins (scheme, host and port), matched exactly. */
3
+ origins: string[];
4
+ /** Bare hostnames, matched exactly, on any scheme and port. */
5
+ hosts: string[];
6
+ /** Hostname suffixes such as `.editor.wix.com`, on any scheme and port. */
7
+ suffixes: string[];
8
+ }
9
+ /**
10
+ * Entries are hostnames (`editor.wix.com`), full origins (`http://localhost:3000`, matched
11
+ * exactly, port and scheme included) or suffix patterns (`*.editor.wix.com`). Anything else —
12
+ * a schemeless `localhost:3000`, say — is ambiguous and is dropped with a warning rather than
13
+ * quietly widened into a host match.
14
+ */
15
+ export declare const parseAllowedOrigins: (value: string | undefined) => OriginAllowlist | undefined;
16
+ export declare const resolveOriginAllowlist: (env?: NodeJS.ProcessEnv) => OriginAllowlist;
17
+ export declare const isEditorOrigin: (origin: string, allowlist: OriginAllowlist) => boolean;
18
+ //# sourceMappingURL=origin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"origin.d.ts","sourceRoot":"","sources":["../src/origin.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,+DAA+D;IAC/D,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAYD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,eAAe,GAAG,SA6CjF,CAAC;AAQF,eAAO,MAAM,sBAAsB,GACjC,MAAK,MAAM,CAAC,UAAwB,KACnC,eAAsF,CAAC;AAE1F,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,EAAE,WAAW,eAAe,KAAG,OAU3E,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { WixCliPlugin } from './types';
2
+ import { startRuntimeErrorsServer } from './runtimeErrorsServer';
3
+ export interface WixCodeDiagnosticsPluginOptions {
4
+ startServer?: typeof startRuntimeErrorsServer;
5
+ }
6
+ export declare const wixCodeDiagnosticsPlugin: ({ startServer, }?: WixCodeDiagnosticsPluginOptions) => WixCliPlugin;
7
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +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;AAKjE,MAAM,WAAW,+BAA+B;IAC9C,WAAW,CAAC,EAAE,OAAO,wBAAwB,CAAC;CAC/C;AAED,eAAO,MAAM,wBAAwB,GAAI,mBAEtC,+BAAoC,KAAG,YA4DzC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { SerializedRuntimeError } from './runtimeError';
2
+ /**
3
+ * Messages the runtime-errors WebSocket sends to the editor, as JSON text frames. The editor
4
+ * mirrors this type; add a variant here before adding one there.
5
+ */
6
+ export type RuntimeErrorsMessage = {
7
+ type: 'runtime-error';
8
+ error: SerializedRuntimeError;
9
+ }
10
+ /** Application-level heartbeat. Browsers cannot see protocol pings, so the editor uses this one. */
11
+ | {
12
+ type: 'ping';
13
+ };
14
+ export declare const encodeMessage: (message: RuntimeErrorsMessage) => string;
15
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,sBAAsB,CAAA;CAAE;AAC1D,oGAAoG;GAClG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAErB,eAAO,MAAM,aAAa,GAAI,SAAS,oBAAoB,KAAG,MAAiC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export interface ParsedRequestPath {
2
+ path: string;
3
+ query: URLSearchParams;
4
+ }
5
+ export declare const parseRequestPath: (url: string | undefined) => ParsedRequestPath;
6
+ //# sourceMappingURL=requestPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestPath.d.ts","sourceRoot":"","sources":["../src/requestPath.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,eAAe,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,GAAG,SAAS,KAAG,iBAO1D,CAAC"}
@@ -0,0 +1,26 @@
1
+ export interface SerializedRuntimeError {
2
+ id: string;
3
+ name?: string;
4
+ message?: string;
5
+ file?: string;
6
+ line?: number;
7
+ column?: number;
8
+ stack?: string;
9
+ timestamp: number;
10
+ }
11
+ export interface SerializeOptions {
12
+ now?: () => number;
13
+ }
14
+ export declare const serializeRuntimeError: (payload: unknown, { now }?: SerializeOptions) => SerializedRuntimeError;
15
+ export interface RuntimeErrorLimiterOptions {
16
+ dedupWindowMs?: number;
17
+ maxPerWindow?: number;
18
+ rateWindowMs?: number;
19
+ maxTrackedFingerprints?: number;
20
+ }
21
+ export interface RuntimeErrorLimiter {
22
+ accept: (error: SerializedRuntimeError) => boolean;
23
+ trackedFingerprints: () => number;
24
+ }
25
+ export declare const createRuntimeErrorLimiter: ({ dedupWindowMs, maxPerWindow, rateWindowMs, maxTrackedFingerprints, }?: RuntimeErrorLimiterOptions) => RuntimeErrorLimiter;
26
+ //# sourceMappingURL=runtimeError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeError.d.ts","sourceRoot":"","sources":["../src/runtimeError.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAoBD,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,qBAAqB,GAChC,SAAS,OAAO,EAChB,UAAoB,gBAAqB,KACxC,sBAgBF,CAAC;AAEF,MAAM,WAAW,0BAA0B;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC;IACnD,mBAAmB,EAAE,MAAM,MAAM,CAAC;CACnC;AAKD,eAAO,MAAM,yBAAyB,GAAI,yEAKvC,0BAA+B,KAAG,mBAsCpC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { type OriginAllowlist } from './origin';
2
+ import type { SerializedRuntimeError } from './runtimeError';
3
+ export interface RuntimeErrorsServerOptions {
4
+ port?: number;
5
+ host?: string;
6
+ path?: string;
7
+ bufferSize?: number;
8
+ heartbeatIntervalMs?: number;
9
+ maxClientBufferBytes?: number;
10
+ closeGraceMs?: number;
11
+ allowedOrigins?: OriginAllowlist;
12
+ }
13
+ export interface RuntimeErrorsServer {
14
+ port: number;
15
+ requestedPort: number;
16
+ usingFallbackPort: boolean;
17
+ host: string;
18
+ publish: (error: SerializedRuntimeError) => void;
19
+ close: () => Promise<void>;
20
+ }
21
+ export declare const startRuntimeErrorsServer: ({ port, host, path, bufferSize, heartbeatIntervalMs, maxClientBufferBytes, closeGraceMs, allowedOrigins, }?: RuntimeErrorsServerOptions) => Promise<RuntimeErrorsServer>;
22
+ //# sourceMappingURL=runtimeErrorsServer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeErrorsServer.d.ts","sourceRoot":"","sources":["../src/runtimeErrorsServer.ts"],"names":[],"mappings":"AAaA,OAAO,EAA0C,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAGxF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAG7D,MAAM,WAAW,0BAA0B;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,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,6GAS5C,0BAA+B,KAAG,OAAO,CAAC,mBAAmB,CAmH/D,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { WebSocket } from 'ws';
2
+ export declare const sendToClients: (clients: Set<WebSocket>, message: string, maxBufferedBytes: number) => void;
3
+ //# sourceMappingURL=wsClients.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wsClients.d.ts","sourceRoot":"","sources":["../src/wsClients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAI/B,eAAO,MAAM,aAAa,GACxB,SAAS,GAAG,CAAC,SAAS,CAAC,EACvB,SAAS,MAAM,EACf,kBAAkB,MAAM,KACvB,IAWF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/wix-code-diagnostics-plugin",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
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",
@@ -15,8 +15,8 @@
15
15
  "scripts": {
16
16
  "clean": "rm -rf dist",
17
17
  "prebuild": "npm run clean",
18
- "build": "tsc && esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.mjs",
19
- "test": "echo \"No tests for plugin package yet\" && exit 0",
18
+ "build": "tsc && node esbuild.config.mjs",
19
+ "test": "jest --runInBand",
20
20
  "lint": "echo \"No lint for plugin package yet\" && exit 0",
21
21
  "typecheck": "tsc --noEmit"
22
22
  },
@@ -34,9 +34,14 @@
34
34
  }
35
35
  },
36
36
  "devDependencies": {
37
- "@types/node": "^18.16.1",
37
+ "@types/jest": "^29.5.14",
38
+ "@types/node": "^24.13.3",
39
+ "@types/ws": "^8.5.13",
38
40
  "esbuild": "^0.24.0",
39
- "typescript": "^5.9.3"
41
+ "jest": "^29.7.0",
42
+ "ts-jest": "^29.4.6",
43
+ "typescript": "^5.9.3",
44
+ "ws": "^8.21.3"
40
45
  },
41
- "falconPackageHash": "376916cfb639a4a0b35fef139e2add0a3850256e01430aecf316594b"
46
+ "falconPackageHash": "5d93feccee8c5b00cd5ae9dad8d135a2cd2ea5d9af17070a3c1cb1c3"
42
47
  }